Thursday, June 24, 2010

Pachube Cloud Sensor Build

Test_4 8:31am 26 June Saturday:
Results Test 3
Failed with error code on PUT.
"Data updated: Fri Jun 25 13:51:04 UTC 2010, currently: frozen."
~2,500 updates.

Start Test 4 8:31am
code: pachubeLm335zTemperatureSensor_v1

Test_3 6:04pm 25 June Friday:
Results Test 2
Failed with blinking 13 6:00pm.
~2,500 updates.

Start Test 3
code: pachubeLm335zTemperatureSensor_v1

Test_2 2 5:26pm 25 June Friday:

ResultsTest 1
The board failed several times during the day- I rang Jade to reset the power to the Arduino. Again failure with blinking 13 LED.
~2,500 successful updates.

Start Test 2
Have unbent the RESET pin on shield and have installed as normal.
code: Pachube_client_watchdogTimer_v2

Test_1 7:45am 25 June Friday: Having trouble using the bent RESET pin, so put it back to normal. The ethernetShield seems to bug out, its onboard LED (d13) flashing rapidly and the serial monitor displays no more output. This is only cured by cutting power to the board and restarting. Is this because I have not yet burned the Lady Ada bootloader?

Start test 1
leave the bent pin, but ran a jumper from Arduino RESET to the ethernetShield RESET.
code: Pachube_client_watchdogTimer_v2

Main Post 25 June Friday:

An attempt to build a reliable internet data logger (using Pachube servers). This hardware and bootload modification will allow the AtMega watchdog timer to be used to reset the Arduino board when a lockup is detected. It also boasts the feature of resetting the ethernetShield separately from the Arduino before every ethernet connection (bend RESET pin on your shield so it is not connected to Arduino). Digital pin 9 is then hooked up to the RESET pin of the shield to allow a shield reset in the sketch.

Arduino Duemilanove 328 + Official EthernetShield + LM335 (z) temperature sensor.

Bent out RESET pin of ethernetShield and ran Digital9 to reset of the shield as Pachube's official tutorial shows.

Temperature calculation for voltage of board (vB), analog output (a), voltage divisor (vd), millivolts (mV), kelvin (k) and celcius (c).

vB = 4.955

a = analogOutput

vd = 1024/vB

mV = a/vd

k = mv/10

c = k - 273.15

Saturday, June 19, 2010

Pachube 8281


Arduino feed of LM335 temperature sensor to the cloud.

This is an extension of the LM335 temperature sensor circuit adding internet logging capabilities to the Arduino using Pachube (patch-bay). It is basically the same circuit with the Tellymate and Arduino (Wiznet) EthernetShield added, so I will point you to the original LM335 plans.

Everything is stock so far, no modifications have been made to the ethernetShield or the Arduino. I do get the freezing problem with the Arduino quite regularly, so a reset is indeed needed. My solution was to use an old Arduino Atmega8 I have lying around and program it is a "resetter". A simple sketch with digitalWrite to pin 9 (hooked up to the Arduino RESET) gives me a hard reset every 30 minutes.

Wiring to Pachube is a breeze, but could not figure out how to send proper results using "sprintf()". In the end I just sent comma-delimted values using "localClient.print" and bypassed the "pachube_data" array as set up in the tutorial sketch. Also I am very impressed by the speed, reliability and level of online documentation for Pachube-- hopefully this will stay around as a sustainable business model even if they start charging for their services. Good stuff.

Porthole and the QR image generator are quite interesting as well for Pachube feed visualization and physicalisation.

>>Project Zip Files arduino/sketches/ pachubeLm335zTemperatureSensor_v1

Thursday, June 10, 2010

Servo Robot Platform with SRF05

>> Fritzing Project (code, schematics,images)

Servo Robot Platform with SRF05 Ultrasonic rangefinder, SerLCD 2.5 Module with 16x2 LCD, Two Servos, and an Arduino Mega. Switch the serial RX off when uploading to the board.

To be continued...

Monday, June 7, 2010

Two Servos AT-ST Robot

This my improved servo robot with both hip and neck rotations. The skeleton is a step up from the previous Coke-can, I have used the Meccano (Erector) Crane kit parts to built a nice base for the AT-ST. It was my first time using Meccano and turned out to be a pleasure to work with. They are versatile, quick, and secure-- perfect for adhoc robot framing.

--> Arduino 0018 Sketch for Two Servos and SerLCD module
(do not upload with TX attached to SerLCD)

Robert Tempchin - Sweet robot neck! How strong are those servos? Strong enough to crush your enemies?4:06 am

Mike Jirsa - Are those step motors or normal servos? I saw that you have the degree feedback from the servos, but is that something that is measured or inferred from the last position+movement?

Depending on the application, you may want to go with step motors/controllers for more precise control.
4:16 am

Done moderating comments
Christopher Lee - Not that strong- but these are:
They are just normal servos, the cheapest I could find at the hobby store. The degrees output on the LCD is actually the degree I send to the Servo.write(rotation) method-- there is some pulse wave modulation that is worked out by the library for me in order to control the servo.

