So… I’ve plugged my chilli plant into the internet. Every minute it will report how moist its soil is to a server on the web. Below is a live chart of that data – check it out – you can see exactly how moist my chilli plant is right this second. Wow, this is the sort of stuff the Internet was built for… probably.
Above is the moisture level record by the sensor of the system.
Hardware
For the moisture recording part of the project I didn’t need to buy any special hardware. As it turns out it is incredibly straightforward, you simply drive a current through two wires poked into the soil and measure the resistance. The less water, the more resistance.
I found some galvanised picture hooks in a toolkit to use as prongs for the sensor. I just had to solder some wire to them and glue them to a small block of plastic to keep them at a consistent distance.
Software
This project required very little server-side programming. I used cube to store the time-series moisture and watering event data, which uses node.js and mongodb under the hood. As mentioned in their docs, Cube is designed for internal use only so I added a simple proxy using node-http-proxy to lock down write access to the cube server – after all, I don’t want anyone hacking my chilli plant! Cube exposes a RESTful API which my arduino could happily talk thanks to the aJson library. All I had to do was deploy this lot onto a Amazon EC2 instance and the server-side work was done.
For the frontend visualisation I used the cubism JavaScript library which seamlessly integrates with cube. The arduino and cubism code can be found in this github repo – comments/questions/criticism of the code welcome.
Source:
- github.com/interactive-matter/aJson
- github.com/nodejitsu/node-http-proxy
- github.com/theon/auto-watering-system
Via: wiznetmuseum.com