This is a cool example that teaches you how to use a Raspberry Pi, a PiFace and Ubidots to water your garden from far away. You’ll be able to control an electro-valve remotely to water your plants from any place, just using your phone.
Step 1: What do you need?
Well you’ll need some materials:
1. Raspberry Pi Model B
2. A PiFace Digital
3. A Water Valve – 12V
4. A Flexible Wire (1Amp)
5. A DC Jack
6. Power adapter (12V-DC 1000mA)
7. 3/4″ PVC threaded coupling
8. Teflon tape
9. Hose
10. Sprinkler
Step 2: Wiring things up
1. Connect the PiFace to the RaspberryPi without plugging in the power adapter.
2. Follow the picture above; White wire is ground (GND) and it’s connected to the common terminal of the relay Switch of the PiFace, while the red wire is connected to the NO pin (Normally Open).
Note: As for the hydraulic connections, make sure to use teflon tape on every union to prevent the water from leaking.
Step 3: Create a new data source in Ubidots
f you’re new to Ubidots, go to www.ubidots.com and create an account. Navigate to the “Sources” tab and click on “Add new Data Source”.
Step 4: Select Raspberry Pi as your new data source
Select the Raspberry Pi Icon and continue
Step 5: Create two new variables
Click on your data source and create two new variables: “valve” and “relay_state”
Step 6:
Step 7: Take note of your variables’ IDs
We’ll need the id’s of the variables for our Raspberry Pi program . We’ll also need you account’s API Key.
For more detail: Build a remotely activated sprinkler using PiFace and Ubidots