DIY Android Home Automation Box

Published on February 2018 | Categories: Documents | Downloads: 27 | Comments: 0 | Views: 401
of 12
Download PDF   Embed   Report

Comments

Content

Food

Living

Outside

Play

Technology

Workshop

DIY Android Home Automation Box by ASCAS on June 27, 2014

Table of Contents DIY Android Home Automation Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Intro: DIY Android Home Automation Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

Step 1: Bill Of Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

Step 2: Find A Good Enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

Step 3: Glue The Sockets Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

Step 4: Align & Measure The Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

Step 5: Transfer The Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

Step 6: Grind And Drill The Enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

Step 7: Construct The Relay Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

Step 8: Wire The PSU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

Step 9: Upload The Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

Step 10: Install The App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

Step 11: Build & Install The Bluetooth Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

Step 12: Install The Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

Step 13: Screw The Cover Back On - Enjoy! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

Author:ASCAS

Follow me on facebook. Hi I'm Angelo! I'm spending my last year of high school so I'll be gone for a while, preparing for college. Please understand that I can't assist you right now. BTW, you can follow me on facebook.

Intro: 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

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

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.

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

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.

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

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.

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

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); } } }

File Downloads

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

BlackBox_Android App.rar (1 MB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'BlackBox_Android App.rar']

BlackBox_Arduino_Sketch.zip (1 KB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'BlackBox_Arduino_Sketch.zip']

Step 10: Install The App File Downloads

BlackBox_Android App.rar (1 MB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'BlackBox_Android App.rar']

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

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

Step 13: Screw The Cover Back On - Enjoy! Your done, enjoy!

Related Instructables

DIY Smart Home Automation using Android by abhishek7xavier

DIY Home Automation for Beginners. Absolutely No coding or soldering required. Android/Arduino for switching things on and off by drmpf

Android-VoiceBox [ J.A.R.V.I.S (Artificial Intelligence )] by jaydippatel

Arduino + Android burglar alarm - Home automation by Bhanu Kishan

Code generator for custom Android/Arduino menus to switch Arduino outputs on and off. Andriod/Arduino for Beginners. Absolutely No Programming Required by drmpf

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

Voice Activated Arduino (Bluetooth + Android) by ASCAS

Advertisements

Comments 46 comments Add Comment

bushra.moni says:

Dec 6, 2014. 1:18 PM REPLY 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

SOHAIBciit says:

Dec 6, 2014. 9:18 PM REPLY

I had the same problem. I am using this app instead: https://play.google.com/store/apps/details?id=robo... works great.

jueljp says:

Jan 2, 2015. 1:01 PM REPLY

any difference made to the electronics/coding?

IshanP says:

Feb 12, 2015. 3:26 AM REPLY

i just wanted to know weather or not i can use 5 of these instead of soldering the relays http://probots.co.in/index.php?main_page=product_info&cPath=67_85&products_id=439&zenid=5f861de25d3ee0f7c45b6b5d7620a95f

jueljp says:

Jan 2, 2015. 1:08 PM REPLY

how much watts per plug, i intend to use it to control some leds in my bedroom

ASCAS says:

Jan 22, 2015. 1:47 AM REPLY

That would depend on the relay that you have selected.

LongJ says:

Dec 30, 2014. 7:21 PM REPLY Woah .... Major rookie mistake here. You MUST put a diode across those relay coils or you are going to get a reverse polarity voltage spike back through the driver transistor when the magnetic field of the relay coil collapses (This is the same effect switch mode power supplies use to generate lower, higher and opposite polarity voltages) A reverse polarity diode across the coil will spike that voltage to ground while doing nothing during normal operation. There are literally hundreds of examples of how to do this on the internet. At least you have a transistor between the coil and the micro which helps protect the micro from the inductive kickback of the relay coil but you still need that clamping/snubbing diode. Think of it as an insurance policies that costs just a few pennies

ASCAS says:

Dec 30, 2014. 9:25 PM REPLY

