Introduction: DIY Magic Wand and Chest Kit (IR Emitter and Receiver)

About: Purpose is to design cheap and affordable DIY creations, robotics, automated toys, and tools.

This kit uses an Arduino and electronic parts to detect and react to infra-red light from any infra-red emitting device to include remote control devices, infra-red distance sensor (like on cameras), or trademark-brand Magic wand.   This project requires some electronics and cold soldering skills, but is fairly easy and basic.  Shown is the project using a development board.  It can be completed within a few hours.

The kit is configured to make: 
A.  DIY Magic Wand (IR Emitter).  Infra-Red emitter device.  IR LED needed.
B.  Magic Chest (IR Receiver).  Cardboard Box opens when infra-red is detected.  Arduino, IR photo diode, and servo needed.

Step 1: DIY Magic Wand (IR Emitter) - Supplies

These instructions describe how to make an Infra-Red Emitter in the shape of a magic wand.  This magic wand is designed to operate similar to a flashlight and should only work with this kit.  The button switch is hidden inside the tube and will activate the IR LED.

Supplies:
8.5 x 11 inch paper or construction paper
IR LED (Radio Shack - Model: 276-142  |  Catalog #: 276-142 ) blue tinted LED
550 ohm resistor (from multi-pack)
9V battery
9V battery connector (Radio Shack - Model: 270-324  |  Catalog #: 270-324)
SPST push button switch (Radio Shack - Model: 275-002 | Catalog #: 275-002)
Wire
Tape
Conductive Wire Glue (Cold Solder) (Radio Shack - Model: NK5018 | Catalog #: 64-146)
Decorations

Schematics:
See schematic created at www.circuitlab.com .  The 9V battery will power the circuit.  The push switch will enable power from the positive (+) side of the battery to the positive lead (usually the long side) of the IR LED.  The negative side (usually the short side) of the IR LED is connected to the resistor.  The resistor is connected to the negative (-) side of the battery.

Step 2: DIY Magic Wand (IR Emitter) - Assembly

1.  Place the IR LED (blue tinted LED) onto a corner of the 8.5 x 11 inch paper.  Angle the IR LED to the opposite corner.
2.  Cut two lengths of wire to be 8.5 inches long to reach from the IR LED toward the opposite corner of the paper.  
3.  Solder wire to the end of the IR LED leads.
4.  Use tape to separate the IR LED leads.  Note which lead is the positive lead (long side).
5.  Flatten the pins on the push switch.
6.  Solder the push switch to the positive side of the wire to the IR LED. 

NOTE:  The pics show crimping pins recycled from a wire kit and cold solder were used to ensure conductivity.  Allow plenty of time for the solder to dry and hold.  If crimping pins are not available to ensure conductivity, shape the pins into a hook and wrap the wire around the pins.  Use the cold solder to hold in place.

7.  Solder the negative lead of the IR LED to the resistor.
8.  Twist connect the leads for testing.  Connect the battery connector positive lead (Red) to the switch.  The pins are on the same side as the pin for the IR LED.  See pic.
9.  Twist connect the leads for testing.  Solder the battery connector negative lead (Black) to the opposite side of the resistor.
10. Install the battery and test.  Use a video camera to see if the IR LED illuminates when the button is pressed.  If it doesn't illuminate, the IR LED is backwards or the switch is not connected right which requires the circuit to be taken apart and rewired.
11. Once satisfied that the IR LED operates correctly, solder the remaining pieces together.  Use tape to keep the wires and leads from connecting and causing a short circuit.
12. Bend the wire around the switch so that the pins are parallel to the wires.  Orient the switch so that the pins do not protrude to the sides.  See pic.
13. Roll the paper into a conical tube to a size and orientation that would cover the circuit.
14. Wrap the pre-rolled paper around the circuit, push switch, and battery.  Ensure that pressure is not placed on the switch and that the IR LED is visible out of the tip of the rolled paper.  Tape the tip tight.  Tape the 9V battery in place to the tube.
15. Continue to wrap the paper around the circuit until satisfied that the wand is stiff enough for use.
16. Test the wand again to ensure that it works.  Squeeze the wand where the push switch is located.
17. Tape the wand to hold the wand together.

Step 3: Magic Chest (IR Receiver) - Supplies

These instructions describe how to make an Infra-Red sensor using an Arduino hidden inside a box. When an IR signal is detected, the Arduino will open the box with a servo and light a LED.  The Infra-Red sensor is designed to react to any IR signal that it detects which can be from a Magic Wand created in this instrucable, an IR remote control device, a camera with IR distance locator, any trademark-brand Magic Wand, or etc.

Supplies:
Arduino Uno (along with USB connection to computer installed with the IDE)
ARDX experimenters board kit (optional) (Radio Shack - Model: KIT04121P | Catalog #: 276-252)
9V Battery
9V Battery Connector to Arduino
IR photo diode (Radio Shack - Model: 276-142  |  Catalog #: 276-142 ) clear colored
(2x) 550 ohm resistors
LED
Micro Servo (Radio Shack - Model: 2730765 | Catalog #: 273-765)
Magic Wand (Or IR emitter, IR remote control, a camera, or any trademark-brand Magic Wand)
large paper clip or thin wire coathanger
tape
cardboard or poster board or cardboard box
download file of chest template on 11 x 17 paper
download file for Arduino
Decorations

Schematics:
See schematics which were created at www.circuitlab.com .  A 9V battery supplies power to the Arduino.  The Arduino supplies +5V power connection to the servo and the IR photo diode.  The Arduino detects when IR is present on Analog Pin0 at the IR photo diode and then signals to the servo on Digital Pin9 to move to the box open position and light the LED on Digital Pin13 for a set time.  After time has expired, the Arduino signals to the servo to move back to the box closed position and the LED goes to off.

NOTE: Upon turn on, the Arduino will command the servo to the open position and when the USB serial monitor is enabled because it detects voltage on Analog Pin0.

Step 4: Magic Chest (IR Receiver) - Make a Posterboard Magic Chest

This design creates a 5 x 4 x 4 inch box out of posterboard or cardboard.

1.  Download the file picture.
2.  Size and Print the picture on 11 x 17 inch paper.
3.  Place the design on posterboard.
4.  Cut the design out.
5.  Fold the support sides in while keeping the front and back faces flat.
6.  Fold the lid.
7.  Fold the sides of the lid in.
8.  Tape the chest together.
9.  Decorate the chest if desired.

Step 5: Magic Chest (IR Receiver) - Assemble the Circuit and Text File

An Arduino with the ARDX experimenters kit was used.

1.  Connect the Ground of the Arduino to the negative (-) bus.
2.  Connect the +5V of the Arduino to the positive (+) bus.

3.  Install the LED by bending the pins so that the LED overlaps the edge of the board.  Refer to the picture (wires removed for clarity).
4.  Connect the positive lead (long) to Digital Pin13.
5.  Connect a resistor to the negative lead (short) of the LED.
6.  Connect the resistor to the negative bus.

7.  Install the IR photo LED by bending the pins so that the IR photo LED overlaps the edge of the board.  Refer to the picture (wires removed for clarity).
8.  Connect the short lead of the IR photo LED to the positive bus.
9.  Connect the long lead of the IR photo LED to Analog Pin0.
10. Connect a second resistor to the IR photo LED and Analog Pin0.
11. Connect the resistor to the negative bus.

NOTE:  The description for the installation of the IR photo diode is accurate.  The diode operates by preventing voltage through the positive lead.  When IR is present, the diode becomes a temporary pass-through and allows voltage to be detected on Analog Pin0.

12. Install the servo by connecting the control orange (or yellow) wire to Digital Pin9.
13. Connect the servo positive red wire to the positive bus.
14. Connect the servo negative brown (or black) wire to the negative bus.

15. Connect the Arduino to a USB port on a computer with the IDE.
16. Compile and Upload the File to the Arduino.  The servo should move and the LED light.
17. Test the circuit using an IR emitting device and opening the USB serial monitor in the IDE.  Shine an IR emitting LED onto the IR photo diode and the servo should move while the LED lights.
17a.  IF the servo continues to move and the 'pos = ' displays, voltage is detected on the Analog Pin0.  Verify the serial monitor displays '0' indicating that no IR is present.  Verify that the IR photo diode is not reversed by switching the IR photo diode leads.  Verify that the negative leads and resistor are connected to the Ground of the Arduino and not shorting through Analog Pin0. Verify that the Analog Pin0 does not have a static charge and is stuck in the closed (HIGH) position by removing the cable and grounding the cable to the Analog Pin0 to an ESD device.
17b.  IF the LED fails to light, verify that the LED is not reversed and that the positive is connected to correct lead of the LED.
17c.  IF the servo is not operating, verify that the wire colors are connected correctly.


Arduino Text Code follows:

/*
  IRdetect on analog input with LED light and Servo
  Reads an analog input on pin 0, prints the result to the serial monitor,
  and moves a servo.  Attach the IR photo diode to analog pin 0 input,
  LED to digital pin 13 output, the outside pins to +5V, and ground.
  Attach servo control yellow (or orange) wire to pin 9, red to +5V,
  and black (or brown) to ground.
*/

// Initialize
#include <Servo.h>
Servo chestservo;          // Create servo object to control servo.
int pos = 0;            // Variable to store the servo position.
int led13Pin = 13;      // Initialize variable as 13 for pin 13.

// Setup pins and variables
void setup() {
  Serial.begin(9600);        // Setup serial communication at 9600 bits per second.
  pinMode(led13Pin,OUTPUT);  //Setup led13Pin as an output pin.
  chestservo.attach(9);         // Attaches servo to pin 9 to the servo object.
}

// Function Loop
void loop() {
  int sensorValue = 0;          // Initialize variable to 0.
  sensorValue = analogRead(A0); // Sets variable as the read input on analog pin 0.
  Serial.println(sensorValue, DEC); // Print out the value you read.
  delay(5);                        // Delay in msec between reads for stability.

  if (sensorValue > 2) {            // IF greater than value, THEN light the LED, move servo,
                                    // and return serial output.
    Serial.println("Yes HIGH");     // Serial output.
    digitalWrite(led13Pin, HIGH);   // 2nd output set to HIGH or ON.

    //for(pos = 0; pos < 180; pos += 1) { // FOR loop goes from 0 to 180 degrees
                                        // in 1 degree steps.  Chest opens.
    //  Serial.print("  POS = ");
    //  Serial.print(pos);              // Serial output value of 'pos'.
    //  chestservo.write(pos);            // Servo moves to variable 'pos'.
    //  delay(25);                        // Delay in msec to allow servo to move.
    //}

    for(pos = 180; pos >= 1; pos -= 1) { // FOR loop goes from 180 to 0 degrees
                                        // in 1 degree steps if the servo is put in backwards.  Chest opens.
      Serial.print("  POS = ");
      Serial.print(pos);              // Serial output value of 'pos'.
      chestservo.write(pos);            // Servo moves to variable 'pos'.
      delay(25);                        // Delay in msec to allow servo to move.
    }
    Serial.println("    ");
    delay(2400);                    // Delay in msec chest is open.

    for(pos = 1; pos < 180; pos += 1) { // FOR Loop goes from 0 to 180 degrees
                                         // in 1 degree steps if the servo is put in backwards.  Chest closes.
      Serial.print("  POS = ");
      Serial.print(pos);               // Serial output value of 'pos'.
      chestservo.write(pos);             // Servo moves to variable 'pos'.
      delay(25);                         // Delay in msec to allow servo to move.
    }

    //for(pos = 180; pos >= 1; pos -= 1) { // FOR Loop goes from 180 to 0 degrees
                                         // in 1 degree steps.  Chest closes.
    //  Serial.print("  POS = ");
    //  Serial.print(pos);               // Serial output value of 'pos'.
    //  chestservo.write(pos);             // Servo moves to variable 'pos'.
    //  delay(25);                         // Delay in msec to allow servo to move.
    //}

    Serial.println("    ");
    delay(200);                     // Delay in msec light on.  
    digitalWrite(led13Pin, LOW);    // 2nd output set to LOW or OFF.

  }else{
    digitalWrite(led13Pin, LOW);    // Sets default LED output to LOW or OFF.
    int sensorValue = 0;          // Set integer variable back to 0.
  }  // End of IF statement.
}    // End of LOOP.

Step 6: Magic Chest (IR Receiver) - Assembly

1.  Place the Arduino into the Magic Chest without the battery.
2.  Mark where holes are needed in the side of the Magic Chest for the battery connection, LED, and the IR photo diode to be visible.
3.  Cut the holes.
4.  Tape the servo to the inside of the chest.
5.  Straighten a large paperclip.
6.  Bend the paperclip to fit through the servo lever.
7.  Move the servo lever to the full 'UP' position on the servo.
8.  Ensure that the lever is not obstructed.
9.  Attach the paperclip to the lid and secure with tape.
10. Install battery and test operation.
11. Decorate and hide the Arduino inside the chest by using coins or foil.




The video shows the testing of the IR detection using the DIY magic wand (IR emitter/ IR flashlight), a TV remote control, and a trademark-brand Magic Wand (the wand has to be shook to activate the IR).

HAVE FUN AND PLAY!!
Kit Contest

Participated in the
Kit Contest

Arduino Contest

Participated in the
Arduino Contest

Remote Control Contest

Participated in the
Remote Control Contest