Controlling Your Christmas Lights With Text Messages

Introduction: Controlling Your Christmas Lights With Text Messages

I really wanted to be able to control my Christmas lights remotely, with an Arduino.

With this solution you can control my Lights remotely, via text messages!

Skills needed:

Soldering

Wiring

Copy and Paste

Step 1: Components Needed

An Arduino Yun (Wifi Enabled!) - You could use another Arduino with a Wifi Shield though.

A Protoshield with (or without) a tiny breadboard

a regular breadboard will work as well, but will be less compact.

If you want to solder more, you can just use a small circuit board instead.

A 5V relay

A piezo buzzer

Wires

A battery operated Christmas decoration (It's not even Thanksgiving, so I'm using a Halloween decoration)

A Temboo account (explained in next steps)

A Twilio account

Step 2: Break Open Your Decoration

I took apart the battery case and pulled the circuit out.

Separated the battery case from the circuit, marking the positive and negative wires.

The decoration was powered by 3 1.5V batteries = 4.5V. We won't need it, we can power it with the Yun's 5V.

My Decoration circuit used a push button switch to turn on and toggle between modes (short clicks) and to turn off (long click and hold)

Step 3: Solder Wires to the Decoration

I soldered new wires to where the batteries positive and negative leads went to:

The red wire connected to the resistor that came in the decoration.

The black wire to where the negative lead was connected to.

I connected two wires to the switch to later connect to the relay.

You can turn your decoration on and off with only the +/- leads if it turns on automatically when powered, but I wanted to be able to toggle between modes using Arduino (not in this Instructable though).

Step 4: Heat-shrink Tubing

I used heat-shrink tubing to cover the exposed parts of the wires.

Electrical tape would do...

Step 5: Wire It!

Attached is the schematic in PNG and PDF.

The Protoshield's LED is wired to D13 and uses the built in resistor and GND connection.

If you're not using the Protoshield's LED, connect the LED to a 330Ω resistor and the GND.

The LED is for debugging. It's on whenever the decorations lights are on.

The buzzer's purpose is to give an audible signal when the lights go on or off. It is wired to D2 and GND.

The relay is where the magic happens!

According to your specific relay's specs (look them up, you'll need it!) you'd have to wire 2 of the pins to the toy's switch and the other 2 to GND and D7.

Relays are basically electromagnetic operated switches - if I run 5V through the coil pins, the magnetic force closes the switch circuit.

When I run power from D7, the relay closes the circuit and simulates a button press on my decoration switch.

Comments

and here is the code that will do all of the above, AND send you back an SMS text confirmation of the pin status to your cell phone.... You will need to utilize Temboo's 'Profile' feature to shorten the code and memory use, as the UNO will run out of ram if you just use the straight code from Temboo. Or you could use a Mega. A lot of this code could probably be omitted, cleaned up, shortened or optimized by a real programmer (not me).

/* Setup shield-specific #include statements */

#include <SPI.h>

#include <Dhcp.h>

#include <Dns.h>

#include <Ethernet.h>

#include <EthernetClient.h>

#include <Temboo.h>

#include "TembooAccount.h" // Contains Temboo account information

byte ethernetMACAddress[] = ETHERNET_SHIELD_MAC;

EthernetClient client;

int numRuns = 1; // Execution count, so this doesn't run forever

int maxRuns = 10; // Maximum number of times the Choreo should be executed

Cool! I'm inspired. Could you use a Twitter api to trigger this as well? Then maybe you could send messages to a functional account for the lights. Or have it do something fancy when there is a hashtag you are following is used. :-)