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
- 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.
- My relay has the model name on its side – COTO 9007-05-00
- Googling it gave me the schematics on the data sheet: http://media.digikey.com/pdf/Data%20Sheets/Coto%20…
- According to that, I know to connect the toy to the switch at pins 1 & 4, and D7 and GND to the coil at pins 2 & 3.
Getting Intruction from ramzan
Step 6: Set up your Arduino Yun
The Yuns are finicky. I’m not going to get into details here on how to set one up but PLEASE read these:
- The Yun’s hardware – http://arduino.cc/en/Main/ArduinoBoardYun
- This is critical to read.
- Very important – The Yun Does not have a voltage regulator. It has to be powered by no more than 5V or it will be damaged.
- Guide to the Arduino Yún – http://arduino.cc/en/Guide/ArduinoYun
- You need to connect the Yun to your wifi network, to be able to read text messages.
- You can also program the Yun over wifi, but that’s not necessary.
- My code assumes you are programming the Yun over wifi, and the “serial” monitor uses the wifi connection (with Bridge and Console).
- If you wanted to monitor the Yun over the USB cable you’d have to change the Console commands to Serial commands.
- You don’t need much more from the Yun for this project.
For more detail: Controlling your Christmas lights with Text Messages