Wednesday, September 23, 2009

Plant Monitor

It took me a little while to get a few bugs sorted out. But I now have a working plant monitor.

The receiver sits by the computer. It's an arduino with a loosely wired shield. The RF receiver's data line goes into the Arduino's RX. The rest are either unused or for power.

One change I will make to version 2 (if I ever get round to a version 2) is to make a small packet get sent rather than the ID and then the reading. I would also be interested in sending the temperature. I'm unsure if the temperature effects the conductivity of the soil, but I guess I'll work that out in the coming weeks. Maybe I'd have to adjust the threshold dependant on the temperature.
Both .pde files needs the RFDriver.pde file from Morris's site (mentioned in the last post). It needs to be in the same directory and this only works with Arduino's IDE version 16 onwards.


PlantRcvr.pde
PlantTrans.pde

Note - don't program the tx with rx or vice versa. Rookie mistake.


Now the transmitter is a little simpler.The idea is that one transmitter can do a windowsill full of plants. Luckily the ATmega328 has 6 A/D channels, so we don't have to do anything tricky to monitor 6 plants.

You could pull the AVR out of the arduino (carefully!) and attach the power rails and hook all of the lines up as per the pins on the arduino if you want to save yourself an arduino board. I'll be doing that as soon as I get my hands on a 16MHz crystal. Even after changing the clk fuse I can't seem to get a un-clocked chip to work.

I'm sure there's bugs in the code and it's hardly optimised at all. Let me know if you use it, like it, hate it, or find bugs. If you optimise or add functionality let me know, I'm interested to see what this could become.

Monday, September 21, 2009

Arduino Project

I've been enjoying playing around with the Arduino recently. It's really quick to prototype and then I can optimize the code and port to a cheaper AVR if I like the project enough.

My girlfriend and I (okay, mainly me) struggle to keep the houseplants watered. We've lost a few crops of basil to overwatering and some chillis have dried out and are currently struggling to keep on keeping on.

So, the plan... Using the principle that dirt will have a lower resistance when it's wet, I'm going to set up some remote voltage sensors on all of the plants and then wirelessly transmit the soil moisture level to an Arduino Duemilanove equiped with a receiver.

The basic concept for the wireless link is seen at this hackaday entry - Cheap wireless for microcontrollers.

The microprocessor will check on the moisture (read:voltage) level every half hour and transmit it and their id back to the receiver shield which will sit next to my computer.

At the receiver I will store the maximum and minimum resistances. The plants should never get to 'dry' so once the moisture level is 20% above minimum. I will light up the Arduino' s LED to to indicate that the plants need watering.

Prototype reciever working... code to come.