Introduction: DIY Android Home Automation Box
Here's a little show and tell of my Android controlled home automation box. It's a small extension box that's controlled by an Android smartphone. You can turn the individual outlets on by tapping a button from the app or use the speech recognition app, found from my previous tutorial. I've teamed up with my friends and built a custom app for out home automation prototype project. My former classmate/ fellow ible member "treyes4" built something similar.
__________________
It's just a prototype so don't expect much from this version. I assure that next version would be explained more thoroughly.
________________
I'll be gone for a while: I'll be posting a video once I get back from the international trade and business competition hosted by FedEx (school related). I posted this guide early, since the home automation contest deadline is due today. There's a lot of unexplained areas in this guide, without the prior knowledge, this project would be difficult to execute. Just ask questions below, I'll answer them through my phone. Once I get back, I'll edit and update this guide. Sorry for the inconvenience.
__________________
Step 1: Bill of Materials
If your having trouble in finding them, I'm sure RadioShack has all of them. If you want to buy online try searching on Amazon or DealExtreme.
Thing that you'll need:
- Android Phone & App
- Arduino UNO (a clone works fine)
- Low Power/ Switching Power Supply
- Dot Matrix Solderless Breadboard
- HC-05 Serial Bluetooth Module
- 2N3904 NPN Transistor (5x)
- 2.2k Ohm Resistor 1/4 (5x)
- 6V Relays (5x)
- Jumper Cables
Step 2: Find a Good Enclosure
I bought my enclosure from Alexan, a local electronics/ hobby store. This project is a prototype, the perfect enclosure would be an enclosure big enough to house an Arduino prototyping board and a small switching-PSU.
Step 3: Glue the Sockets Together
Align the outlets then use superglue to hold them temporarily. Hot glue can be used to strengthen the bond. After gluing, start to link a common rail. The linked rail work's like a common ground although this is AC ~ so it's not.
Step 4: Align & Measure the Sockets
Align the AC sockets together then acquire the dimensions of the array of sockets.
Step 5: Transfer the Measurements
Transfer your measurements by using a marker and ruler.
Step 6: Grind and Drill the Enclosure
Use your hacksaw or rotary tool to cut off the plastic that you've marked. Use a metal file to even out the edges.
Step 7: Construct the Relay Circuit
I constructed my DIY relay circuit. Obviously this is a complete prototype, I used a perfboard for mounting my components on. This is dangerous, exposed AC line can cause death through electrocution. Before attempting this project, be sure you're qualified to execute the task. My next version in the future would probably include solid state relays mounted on a custom PCB.
Step 8: Wire the PSU
The PSU will serve as your Relay and Arduino's power supply. I bought mine from ebay.
Specs: 12v (1 Amp)
Step 9: Upload the Sketch
/*Paste this on your Arduino's IDE
The BlackBox Arduino Author: Thomas Niccolo Filamor Reyes */ #include
SoftwareSerial mySerial(2, 3); // RX, TX
//these ladies shorten the script #define printer Serial.println #define reader mySerial.read
//fullString from android app //c is for the reader char fString [5], c;
//digital pins, uint8_t/unsigned char //to save memory of 8 bits/1 byte //normally I'd use an int (16 bit/2 byte), //but it limits value from 0 to 255 //no negative values unsigned char digital[5] = {8,9,10,11,12};
//*index of recorded character array uint8_t v = 0;
void setup(){ Serial.begin(9600); mySerial.begin(9600); //scroll through all digital pins listed as output for(uint8_t i=0;i<5;i++) pinMode(digital[i], OUTPUT); } void loop(){ //*index of recorded character array v = 0; //incoming bytes while(mySerial.available()){ //give her some time to recieve delay(10); c = reader(); //stop filling the chararray if # is encountered or // it goes beyond index 4 (5th value) if (c == '~' || v > 4)break; fString[v] = c; //increments index v++; } //if the index is greater than 0... if(v > 1){ printer(fString); //scroll through them for(int i =0; i<5; i++){ //I wish I could use bits instead here... efficiency if(fString[i]=='0') digitalWrite(digital[i], LOW); else digitalWrite(digital[i], HIGH); } } }
Step 10: Install the App
Attachments
Step 11: Build & Install the Bluetooth Module
Connect the RX to pin #2 and the TX to pin#3
Step 12: Install the Arduino
Wire the Arduino to the other parts
Step 13: Screw the Cover Back on - Enjoy!
Your done, enjoy!

First Prize in the
Home Technology Contest

Participated in the
Remote Control Contest

Participated in the
Epilog Challenge VI
63 Comments
8 years ago on Introduction
i m having a problem..... i have made the circuit nd now i m unable to fine the app to control it with my cell phone .....i donot knw the programing so i jxt copied it for ur link but app...... m jxt trapped plx help me its urgent as i hav to submit my assignment at my college
Reply 8 years ago on Introduction
I had the same problem.
I am using this app instead:
https://play.google.com/store/apps/details?id=robo...
works great.
Reply 8 years ago on Introduction
any difference made to the electronics/coding?
9 years ago on Introduction
Cool. How do you upload the app to your phone? Which software do you use?
Reply 9 years ago on Introduction
The downloadable file includes an APK installer. It was programmed by my friend. I'll be updating this guide by adding alternative apps.
Reply 4 years ago
hola me puede pasar los diagramas de circuito xfavor
Tip 4 years ago
me puede pasar el diagrama de circuito por favor
6 years ago
Bro powede bang gumamit ng 4 chanel relay module, 4 lang sana gawin ko.
6 years ago
itd be so good if we can time them on app
7 years ago
7 years ago
I'll definitely be making this for my shed that'll be going up hopefully next summer. In the mean time, this will be used for some stuff in my house, and as a chance to get my hands dirty on app construction (I'm a software engineer by day).
7 years ago
You should update this as you had mentioned.
7 years ago
Could this be done with Ubuntu Touch instead of Android?
7 years ago
the last image is great ! pravo!
7 years ago
you should consider to have some ventilation for your enclosure. AC/DC, both of them are easy to getting hot and melted.
and Fuse, don't miss to install that one.
9 years ago on Introduction
Where did you get your power supply?
Reply 9 years ago on Introduction
I bought mine from eBay (stated on step #8).
Reply 7 years ago
can you please send me the circuit diagram ......and about psu model...at
sgm1081@gmail.com
7 years ago
hello, nice project. just few things to confirm:
1) can i use esp8266 to control it over lan ?
2)can i add 8 ch relay ?
thanks
7 years ago
bro can u plz upload the sketch that how u connect arduino + bluetooth + relays + PSU?? kindly email me plz... thanks
signorpositive2014@gmail.com