Introduction: Arduino Outlet Box Control Center With Google Calendar
In this Instructable you will learn how to build a control center for your home using an Adafruit Power Relay Module 4-Outlet. You will need an Arduino board with a wifi module such as the Adafruit Feather Huzzah and an Adafruit Power Relay Module 4-Outlet. With this set up you will be able to connect your set up to the internet and turn on and off three outlets using events that you set in your Google calendar.
If you are not comfortable working with AC power please seek help from someone who is.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Materials
The materials below are intended to make a robust weather resistant arrangement. This might be beyond your needs in which case please use what every you feel you need. Additionally, it is possible to make a single out let with one Feather Huzzah. If this is all you want feel free to use 1-gang outlet box.
- Feather HUZZAH wifi development board
- Adafruit Power Relay FeatherWingComputer with Arduino software
- 2x 2-Gang Weatherproof Box with Three 3/4 in. Outlet
- 2-Gang Weatherproof Extra Duty While in Use Cover
- 2-Gang Weatherproof Universal Device Flat Cover
- 3 inch long 3/4 inch galvanized conduit that is threaded on either side
- Four feet of three stranded wire
- Three prong grounding plug
- 2x 15 Amp Weather and Tamper Resistant Duplex Outlet, White
- A few feet of lamp wire
- Heat shrink/electric tape
- Soldering iron
- Strain-Relief Cord Connector
Step 2: Assemble Your Arduino Components
The components you will need for this step are:
- Adafruit Power Relay FeatherWing
- Computer with Arduino software
- Feather HUZZAH wifi development board
- Solder all female connectors to the tripler
- Solder all included pins to the feather wing
- Be sure to identify the output pins you intend to use for the huzzah
- Identify the bridges on the bottom of the Feather Wings and solder the ones that correspond to the output pins on the huzzah. This is tricky so use a bright light to see how the PCB connects to the pins. (refer to pics)
- Assemble all the parts
- To test the feather wings touch one leg of an LED to ground and the other to pin 13 to test if they are getting power. The LED should light up.
- Mark what pins go to what FeatherWings
Step 3: Code
This section covers the code. The code is written for an aquaponics set up so some of the variable reflect that. Feel free to change them as you see fit.
To get this set up make sure you have an IFTTT.com account and an io.adafruit.com profile.
Set up three feeds in io.adafruit. I use Water, Fishfeed and light. Check photo
Set up three applets on IFTTT like the ones in the photo I included.
The Huzzah will monitor the aforementioned io.adafruit feeds and when the conditions are met in IFTTT the applet will send a signal to a specified io.adafruit feed.
The code is attached to this step.
Step 4: Case Build
Assemble the outlet boxes with the short piece of pipe connecting them
Build your power cord
Ground the power cord on the outlet box if it is metal.
Make four splices off the neutral wire in the power cord with the lamp wire and solder it to the negative bosses on the outlets. Wrap joint with electrical tape or heat shrink.
Make four splices off the live wire with lamp wire. Wrap joint with electrical tape or heat shrink. Attach one splice to one of the outlets so that it is wired to the power cord in the conventional way. This is the always on outlet. The other three need to be run up to second box with the arduino. Run the three wires into the three relays. Take three separate lengths of wire about the same length, attach them to the relays, minding the always open/always closed configurations, and then running them to the outlet. Mark what Feather boards go to what out lets and what wires connect them. This gets confusing.
Use a multimeter to ensure that your connections are good.
Fix the power cord in the bottom hole with the strain relief stopper.
Install protective coverings over the boxes.
Schedule when you want the outlets to function in Google Calendar. Have fun!