I did actually, I added a 1N4007 rectifier on each relay although I forgot to document it here.

LongJ says:

Jan 21, 2015. 12:42 PM REPLY I'm not trying to be harsh here but you really should go back and add that to the documentation so those that don't know any better don't make the mistake of leaving them out. Maybe even a short blurb explaining why this diode is important (I stock 1n4004 in the same bin as my relays because to me they are a set) You obviously have some skills, you just need to polish them and I certainly don't want to discourage you. One thing my Grandfather who was a Master Electrician taught me when I was still in high school and still serves me well (And I'm a BSEE) to this day is: The difference between a Master and a Journeyman is attention to detail .....

LongJ says:

Dec 30, 2014. 7:59 PM REPLY I'd like to add a couple of other tips. For those on 220/240V systems it doesn't matter which leg you switch but those of us in the US or other places with 120V systems you should switch the black or Hot wire NOT the white or neutral wire which is a big no no and a violation of Federal (and State) Electrical Codes. The reason being the white neutral wire is actually connected to the ground buss in the main service (breaker) box Even if you are using a non-conductive case please use a proper 3 prong grounded plug, ground your power supply's case and make sure the safety grounds are run to all receptacles. Also I would put a fuse on the incoming AC line with a maximum 15 amp fuse. Stay safe and have fun!

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

SOHAIBciit says:

Nov 23, 2014. 7:02 PM REPLY

awesome instructable... enjoyed making it ;^)

kimpoy.develles says:

Dec 30, 2014. 4:45 AM REPLY

Hi Sir!! what sketch did u use? and how to use the AMR: Gestures apk?

firefox21 says:

Dec 17, 2014. 5:41 PM REPLY Hi! I'm trying to do this as a project. Just want to ask, is the ac line be connected to the sockets? And where will the PSU be connected to? Thanks!!

tmaji12 says:

Nov 3, 2014. 10:30 PM REPLY

having problem on app saying "socket creation failed". how to eliment this prob

tmaji12 says:

Nov 3, 2014. 11:21 PM REPLY

plz help me its urgent..

Nikus says:

Nov 23, 2014. 4:12 AM REPLY

I had the same problem but I solved it. You need to change in android code this: private static String address = "30:14:08:15:20:57"; on address of your bluetooth module. You can check it in bluetooth settings on your phone.

SOHAIBciit says:

Nov 14, 2014. 9:08 PM REPLY

How to Install the android app.?? I cannot understand, there are so many files. What to do? Can you give step by step instructions..... Thanks in advance.

morcosnagy1 says:

Nov 14, 2014. 3:32 AM REPLY Can you explain step 12 with some photos or how i can connect the others with arduino ? and why do you use the resistors in the arduino ? i am sorry i can not understand this step

teguhoo7 says:

Nov 5, 2014. 5:48 AM REPLY

how the existing scheme in step 8 and 7 ?? can you help me ??

mohamez says: how can i make the relay board ?

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

Oct 12, 2014. 4:40 PM REPLY

ASCAS says:

Oct 27, 2014. 11:08 PM REPLY

By following the given schematic.

william.catchin says:

Oct 27, 2014. 9:39 PM REPLY

why the RX-TX pin of bluetooth module connected to pin 2-3 instead of TX-RX pin in arduino board?

ASCAS says:

Oct 27, 2014. 11:08 PM REPLY

I reassigned the pins, because the BT module interferes with the arduino when I'm uploading a sketch.

OhYeahThatGuy81 says:

Sep 29, 2014. 5:59 AM REPLY

Very nice! How does it feel to be a TV star?

kimpoy.develles says:

Sep 7, 2014. 9:28 PM REPLY Hi Mr. Angelo!I'm planning to do your Home automation project as my school project..I'm wondering what sketch should be uploaded to the arduino board?its a bit confusing because there are 3 sketches and I don't know which sketch should be uploaded..thanks :)

Tezeusz says:

Sep 21, 2014. 12:16 PM REPLY

