Abstract

The goal of my project was to teach kids about Morse Code.   The aspects of Morse Code that I hoped children would learn from was the concept that language can be represented differently than just letters.  I mapped Morse Code patterns with the letters: A, B, C.  Kids had to traverse through the “puzzle” of combinations of dots and dashes to reveal all three letters.  If at any point they messed up a letter, they would have to redo that letter; and the LED pattern would reveal that they had made a mistake.

Through my project, I hoped to show the general idea of how Morse Code works, while at the same time providing an interactive and fun time for children.  The LED’s would parse through the dots and dashes as kids input them, and the letters would be revealed once the children successfully completed the letter.  I was pleasantly surprised at how kids used their parents to help them, which reminded me of when my parents helped me complete puzzles and difficult math problems when I was little.

 

Objectives

The main of objective of my project was to get kids to think outside of the box.  Children’s minds are like a sponge, soaking in new information.  It has been shown that Morse Code is much easier learned by children than adults.  I wanted to implement a system where kids would be able to learn from the repetition of creating dots and dashes to generate a language they were (mostly) familiar with already.

Objectives relevant to the project itself:

Mounting a key:  Originally, I had wanted to use a real Morse Code key that is used by “professionals” who sent actual messages during war times and such in the age where Morse Code was a necessity to send messages.  However, since I was dealing with 4 year old children, I instead mounted a red button to a little box that kids would perhaps find more entertaining or drawing when they saw the project.

LED Display: The point of the LED display was for kids to be able to follow along with the pattern in generating letters.  If they were not quick enough or perhaps put in a dash instead of a dot that was shown by the LED’s, the LED pattern would start from the beginning.  This allowed for kids to understand the temporal necessity, as well as correctness, that comes when sending a message through Morse Code.  It was also a key reason children approached the project to begin with, as I was prepared for a rectangular box with holes in it to not be the most attractive part.

The Box:  The box is the most critical part of the project.  I used servos that would rotate letters in and out of view depending on whether the user correctly identified a letter.  I finally decided on just using 3 letters based on the fact that I wanted the project to represent more of a toy than simply a map of Morse Code to letters.  This would be more time consuming for children and might confuse or bore them.  I also showed the pattern that they were supposed to implement once they understood dots and dashes correctly.  This would be more helpful on the second and third time using the project.

 

Results

I believe that the scope of my project was fair, but I could have expanded it or perhaps improved the temporal cues.   The LED’s, though I liked how they worked, could have been more precise on how Morse Code works with regards to creating actual words or even sentences.

Despite this, I was very pleased with how my project worked.  Parents were very intrigued by the concept of the project and would often work with their children to get the correct result.  Children who understood how to use the button would play with it until they did understand, or needed some help understand what was a dot and what was a dash with respect to the button.  Once children understood what was happening, they seemed to love the project and do it over and over again.  This was an intended result of mine, and it made the children and parents very happy in the moment.  I do believe that they got a good taste of what Morse Code really was and how it could be used to make the familiar language of English.

Photos

(Demo)

(Demo)

(Final)

(Final)

(Final)

Videos

 

Technical Documentation


unsigned long signal_len,t1,t2; //time for which button is pressed
int inputPin = 2; //input pin for push button
int ledPin = 4; //outpu pin for LED
int ledPin1 = 7;
String code = ""; //string in which one alphabet is stored

#include <Servo.h>
const int SERVO_PINA = 9;
const int SERVO_PINB = 10;
const int SERVO_PINC = 11;
Servo servo;
Servo servo1;
Servo servo2;

void setup() {
Serial.begin(9600);
pinMode(inputPin, INPUT_PULLUP); //internal pullup resistor is used to simplify the circuit
pinMode(ledPin,OUTPUT);
pinMode(ledPin1, OUTPUT);
servo.attach(SERVO_PINA);
servo.write(90);
servo1.attach(SERVO_PINB);
servo1.write(90);
servo2.attach(SERVO_PINC);
servo2.write(90);
digitalWrite(ledPin, HIGH);
}

void loop()
{
if(servo.read() == 0 && servo1.read() == 0 && servo2.read() == 10){
for(int i = 0; i < 2; i++) {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin1, LOW);
delay(500);
digitalWrite(ledPin, LOW);
digitalWrite(ledPin1, HIGH);
delay(500);
}
servo.write(90);
servo1.write(90);
servo2.write(90);
}
if(servo.read() != 0) {
if(code == "") {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin1, LOW);
}
if(code == ".") {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin, LOW);
}
}
else if(servo.read() == 0 && servo1.read() != 0) {
if(code == "") {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin, LOW);
}
else {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin1, LOW);
}
}
else if(servo.read() == 0 && servo1.read() == 0 && servo2.read() != 10) {
if(code == "" || code == "-.") {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin, LOW);
}
else {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin1, LOW);
}
}
NextInput:
while (digitalRead(inputPin) == HIGH) {}
t1 = millis(); //time at button press
//digitalWrite(ledPin, HIGH);
while (digitalRead(inputPin) == LOW) {}
t2 = millis(); //time at button release

signal_len = t2 - t1; //time for which button is pressed
if (signal_len > 50) { //to account for switch debouncing
code += readInput(); //function to read dot or dash
if(servo.read() != 0) {
if(code == "") {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin1, LOW);
}
if(code == ".") {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin, LOW);
}
//else goto NextInput;
}
else if(servo.read() == 0 && servo1.read() != 0) {
if(code == "") {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin, LOW);
}
else {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin, LOW);
delay(100);
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin1, LOW);
}
}
else if(servo.read() == 0 && servo1.read() == 0 && servo2.read() != 10) {
if(code == "" || code == "-.") {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin, LOW);
}
else {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin1, LOW);
}
}
Serial.println(code);
}
while ((millis() - t2) < 1000) { //if time between button press greater than 0.5sec, skip loop and go to next alphabet
if (digitalRead(inputPin) == LOW) {
goto NextInput;
}
}
morseToAlpha();
}

char readInput() {
if (signal_len < 300 && signal_len > 50) {
Serial.println(".");
return '.'; //if button press less than 0.6sec, it is a dot
}
else if (signal_len > 300) {
Serial.println("-");
return '-'; //if button press more than 0.6sec, it is a dash
}
}

void morseToAlpha() {
static String letters[] = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-",
".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--..", "E"
};
int i = 0;
if (code == ".-.-.-") {
Serial.print("."); //for break
}
else {
if (code.length() > 6) {
code = code.substring(5);
}
while (letters[i] != "E") { //loop for comparing input code with letters array
if (letters[i] == code) {
Serial.print(char('A' + i));
if(char('A' + i) == 'A') {
servo.write(0);
delay(2000);
}
else if(char('A' + i) == 'B') {
if(servo.read() == 0) {
servo1.write(0);
delay(2000);
}
}
else if(char('A' + i) == 'C') {
if(servo1.read() == 0) {
servo2.write(10);
delay(2000);
}
}
break;
}
i++;
}
if (letters[i] == "E") {
Serial.println("<Wrong input>"); //if input code doesn't match any letter, error
}
}
code = ""; //reset code to blank string
}

Citations

Garth Zeglin