Office Plant Baby Sitter (contest entry)
Office Plant Baby Sitter (OPBS)
I have a nice plant in my office. As plants do it requires a certain amount of attention or it will not thrive. The main thing it needs is water: not too much, not too little, but just the right amount. However, I can be away from my office for days at a time, sometimes unexpectedly. I have also been known to neglect my plant even when in the office due to extreme focus on an important project. This is hard on the plant.
What I need is an office gadget that will baby-sit my plant. It will automatically keep my plant at the appropriate level of moisture. It will measure the moisture content of the soil in the pot, and when it gets too dry, move water from a resevoir into the pot.
However, this only postpones the problem. What if I forget to fill up the resevoir when it is empty, or I am absent from the office for a few days just as it goes dry? If I am in the office, I want it to signal me, visually and audibly, to refill the resevoir. If I am not in the office, I want it to email (or otherwise notify) me, so I can get a co-worker to refill it for me, or make a special trip to the office to take care of it.
In order for the Office Plant Baby Sitter to do all this, it will need a fairly sophisticated 'brain', several sensors, internet access and at least one actuator. The sensors will include one for soil moisture, a detector to tell when the water resevoir is empty, and a light and motion detector to know when I (or someone) is in the office. Outputs will include a multi-color LED for showing how desparately water is needed, an audible alarm to accompany it and connection to the internet for sending email and other electronic alerts. The brain should have room for expanding the duties of the OPBS in case I get more plants, or need to add other abilities to the gadget.
- measure the moisture of the soil of a potted plant
- move a set/limited amount of water between a resevoir and the pot
- detect when the resevoir is empty
- detect when the office is occupied
- display a visual alert graded by color
- sound an audible alert of varying patterns
- send email, tweet, or other electronic communication via internet
- allow future expansion of project to include multiple plants
- use RS Components as primary parts supplier
- submit design to @TechWeekEurope #OfficeGadget by June 3rd, 2013.
- do not exceed £250 in costs, minimize costs when possible
The central component of the OPBS will be a microcontroller for the brain. For this project the BeagleBone Black was chosen, due to its room for expanding the project, price (lower than some Arduino models), built in ethernet connection and sophisticated on-board software with a full set of communication and development tools (ie a full Linux distribution). The only drawback of using the BeaglBone Black is that it is a 3.3V device and not 5v compatible. However, level-shifters can be used as a general solution to this problem. The board can be run off of a common (cheap) 5V, 2A "wall-wart" power supply.
Office occupation detection requires two sensors: a light sensor to detect that the office lights are on, and a PIR sensor to detect when a person is present. Two light sensors will be used be used for better detection. The PIR sensor will be a simple low cost unit with digital output. If both the light sensor and the PIR sensor show activity then the office is deemed occupied.
The most difficult sensor is the soil moisture sensor. In concept is it simply a device that signals when the soil is dry, and the plant needs water. However, this turns out not to be so simple. While there are many off the shelf soil moisture meters, the affordable ones are not reliable or robust, or are not compatible with a microcontroller. The few sensors made for a microcontroller also have problems in terms of reliability over time. Simple resisitive sensors, the cheapest kind, are subject to corrosion and
accuracy problems. A capacitive sensor with AC signal provides the most reliable and robust sensor, but is harder to interface with.
In the end, none of the pre-made units met the requirements of accuracy, price and ease of interfacing. A fully custom solution would take a lot of parts and effort to assemble. A compromise solution was selected, consisting of a kit for a simple moisture sensor combined with a couple of custom external circuits. The water sensor kit provides the basic sensor parts and circuit board. The sensor requires an AC signal input and outputs an analog signal, making it somewhat difficult to interface to a microcontroller.
The requirements are that a simple digital or power input from the micro-controller will enable the sensor, and a digital output will signal it when the plant needs water. It would also be nice to be able to adjust the threshold for different types of plants and soil. Therefore, in addition to the kit, a 555-timer ciruit will be added to create the input signal, and a comparator circuit with a potentiometer will be added to create the output signal. The potentiometer can be used to adjust the sensitivity of the sensor. These extra parts will be put on a perf board wired to the brain and the sensors.
The sensor requires probes. The probes will be constructed from copper clad PCB pieces coated with an insulating layer of paint. The probes will be connected to the sensor boards via a pair of wires, so that the electronics can be placed away from the plant where they will not get wet.
The water resevoir will consist of 3 parts: the tank, the dispenser and the actuator. The tank will simply be a recycled 2-liter bottle from either soda or water. The dispenser will hold the bottle in an upright, inverted position higher than the plant soil. It will have a lever that lets water flow when pressed. Several off the shelf dispensers are available for good prices. For refilling, the bottle is unscrewed from the dispenser and filled, then the bottle is screwed into the dispenser and reinverted. The sensor wire and tubing must be long enough to allow easy refilling.
A simple resistive sensor will determine if the water tank is empty or full. Two wires with bare ends will be placed in the dispenser just above the outlet. When water is present, current will flow between them and indicate that the resevoir is not empty. With no water, the resisitance between the wires is much higher. By using another comparator circuit, a digital output can be created to interface with the microcontroller. The sensor will only be activated for brief pulses every minute or so, avoiding
issues with corrosion.
The tubing will extend from the outlet of the dispenser to the plant soil. No pump is necessary, since gravity will pull the water from the dispenser down the tube to the soil. The servo will be connected to the dispenser lever. The servo-motor will allow the microcontroller to press the lever to water the plant. Since the lever is spring-loaded, the servo can be turned off when watering is not needed. Since speed is not an issue but strength may be, a geared servo will be used. To keep the design simple, the servo will be powered from the same 5V supply as the brain. The control signal for the servo will be connected to the microcontroller.
For appearance and safety, the entire project will be enclosed in a plastic project box. The box will contain the brain (BeagleBone Black), the soil moisture assembly, the resevoir sensor assembly, the display light, the signal buzzer, the two light sensors and the PIR sensor. There will be openings for connector for a power supply, the two light sensors, the PIR
sensor, the ethernet cable plug, the display light and the buzzer. There will also be connectors for the soil moisture sensor, the resevoir sensor and the servo control. An optional opening that will allow setting the sensitivity of the soil moisture sensor may be included as well. The wires to the sensors and servo should be long enough so that the case is in no danger of getting wet when the plants are watered or the resevoir is refilled.
All the software will run on the brain: the BeagleBone Black. Since it is a full linux distribution all of the development tools should be freely available.
The main program will consist of a daemon that runs in the background. Every 60 seconds the daemon will wake up and perform a series of tasks.
- read soil moisture
- enable soil moisture sensor
- wait for sensor to stabilize
- record status of sensor (wet or dry)
- read water resevoir status
- record status of water resevoir sensor (empty/not empty)
- read office occupation sensors
- read light sensor 1
- read light sensor 2
- if both sensor 1 and sensor 2 detect light
- set office lights status to lights on
- read PIR proximity sensor
- if sensor shows human presence
- set office presence status to in office
- if lights on and in office
- set office occupied to yes
- set office occupied to no
- if resevoir is not empty
- reset urgency to 0
- if plants are dry
- activate servo to open resevoir
- wait WATER_TIME seconds
- deactivate servo to close resevoir
- else (resevoir empty)
- if office is occupied and haven't signaled in over an hour
- activate led signal (color determined by urgency)
- activate buzzer signal (pattern determined by urgency)
- else if haven't emailed in over a day
- send email (subject contains urgency)
- increase urgency
- if office is occupied and haven't signaled in over an hour
- go back to sleep
Each action and sensor reading of the daemon will be logged to a file for analysis and debugging purposes. Programming, monitoring and debugging of the BeagleBone can be done via an internet connection, or using the built-in serial port as a terminal.
The tasks of setting up the BeagleBone Black, connecting to the internet, starting the daemon and sending email will all be done by the operating system and support programs. Only the daemon itself needs to be custom written. It can be written in a low-level language such as C/C++ or Java, or as a script in Python or Perl.
|BeagleBone Black||1||£||31.65||RS components||775-3805|
|level shifter chips||10||£||11.50||RS components||709-4639|
|TSSOP socket||5||£||26.40||RS components||158-2929|
|soil sensor kit||1||€||5.95||Tuxgraphics||add-on parts eth flower care|
|555 timer IC||2||£||0.86||RS components||709-4639|
|comparator chip||2||£||0.56||RS components||810-267|
|light sensor||2||£||2.50||RS components||609-9090|
|PIR sensor||1||£||20.09||RS components||327-7326|
|copper clad board||1||£||2.71||RS components||219-2139|
|flexible tubing||1||£||5.40||RS components||293-1990|
|perf board||1||$||3.00||Deal Extreme||130926|
|project case||1||£||3.99||RS components||502-657|
|straight connector||1||£||0.44||RS components||547-3166|
|90 deg connector||1||£||1.03||RS components||547-3223|
|capacitors 10nF||5||£||1.00||RS components||538-1411|
|capacitors 10uF||10||£||1.80||RS components||538-1203|
Equiv US $242.30
To add a second plant sensor:
|soil sensor kit||1||€ 5.95||Tuxgraphics|
|555 timer IC||1||£ 0.43||RScomponents|
|potentiometer||1||£ 0.82||RS components|
|comparator chip||1||£ 0.28||RS components|
total with shipping and tax = £ 9.93
- RS components
- Sparkfun Electronics
- Deal Extreme
- Tuxgraphics water sensor kit
- additional water sensor timer circuit
- BeagleBone Black