Wednesday, February 23, 2011

Erratic sensor readings

I soldered the temp sensor and the photocell to a small perf board to enclose in a waterproof box BUT now the temperature sensor is giving erratic readings.

As always someone has seen this before and on the adafruit forum there is a write up about interferences

Solution to try:
The problem is that the Atmega on the Arduino has one ADC that is multiplexed for all the analog pins.
When you do an analogRead(), a multiplexer connects the pin you are reading to the ADC. This works fine for low impedance voltage sources.

It takes time for a high impedance sensor like your temperature sensor to change the voltage at the ADC after this switch of pins. Temperature sensors must use low power and thus be high impedance to avoid IR heating.

Try the following:

Code:
analogRead(5);
delay(10);
nTemp = analogRead(5) * 5000L / 1024L / 10;
The first analogRead(5) will switch the pin to the ADC. The delay will allow the voltage at the ADC to stabilize and the second analogRead(5) should get a stable value.

As a note:
The ATmega ADC is suitable for devices with at most 10K ohm impedance (see the 168/328 data sheet). The Arduino analog library does not handle the ADC mux well so 10K ohms impedance won't work unless you use tricks like multiple reads and delays.

Tuesday, February 22, 2011

Adafruit datalogger shield


Adding an SD card to the datalogger would be a good step. Here is the adafruit loggeshield with a temp and light sensor attached. Using ladyada's sketch called sensorSketch under folder dataloggerShield, you can see the values in the DEBUG window.


Then using adafruit-light-temp-logger/lighttemplogeer.pde, the data is logged to the SD card and also a time stamp added. Works like a charm.


NOTE: to have the LEDs working, you need to add a jumper from DigPin2 and 3 to the LED connections on the shield (yellow and orange jumper on photo)


Now to take the sensor circuit and enclose it in an outside case and connect to an XBee and we have a wireless station.

Sunday, February 20, 2011

Xbee remote sensor station




Revisiting old posts - connect sensors to an XBee and send data to a base station that includes a datalogger and later an ethernet connection.




Power is an issue so alllowing the XBee to sleep is a good idea Faludi tested battery life and for 98% sleep mode


XBee using one analog channel connected to photocell and 10K resistor voltage divider circuit1000ms sleep, 20ms awake, transmissions every 1000 ms, 9600 baudConfig on remote radio:ATRE,ID3333,MYAA,DLBB,D02,IT1,IR64,SM5,SP64,ST14

and 100%
XBee using one analog channel connected to photocell and 10K resistor voltage divider circuit1000ms sleep, 1ms awake, transmissions every 1000 ms, 9600 baudConfig on remote radio:ATRE,ID3333,MYAA,DLBB,D02,IT1,IR64,SM5,SP64,ST1


Sensor housed in waterproof box like a fuerte box or a simple Witz Keep it Clear $7

Thursday, February 17, 2011

Saturday, January 22, 2011

SDI-12 to arduino


Control panel for DO datalogger
Originally uploaded by whirlymark

Interfacing SDI-12 to arduino means converting SDI-12 to arduino or serial 232 input. Using a converter like the WaterLog H-4191 would work and LABView have some ideas on SD-12 usage. If the arduino used a MAX 232 chip or Sparkfun version to convert to 232 or the MaxSerial arduino from Freeduino

Better to use the %V and convert to TTL but SDI-12 is one wire for TX and RX. Ideas at AVR forum, with their final thoughts being

So I guess your best option is 3 LL parts, 2 inverters and one buffer with an output enable.

Ok here is my final solution for you, this combo should work.

Dual inverter for TX/RX: SN74LVC2GU04 running at 3.3V (5V tolerant inputs) which can be converted to DIP using SOT23 to DIP Adapter sku: BOB-00717 from Sparkfun


Tristate Buffer for Tx: SN74AHCT1G126 running at 5V (Vih min is 2V, so 3V3 logic should drive it fine) which can be converted to DIP using SOT23 to DIP Adapter sku: BOB-00717 from Sparkfun

That dual is nice, also. Running at 3.3V, the Tx inverter outputs 0/3.3V which is acceptable by the tristate buffer so its function is inversion, only. On the Rx side, the input is 5V tolerant, so it behaves well receiving on the SDI-12 bus. It is also $0.40 in quantity of 1 and $0.11 @ 3K from DigiKey. So, it won't break the bank.

Alternative solution: Now my solution was to use the ADG3304 bi-directional voltage level shifting IC to also provide 5V logic level enables for the tri-state buffer, as well as logic shifting for the RX/TX


On-line temperature sensor site


A site that refreshes an on-line temperature sensor. Nice PHP script working

and using sensor from fascinating electronics


Monday, January 17, 2011

Hackerspace Syracuse

Jan 20 @ 6pm

Location
Syracuse Innovators Guild

224 Harrison St
Syracuse, NY 13202

How to find us
"Suite 214, and if the outer door locks because you arrive a little late call me at [masked] and I'll let you in."

Thursday, January 13, 2011

Water flow sensor


A cheap hall effect water flow sensor from Seeed Studio only $10 - wow!

Monitor temperatures remotely


Read a thermometer on-line using an arduino and an ethernet board, and also Tom Igoe used an ethernet shield to upload data to Pachube, and also in the arduino library
Sparkfun has a great enclosure for an ethernet shield on an arduino and there is an interesting site about using a smart Phone to control it all.