Introduction: Forget Me Not- Remote Flower Watering
Lucy Matchett, Nicole Yi Messier, and Joselyn McDonald (Snax_and_Macs) made a remote flower-watering device so you can water your loved ones' plants when you water your own.
We used Arduinos, a photoresistor, a servo, Arduino and Processing sketches, Spacebrew, and a little elbow grease to put it all together.
We've posted the instructions, and the link to our gitHub in order to get the code. We ask that you try making remote elements for doing other things for your loved ones. Let's get creative together. This is a template, build on it, and share it with us and others.
What you need to get started:
2 x Arduinos
1 Servo Motor
1 Photoresistor (Or any sensor)
1 Resistor 10k ohm
Foam Core or structural building material of your choosing
Arduino and Processing Applications
Step 1: Light Sensor to Arduino
- First you want to connect your photoresistor to the Arduino (refer to the schematic).
We wanted to have a pick up / set down motion of the watering can that triggered the change in the sensor. So to do this you will need to build a platform with a small hole in it for the sensor. So that when the watering can covers the sensor and will reduce the amount of light. We attached the photoresistor with copper tape and alligator clips.
- Next you will want to test your resistor and sensitivity it has, this will differ from sensor to sensor. It's good to check. We used this simple sketch.
- Now you will need to connect the Arduino to Processing, in order to easily get it to talk to Processing we used the Firmata Library, which is already included in the Arduino software package but you will need to download it for processing. It can be found here.
- You will need to open the Standard Firmata example in Arduino and load this onto your board.
- Next open Processing and test that your connection is working. Open an input example from the Firmata library, this will take input from any pin, the only thing you will have to change is the array number that associates with which Arduino you are using.
Step 2: Servo Motor to Arduino
1. First you want to connect your servo motor to the Arduino. Here's a tutorial.
2. We wanted to have a 90 degree motion of the small watering cap that was triggered by when our processing sketch received a message from the photoresistor. We built a little platform with an arm out of foam core and tape. Essentially, the arm lays on top of the servo motor and tilts with the motor's motion. Refer to the photographs.
3. Next you will want to test your servo and make sure it is working and rotating in a way that tilts towards the vase of flowers to which you want to add water.
4. Now you will need to connect the Arduino to Processing, in order to easily get it to talk to Processing we used the Firmata Servo Library, which you have already downloaded in Step 1.
5. You will need to open the Servo Firmata example in Arduino and load this onto your board.
Step 3: Connecting the Local and Remote Elements
1. If you haven't already, download the repo on two computers connected to your arduino set-ups.
2. Open the water_can.pde processing sketch on the computer connected to the photoresistor/arduino.
3. Open the plant_motor.pde processing sketch on the computer connected to the servo/arduino.
4. Now it's time to connect your local photoresistor water_can.pde processing sketch to your servo (remote) plant_motor.pde sketch using Spacebrew (http://docs.spacebrew.cc/examples). This is how the two sketches are going to talk to each other. Run your processing sketches. They will then appear on the admin Spacebrew server.
5. You'll want to open up the admin Spacebrew server (http://spacebrew.github.io/spacebrew/admin/admin.h... and connect your two nodes - the publisher (water_can.pde sketch) with the subscriber (servo plant_motor.pde sketch). Just click on the publisher and click on the subscriber, and they will connect.
##Note - If you change the names of the publishers and/or subscribers in your Processing sketches , and we encourage you to do so, do not use Camel Case.
Step 4: Water Your Plants
Now it's time to try out your code!
Lift your water cup on the photosensor platform to see if your code is working correctly. If all is working well, your servo should turn 90 degrees and water your plants on the other side. You'll have to add the water yourself, of course.
1. It helps to open up the serial monitor in Processing to debug. We are printing the resistor's range to the serial monitor for your convenience.
2. Every time you stop running your Processing sketch, you'll have to reconnect the nodes on the Spacebrew Admin site.
3. We added black sharpie markings to the bottom of the water cup in order to add to the sensitivity of the photoresistor to the light.
We have a be nice policy.
Please be positive and constructive.