This repository contains the code and 3D source files to create a simple water level sensor that can be attached to a bucket of water, e.g. on your balcony, from which you're watering your plants using self-watering probes.
You will need a few things to assemble the water level sensor:
- A simple float switch
- A charging circuit for 18650 lithium batteries
- A holder for an 18650 lithium battery
- 3mm screws. You have to experiment which ones work best. The holes have a diameter of about 2mm.
These parts cost about $1 each.
- A 18650 lithium ion battery. Available e.g. at Amazon. Don't take the cheapest ones.
- A programmable microprocessor with Wifi, e.g. the Adafruit ESP8266 Huzzah or a generic NodeMCU board. Maximum size about 25mm x 50mm.
These parts cost about 10$ each.
- You'll probably need a soldering iron and some cables.
And last but not least a 3D printer to print the enclosure and inner structure that holds all these things together.
-
Download the STL files from thingiverse.com and print them.
-
Connect battery holder and charging circuit e.g. by soldering them together.
-
Connect charging circuit and ESP8266 board with (female) jumper cables. (That's important! Don't solder them together. I had problems flashing the chip when it ran directly off the battery. Probably because the battery provides more than 3.3V which may have confused the USB-serial converter.)
-
See the documentation of the ESP8266 board that you use. You probably need to connect GPIO16 to the RESET pin to enable deep sleep mode. Other boards than the Adafruit board may require more connections to work at all.
-
Stick float switch cables through the hole in the outer sensor enclosure. Connect them to the Wifi board. One cable goes to GND, the other to GPIO13. Again, it may be a good idea to solder the switch cables to female breadboard connectors.
-
Glue everything in place. I used strong double-sided foam tape.
Attention: Be careful with Lithium batteries. I have not tested the enclosure for safety. It is certainly not entirely weather-proof. Safety will depend on your choice of batteries, battery protection circuits, charging circuits etc. I do not take any responsibility if your batteries suddenly catch fire.
- Change Wifi configuration in
sketch/sketch.ino
and register at thingspeak.com. Also insert your thingspeak.com API key. - Again, see the docs for your ESP8266 board on how to flash it.
- Insert a battery, put everything inside the enclosure and close it with two screws.