Instructables

Control lights on Christmas tree via Arduino, Android, and Bluetooth!

Picture of Control lights on Christmas tree via Arduino, Android, and Bluetooth!
Alrighty, this is my first Instructable and I am pretty excited about it. I got the idea for this project from a combination of these 2 Instructables...

http://www.instructables.com/id/Tweeting-Christmas-Tree/
http://www.instructables.com/id/Android-Arduino-Controlled-Projector-Screen/

The basic concept was to make a way to control the lights on my Christmas tree this year, but after the Christmas season it can still be used as a remote controlled power strip (I must say that is pretty cool). I got this idea because I was recently introduced to the Arduino and immediately saw the endless possibilities it possesses. I love programming, and learning for that matter, so this was a great project to tackle.
 
Remove these adsRemove these ads by Signing Up

Step 1: The Materials

A List of Materials
Arduino UNO R3 - $30 Sparkfun - 
https://www.sparkfun.com/products/11021
Bluetooth Serial Adapter - $10 eBay - http://www.ebay.com/itm/Arduino-Wireless-Bluetooth-Transceiver-Module-Slave-4Pin-Serial-DuPont-Cable-/321020258404?pt=LH_DefaultDomain_0&hash=item4abe4c6864 
5v Relay Shield - $7 eBay - http://www.ebay.com/itm/5V-4-Channel-Relay-Shield-Module-Expansion-board-For-Arduino-ARM-PIC-AVR-DSP-/320909808154?pt=LH_DefaultDomain_0&hash=item4ab7b7121a
A phone with Android
Jumper Wires (for the Arduino)
Wire (for the outlets )
Outlets


(These pieces are NOT needed, but i used them to test the project)
4 LEDs
Four 100 ohm resistors

Step 2: The Android Application

The project reads a 'byte' of data that is sent from a phone running an Android app, and interprets it to do specific things. I used a lot of similarities from the Android app bwrussell used in his Bluetooth Controlled Projector Screen (he did a great job on that 'ible btw, there is a link to it up there ^ and a little blurb about him in the next step). So I used the App Inventor from MIT, it's really freaking cool, and surprisingly easy to use. http://appinventor.mit.edu/

The block editor is where the magic happens though, when making the app, make sure that each button that you make sends a different 'byte'. As you can see in my block editor, each color button send a different number (i.e. 1-8). Our Arduino will be receiving this specific 'byte' and will turn certain pins on and off based on what it receives. Be sure to use a simple bluetooth app to find your module's address so you can pair your device to the module. Enter that number into the block editor 
sogseal made it!5 months ago

very nice, definitely going to find use for this! im still learning on how to sketch, so half of the sketch im really hazed on whats going on

20140214_194919 [1600x1200].jpg
3tuxedo (author)  sogseal5 months ago

Thanks so much. Which part of the code is confusing? I'd be more than happy to explain it.

sogseal 3tuxedo5 months ago

I actually got it down after watching some tutorials on youtube, i mean i understand as i read it which is nice for me. Now im trying to figure out when my LED is on or off, to control brightness (PWM). i had it before but couldnt made android send text to adjust it, i believe that BT uses to send byte not text to work with PWM. Thanks man for the reply, waiting for more tuts , cheers

bwrussell1 year ago
Very well done, both on the project and the write-up. Great to see it in action!