is not a sketch, it's a tab :)

deba168 says:

Aug 12, 2014. 9:25 AM REPLY

Congrats Angelo :)

ASCAS says:

Aug 13, 2014. 3:06 AM REPLY

Thanks and congrats to you as well, my friend! :D

DangerousTim says:

Aug 5, 2014. 3:12 AM REPLY

It's an awesome project, but isn't it a little cumbersome to use your phone just to operate switches?

ASCAS says:

Aug 7, 2014. 2:01 AM REPLY Maybe, but the box does more than responding to app buttons. The PIR (motion) sensor is linked to my home automation box with an RF module. Every time I enter my room, the box turns all the appliances on. The appliances turns off when the are no movements detected within the 30 minute time period. Second, you can also download a voice activated app to control the home automation box via speech recognition. I have a separate tutorial of it.

DangerousTim says:

Aug 9, 2014. 3:01 AM REPLY

Awesome ideas!!!

critterfluffy says: I can think of a couple really cool examples where this is useful and environmentally savvy. Feel free to steal these : ) 1. Add an RFID to a wireless charger station and when you phone detects via NFS, it turns the power to the charging pad on. Kills the energy vampire. 2. When you phone attaches to home wifi, it turns on your outside lights or when no phones are attached to home wifi it turns down the heater/AC, water heater, and turns off all appliances after 5 minutes. Basically giving your home a schedule and some sense of where you are can allow for tons of variation that could reduce energy use. Nice project.

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

Aug 7, 2014. 11:59 AM REPLY

FERNANDO19BLO says:

Aug 6, 2014. 12:03 PM REPLY

advantages: http://www.ubnt.com/mfi/mpower/

TrollFaceTheMan says:

Aug 8, 2014. 9:29 PM REPLY

Cleaver

Kante Tech says:

Aug 8, 2014. 1:40 PM REPLY

Theres really no limit to the amount of relays and outlets that you could have plugged in right?

ASCAS says:

Aug 8, 2014. 5:03 PM REPLY The only limit of adding relays is the limited amount of Arduino pins. If you want to connect more relays, multiplexers can be used.

sameerg says:

Aug 6, 2014. 8:36 AM REPLY

Wonderful job. I decided to try this.

ASCAS says:

Aug 7, 2014. 1:53 AM REPLY

Thanks! :D

aremsajos says:

Aug 6, 2014. 8:19 AM REPLY Very nice and clean work, i always have interest in home automation but don't know where to start from. if any body is willing to put me through or give me directives, good it will be appreciated. looking forward to seeing somebody.

ASCAS says:

Aug 7, 2014. 1:53 AM REPLY

You might want to wait for my next beginner friendly Home Automation project! :)

mormor says:

Aug 6, 2014. 7:35 AM REPLY Very neat, but you need to put in a reverse polarity diode in parallel with the relay coil to catch back-emf from the coil when the transistor opens the circuit, and you should probably also make better separation between live and the control circuit although as long as you are not connecting anything else to the circuit directly when connected to the mains and it's in a closed box then you should be fine. I like the idea of using bluetooth to control it! :-)

ASCAS says:

Aug 7, 2014. 1:52 AM REPLY Thanks! BTW, this is a prototype, of a larger home automation system that I'm working on. I'll add the diodes together with a custom PCB layout on my final project. :D

johnybody says:

Aug 6, 2014. 9:32 AM REPLY

Cool. How do you upload the app to your phone? Which software do you use?

ASCAS says:

Aug 7, 2014. 1:46 AM REPLY The downloadable file includes an APK installer. It was programmed by my friend. I'll be updating this guide by adding alternative apps.

brandonkehl says:

Aug 5, 2014. 2:58 PM REPLY

Where did you get your power supply?

ASCAS says: I bought mine from eBay (stated on step #8).

http://www.instructables.com/id/DIY-Android-Home-Automation-Box/

Aug 6, 2014. 3:18 AM REPLY

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close