Odebírejte aktuální články:
Feed RSS
Dnes je 25. května a svátek má Viola.
Zítra slaví Filip.
Toto je archivní verze článku z 3.12.2018, 22:01.

Automatic plant watering with Raspberry Pi Zdroj článku v novém okně

Snímek Who hasn’t had hers/his plants die at home while traveling for a few days? Unfortunately my plants suffered from this fate too. Since I already have my plants connected to the internet via Raspberry Pi, notifying me whenever the soil gets dry, one solution is to have that same event trigger actual plant watering. That’s what I set out to accomplish. By researching online, I stumbled upon an interesting tutorial Raspberry Pi Automated Plant Watering with Website which describes the hardware build very well, but adds a web server on top, which I find useless. I decided to run my own software stack. Hardware parts necessary (assuming Raspberry Pi plant sensor is built already): mini motor water pump 3-6V 7-10mm aquarium hose container which can hold some water soldering iron, solder 5V relay old USB charger After getting all the necessary parts, first step is to cut the USB charger phone part off and expose red and black wires. Next, solder the red wire sticking from the pump to the red wire exposed from the USB charger cable. When the soldering is done, it’s time to connect everything together. See the complete wiring diagram with two moisture sensors in the figure below. I have two sensors for two plants, but only one water pump for now. Ports (as per pinout.xyz ) used for the pump are (first relay, then Raspberry Pi 3): IN1 to BCM port 27 ( pin 13 ) GND to ground ( pin 6 ) VCC to 5V power ( pin 4 ) The next step is to fill the water container with water, tape the pump as close as possible to the container’s floor and use something (e.g. a wine bottle) to hold the outlet from the hose. I measured, that the motor can pump 23ml of water each second, thus it should be enough to pump for 1 or 2 seconds each time when the soil is dry. As for software, get my updated scripts from  the associated GitHub repo . The configuration from moisture.py can be seen below. First the moisture sensors are set-up: # Define the GPIO pin that we have our digital output from our sensor # connected to and URL which to call on sensor state change sensors = { "peace_lily": (17, "** URL 1 **"), "parsley": (23, "** URL 2 **") } then the water pumps: # Define the GPIO pin that we have our digital input to the # respective relay connected to and number of seconds to pump # each time pumps = { "parsley": (27, 1) } When I get my second water pump, after wiring, I will just add a new entry under “pumps” with the corresponding pin.   Watering system in action That’s all folks, happy farming!

[ Článek vyšel na webu Zee.cz ]   [ Dne 3.12.18 v 21:27 ]  

Blog týdne

Zrcadlo.blogspot.com Webová stránka v novém okně

Onehdá jsem navštívil bývalé spolužáky v Praze. Když jsem zmínil, že asi nepůjdu volit, dívali se na mě jako na Pána pekel. Tudíž musím. Ačkoli je... chci si přečíst více ]

O službě Bloog.cz  |  Vaše připomínky  |  © 2018 Jakub Horák