DIY Hacking Your Own Home Automation System

by bitsandbots in Circuits > Arduino

47089 Views, 642 Favorites, 0 Comments

DIY Hacking Your Own Home Automation System

FY6IXB1I7SVSRAQ.jpeg
20150428_115053_zpsdkzkr5og.JPG
FI75YIPI7VQSSYN.jpeg

A home automation system should be able to turn on/off appliances such as lights, fans, entertainment systems, etc. A system that is wireless yet independent from the Internet, but most importantly, DIY and open-source because I want to understand how it works.

Why re-invent the wheel?

Want More?

  • Why DIY when you could buy?
  • What is a “Smart” Garden?
  • Starting a Smart Indoor Garden
  • Digging Deeper into Indoor Gardening
  • Indoor Gardening: What can go wrong?
  • Managing Nutrient Solution Systems
  • Why Arduino when you can Pi?

hydromazing.com

Review the CoreConduit: Garden Controller System

F80L6QTI916E20L.jpeg

The Coreconduit: Garden Controller System does more than we need for human living conditions so let's see what it is doing so we can make some changes. The author of the Instructable drones on and on about healthy plants requiring attention and boredom until,

"...I've programmed into the Arduino a function I called, "TheDecider" that makes decisions based on maintaining optimum environmental conditions for growing plants. I added 2.4Ghz Wireless Radio Transceiver modules and a modular receiver system so that data is transmitted to within 1000 feet."

Nice! We should take a look at this, "TheDecider"

Another plus for this project is:

"With safety in mind, I chose not to use relays that expose AC currents. Instead, I chose to use Remote Controlled Wireless Outlets for controlling lights, pumps, fans, heaters, and humidifiers."

Download the Source-code

FTA8EB8H142A66M.MEDIUM.jpg

Download the source-code from GitHub.

433MHz RF Module Tutorial

The Instructable explains:

"In the source-code I created a base foundation for managing, transmitting, and receiving "sensor" objects and "appliance" objects. This project could easily be modified to work with other environments in which control is achieved by reading sensors and operating appliances based on programmed rules. You'll need to make a few adjustments to the source-code in order for it to work properly with your wireless outlets. To make the changes, you'll need to find out what the codes are that your wireless remote control uses and the outlets are programmed to receive. I have included a sketch for installing onto your Arduino Uno* w/ protoshield - step you through the process of acquiring the codes. You will need to insert the 433Mhz Receiver module (as pictured) and upload this sketch, StartCore.ino to the Arduino Uno* and open up the serial console for that port so that you can receive data from the Arduino."

Let's make one!!

"After you complete the process of acquiring all of the codes from your remote you can copy and paste directly into TheDecider.h header file where I have indicated."

Build the Controller

1115500-5.jpg
20150404_071224-1.jpg
20150501_104324.jpg

Parts: ( links provided as reference )

Optional Parts:

  • Arduino Uno R3* or Pro Mini*
  • Real-Time Clock Module
  • Optional: nRF24L01 Adapter with 3.3v regulator
  • connector wires
  • Display Option LCD w/ buttons Shield + Arduino Uno R3*
  • 2 x 4-pin male header connector wires
  • SD Card Option SD Card Shield + Arduino Uno R3*
  • connector wires

Internet Connectivity Option

Tools:

Some Assembly Required

Arduino-Prototyping-Shield-Front.jpg
20150330_113811.jpg
RF Modules.jpg
Arduino2RTC.jpg
20150327_183134.jpg
F9YPTQSI7VQLGV3.jpeg

Start by figuring out what codes your own particular wireless remote AC outlets use. The source-code assumes that there is a 433Mhz receiver on pins 2 (ground), 3 (Data), 4 (Vcc) and a real-time clock module connected via I2C using A5 (SCL), A4 (SDA), Vcc, ground.

Going Wireless

20150327_183149.jpg
20150408_073050_zpstpi2etrr.JPG
20150501_104507.jpg
nrfAdapter..jpg

Now that the controller is programmed with the codes for our AC outlets, we can add the nRF24L01 module.

Using the DuPont Rainbow ribbon with 2.54mm female connectors so that I can make custom wire connectors:

  • Pin number on Arduino / Wire Color / nRF24L01 Pin
  • Pin 9 : Orange / CSN "Chip Select"
  • Pin 10: Yellow / CE "Chip Enable"
  • Pin 11: Green / MOSI "Master Out, Slave In"
  • Pin 12: Blue / MISO "Master In, Slave Out"
  • Pin 13: Purple / SCK "System Clock"
  • Vcc 3.3v* Red (if not using Uno, optional adapter board with voltage regulator)
  • Ground. Brown

Wire color coding looking at the nRF24L01 component side with the crystal oriented on top - from bottom right, going up: Brown | Orange | Purple | Blue. Left from bottom going up: Red | Yellow | Green | NC

More amazing information on connecting the nRF24L01 to Arduino.

Receiver Side

FPZEXMWI7VQS7MR.jpeg
FLPKRUAI8FQSN06.jpeg

The Receiver source-code assumes that it is going to be compiled and executed on an Arduino Uno or ProMini connected to an nRF24L01, same as The Controller. As part of the Garden Controller System, the Receiver will send alerts via attached LCD Display and/or audible alert from a piezo connected on pins 2 (ground), 3 (signal), 4 (Vcc). For use in home automation projects, the alerts system can be removed or the rules customized according to the desired effect.

Going Further...

Exterior-House_Night.jpg

Using Arduino Uno, Pro Mini, nRF24L01, and other open-source modules opens the door to many possibilities. We now have a wireless framework for sending data objects for sensors, appliances, alerts, etc, using a controller for remote AC outlets and sensor inputs and a receiver for exploring development of a user interface. TheDecider can be updated to perform any number of tasks based on sensor and user inputs. What the receiver does in response to the data it receives is up to you.

Enjoy tinkering!!

Interested in Hydroponics?