Introduction: DIY Home Automation for Beginners. Absolutely No Coding or Soldering Required. Android/Arduino for Switching Things on and Off
Third Prize in the
Age of Aquariums Contest
This instructiable is aimed at the absolute beginner. If you can handle a sharp knife without cutting your fingers off you can make and customize this home automation controller.
Safety Warning – This tutorial is for beginners and only covers switching low voltage devices. 110V/240V Mains power is lethal. Any wiring to the mains power should only be done by a qualified electrician.
This instructable first goes through the steps required to switch low voltage devices on and off from a custom menu on your Android mobile without needing to do any coding or any soldering.
It then gives a detailed construction example by completing the Fish Tank control started in a previous instructable, Code generator for custom Android/Arduino menus to switch Arduino outputs on and off.
Step 1: DIY Home Automation for Absolute Beginners - Quick Start
No soldering, No coding
The quick start steps are very simple really. Absolutely No coding and No Soldering :-
- install the free pfodDesigner Android app.
- create your custom menu in pfodDesigner to switch up to 4 things on and off, driven by Arduino outputs D7,D6,D5 and D4
- transfer the generated code from pfodDesigner to your computer and program your Arduino Uno
- plug in the bluetooth shield and relay shield,
- wire up your low voltage devices to the relays
- power with a USB power pack and connect with pfodApp to switch your devices on and off from your Android mobile.
Here is a complete parts list.
This is Home Automation for Beginners so it only deals with switching low voltage devices, I.e devices supplied by low voltage power packs, but that covers many devices in the home. Led lighting, for example, is often (but not always) powered by a low voltage power pack.
Step 2: Beginners's Home Automation Example - Completing the Fish Tank Controller
The previous instuctable, Code generator for custom Android/Arduino menus to switch Arduino outputs on and off has already covered using the free pfodDesigner to create your own custom Android menu to switch things on and off.
In that tutorial we used pfodDesigner to generate all the Arduino code needed to show a Fish Tank controller menu on your Android mobile, via pfodApp, and to switch Arduino outputs on and off for the Led light and pump.
Both the Led fish tank light and the pump are powered by low voltage power packs and so are suitable for complete beginners to control.
Now all you have to do is mount the boards in a box and wire up the relays.
Here is the parts list for the boards (again).
To mount the controller you need a plastic box, a sharp knife (you can use a sharp kitchen knife but the craft knife show above is easier to handle), some files, two tie wraps, some double sided tape, a small screw driver and, depending on the type of low voltage power cable, an insulated screw terminal (the type used for joining power wiring will do).
The box I am using here is bigger then it needs to be and has a clear plastic lid, but it was what I had on hand. The insulated screw terminal is only needed if your low voltage power cable is a round one with copper brad covering a central core. (see below for an example)
Step 3: Preparing the Box
Using the files, make small slots in one side of the plastic lid to allow entry for the USB cable from the USB power pack and the low voltage power leads of the devices you are switching. Here I am going to put both low voltage power leads through the one hole.
When we are finished we will stick the stack of boards to the lid using the double sided tape.
Step 4: Wiring the Relays
Then cut one of the low voltage power wires coming from the power pack and carefully strip back the insulation of the two ends. Taking care not to cut the wires.
Always push the knife away from you so that when it slips you will not have to rush to hospital for an expensive tendon operation on your hand.
Then unscrew the NO4 (normally open) and COM4 (common) terminals for relay 4 (J4) and insert the wires you have just bared and screw up the terminals. Relay 4 is controlled by Arduino's output D4 which was selected to be connected to the Pump menu button by the pfodDesigner code generator when the menu was created.
That's the pump done.
The Led Light has a round low voltage power cable, so wiring it up is a little different. Cut the cable completely through and then carefully strip back the outer insulation to expose the copper brad and the inner core. Do this to both ends and then twist the copper brad all together and secure it in the insulated screw terminal.
Then strip back the inner cores and wire them to theNO3 and COM3 terminals. That's it finished.
Step 5: Try Out Your Custom Controller
Use the double sided tape to secure the shield. Screw the lid on and plug in the USB wall power pack. Now you can connect from your Android mobile using pfodApp and turn the Pump and light on and off. See pfodAppForAndroidGettingStarted.pdf for how to add a new connection to pfodApp
You will be able to turn your light and pump on and off. No need to slide the slider, just click anywhere in the button.
Step 6: Next Steps
Using the free pfodDesigner you can create your own Android menus to switch up to 4 devices on and off using these relays.
The pfodApp can have multiple connections defined so you can use the same pfodApp to control multiple boxes.
This instructable generated all the necessary code for you. You can use the generated code as a starting point for your own extensions. For example one user added a timer so that once the pump was turned off for feeding, it automatically turned back on after a preset time.
The pfodApp also supports wifi connections so you can use a wifi shield instead of a bluetooth shield. Note: the pfodDesigner currently only supports sending data via Hardware serial so the wifi shield would need to connect via Serial or Serial1. Otherwise you would need to do some small programming modifications. You can also use the Ethernet Shield with some programming modifications.
The wifi connection also supports 128bit security. To use that you need to change the pfod parser. See A Simple Example of a WiFi connected Arduino pfodDevice with 128 bit security for the details.
Email me at www.pfod.com.au via support is you need any help.
We have a be nice policy.
Please be positive and constructive.