Get inspired by this code (three versions available), press the "thumb-up" button if it worked for you!
There are many Arduino projects dedicated to this objective, but it depends on what you want:
- Receive a warning (alarm sound, SMS, etc.) and go watering the plant ?
- After a while (days in general) some water is poured by a timing machine. Maybe your plant does not deed it at that time !
- Rely completely on moisture sensor. Big mistake! Local humidity can be misleading for the average pot humidity!
- Your device is monitoring the plant, pouring water if needed, when needed. You simply visit it, from time to time, and refill the water container when needed.
This last option was selected in this project.
Full detail at: https://sites.google.com/site/pre2arduino/
This is the central unit, which displays the mimosa emoticons: happy :) normal :| or unhappy :( , then the soil humidity (%), number of days and hours since last water was pumped. You can use any another display, of course. This one is reused from another board (Pololu A-Star Prime).
The moisture sensor is in fact from here: BangGood. It is a resistivity based sensor, which is not corroded as others write in Hackster projects. If you power-it on for only several milliseconds each time, just enough to read the humidity, it works fine. The one I show, worked for years, without any sign of corrosion. Just use the attached software. However other issues could occur: wet mud attaching to the sensor, shows a wrong local humidity as for the rest of the pot! If the sensor is too far from the water tube, the readings will have a large delay: the time needed for water to diffuse in the pot!! Put it relatively close to the water tube to stop water pumping, before there is too much water in the pot !! Change the humidity threshold in the software, according to your plant requirements. This one pumps water below 95% humidity (after some tests with my mimosa, I changed to 75% this threshold), for a certain number seconds, depending on the pot size. Then, after the reading period (10-15 min), if the indicated humidity did not surpass the threshold, a new quantity of water is pumped, but for a limited number of iterations. This method allows time for water to diffuse in the pot. Only two watering in a given interval (8-12 hours) are allowed to avoid spilling water, before diffusion, avoiding some possible sensor temporary errors. Re-calibration of the humidity sensor every few months is recommended: adjust the thresholds in the software: the value with sensor in air (0% humidity) and the value with sensor in short-circuit (100% humidity).
As micro-controller, we suggest the AtTiny85: it has the necessary I-O pins, just enough for the purpose (and cheaper than other Micro Controllers!).
The whole device (pump included) is continuously powered from a 220V power adapter giving 9V/ 0.5A. In case of a power failure, (hopefully lasting less than a few days, or else the plant will dry out!), it is not a problem. The system will restart, reading the humidity and pump water if needed, then will reset the hours and days counter.
Powering the pump is done by a Mosfet module, but this can be done by other means too, (e.g. a relay). The display can be any other with I2C interface. This one has a parallel interface, so a I2C adapter was needed (AtTiny85 has only 6 pins!!) as shown in the left side of the following figure as a prototype board with hot glue on it!
A year (and more) later
The project works for more than 18 months. One day the moisture sensor stopped dead ("bricked" in Hackster's terms!). Fortunately the software pumps water once every 2 days if no humidity requirements occur during that period. Now it's replaced and all works fine (a new humidity threshold had to be tested and set in the code, from 95% to 75%! Variability of products and soil salinity!)
If you build a project based on this code (three versions available), thank you for pressing the "respect" button!
Comments