The potentiometers control the rotation and are hooked up to some analog inputs on the Arduino.

Saturday, June 5, 2010

Hello, Coke-bot! (Arduino Servo Test)

Controlling a servo motor with an Arduino board and potentiometer. Rotation output to the SerLCD module. Hello, Coke-bot!

Circuit is based on Fritzing diagram

Wednesday, June 2, 2010

Making a USB Temperature Sensor, Journal (with the Arduino and LM335)

Post Moved to:

15 June 2010- New improved circuit, better readings
>> new files (code/fritzing)

Hooking up the original board above and running tests (10 degrees c to 25 degrees c with house heater) show the circuit is NOT accurately determining temperature. Need to investigate further. Calibrated to 25 degrees c- however a cold morning the next day (house ~10degrees c) showed a reading of -11 degrees c from the sensor. That's not right!
One problem seemed to be my calculations using the assumption of Arduino's board voltage of 5v. This is true when using the external power, however powering an Arduino Mega with the USB only resulted in a board voltage of 4.79 v. (AREF and 5V out)

Tried to recalculate the initial design-- 2000 Ohm resistor was chosen to reflect a 2.5mA operating current. Also, the designs for a 15v circuit show a 6k resistor (15v/6k = 5v/2k).
So what is the problem? I am planning on rebuilding the circuit tonight (basic temperature sensor, uncalibrated).

The sensor is hooked up backwards!

28 November 2008 - USB Temperature Sensor with Arduino and LM335
  • Updated Jun 5 ,2010- SerLCD 2.5 and Arduino 0018 Sketches and Video
  • Repost from Nov. 28, 2008 on (transferring for archival purposes)

--> Processing sketch for (standard firmata arduino 0018)
--> Arduino 0018 sketch
--> SerLCD 2.5 with LM335A Arduino 0018 Sketch (do not upload with SerLCD hooked up to TX pin! It may corrupt the module memory.)

Here is a recent experiment I've done with making a cheap temperature sensor connected to my MAC. The sensor itself is quite cheap to make (the orange board), the sensor IC is about 3 dollars, and the rest are some wire jumpers, a 2k trim potentiometer and a resistor. Total cost about $8-10 and some free time.

What you see the temperature board hooked up to is an Arduino, a cheap USB i/o controller available from Sparkfun electronics. I can control about 10 analog inputs (one is being used to monitor the voltage of the temperature sensor) and 10 or so 5V outputs that I monitor/switch from the computer. The neat thing about getting this interfaced to an i/o board is I can use the temperature data to switch devices, sound alarms, etc.

Here is a screenshot of the software. Basically, the temperature sensor takes an input of 5v, and will output a voltage at +10 mV/ Kelvin, which can be easily converted to Celcius as seen in the software. The sensor turns out to be quite accurate and highly responsive -- I can breath on the sensor lightly and detect a minute temperature change. Right now it is obviously not waterproof, but that is easily solvable with some heat shrink tubing (this is actually recommended in the IC datasheet by the manufacturer for making waterproof temp. sensors!)

A diagram of the board, and all the parts used. I'm happy to explain how the Arduino board works to any interested, and code examples are available for the brave hearted.

Postby TheChemist » Fri Nov 28, 2008 1:30 pm


Could you post the actual schematic, just so it is more clear, how the connections on the test board were made.

Also, how cheap is Arduino? Do you know if it is available worldwide?
Is there something similar for digital input/output? I see so much potential use for this gizmo it is mind boggling. :)
Also, do you know, how accurate are the readouts from Arduino?


Postby SirLeech » Fri Nov 28, 2008 2:47 pm

Andy, the Arduino boards are about $30 USD, I have one I brought from the US from Sparkfun electronics, and I've also purchased another one here in Australia (thats why you see two, my temp sensor actually only uses one, but I was playing with getting the two to talk when I took the pictures). They are fairly popular among the physical computing community so you should be able to find them quite easily; if you don't have any in your country I'm sure you could find an international shipper.

The Arduino board has 13 digital in/out pins that can be used either way, and 6 analog inputs. Each digital pin can also be used for serial TX or RX, and two digital pins are also available for hardware serial TX/RX. Lots more information on these boards is available on the website. Great little boards and I love them to death.

Your question about accuracy-- the accuracy would be as good as your sensor. The temperature sensor I've build here depends on the trim pot to make a calibration, which is only as good as the thermometer I'm calibrating to. What I read from my analog input is an integer value from 1-1024, which I'm assuming 1 = 0v and 1024 = 5v in my calculations. I then convert the number to volts, then to kelvin, then to celcius. You can see the original 1-1024 reading as "raw" in my software.

Here is the schematic I used from the LM335Z Temperature Sensor PDF. The trim pot used is actually 5k (10k works, but I found 5k is actually better for the 5V load you get from the Arduino), and the R1 resistor is 2k. Find the LM335z from Mouser or some other electronics supply. I can buy them from my local electronics shop they are that common.


An actual error from work today. Weren't screen fonts way better 20 years ago?


- Posted using BlogPress from my iPhone

Location:Winnecke St,Ainslie,Australia