Introduction: Awesome! LED Morse Code Secret Message Card Box

This instructable will give you the knowledge required to build a card box encased arduino capable of relaying a previously uploaded morse code message with the appropriate sequence of LED flashes.

Step 1: Supplies

Supplies:
- Arduino Uno
-LED
-2 jumper wires appx. 3-4 inches long
-Bycicle Prestige Card Box ($7 with nice deck at Wal-Mart)
-Power drill
- USB Arduino cable

Step 2: Wiring

This will honestly be the easiest circuit you will ever make in your life (yes, that even includes the lightbulb thing you did in kindergarten)

1. plug the long end of your LED into the digital 13 pin

2. plug the short lead into the ground pin (directly to the left of the digital 13 pin)

3. See? I told you.

Step 3: Code

--upload this code into your arduino--

1. You can edit the message you would like in the sections including a // (x) ). Look up the letter you want on the morse code table above, and substitute it for your desired symbol and rewrite that section with the formatting shown in the code. The message in the code I gave you says "Hi Rhys " (my younger brother.

#define ONCE (200)
#define LED (13)

// turn the light on
void on() {
digitalWrite(LED,HIGH);
}

// turn the light off
void off() {
digitalWrite(LED,LOW);
}


// short mark, dot or "dit" (·) — "dot duration" is one time unit long
void dot() {
on();
delay(ONCE);
}


// longer mark, dash or "dah" (–) — three time units long
void dash() {
on();
delay(ONCE*3);
}

// short gap between any combination of dots and dashes
void nextElement() {
off();
delay(ONCE);
}


// short gap (between letters) — three time units long
void nextLetter() {
off();
delay(ONCE*3);
}


// medium gap (between words) — seven time units long
void nextWord() {
off();
delay(ONCE*7);
}

void setup() {
pinMode(LED,OUTPUT);
}


void loop() {
// H
dot();
nextElement();
dot();
nextElement();
dot();
nextElement();
dot();

nextLetter();

// I
dot();
nextElement();
dot();

nextWord();

// R
dot();
nextElement();
dash();
nextElement();
dot();

nextLetter();

// H
dot();
nextElement();
dot();
nextElement();
dot();
nextElement();
dot();

nextLetter();

// Y
dash();
nextElement();
dot();
nextElement();
dash();
nextElement();
dash();

nextLetter();

// H
dot();
nextElement();
dot();
nextElement();
dot();
nextElement();
dot();

nextLetter();

// S
dot();
nextElement();
dot();
nextElement();
dot();


}




Step 4: The Box

Once you have uploaded your code to the arduino, It should begin flashing the message in a continuous loop. When your desired message is being shown, it is time to begin the modification of our card box.

1. detatch the arduino from the LED and insert it into the box to see where you need your holes. After proper alignment, carefully eyeball where you think the usb and power cable ports are on the botom of the box. mark and remove the arduino.
find the spot you want your
LED to protrude and mark that as well.

2. Using a powerdrill, bore holes in the appropriate areas. (try to make the holes snug to the components... makes the arduino fit more snugly and helps it to not wiggle around in the box.)

Step 5: Jumper Wires

Solder your LED to two jumper wires and insert each wire into its designated pin. Make sure they are long enough to reach your hole for the LED without stretching. You dont want to damage your wiring just installing the unit into the box.

Step 6: Test

Insert your unit and allign with the proper holes. Plug in to a usb compatable power source and make sure your message flashes. If not, check your wiring.

Step 7:

Reuse Contest

Participated in the
Reuse Contest