Opportunities today are huge for both children and adults when it comes to creativity. With 3D printers we can make any object of any shape. With a little bit of our creativity, knowledge and dedication we can create almost anything we want. The only limitation is our imagination. If you want to create your own drone, why not? Alarm system, why not?
Today I will show you one simple example of a fully functional Encoder for Morse Code. Morse Encoder can make visual messages (LED diode) or sound (buzzer / piezo speaker), depending on your needs. This particular example works and shows only visual signals. It is ASCII based characters encoder only, but it can easily be expanded with all the characters you want to add. After you enter the message in the WEB form, click enter and computer (encode view in views.py) will encode your message and forward it to the Arduino board to be executed over the serial.
MATERIALS (Arduino set)
- Arduino board
- 220 Ω resistor
- LED diode
SOFTWARE YOU NEED
Rules of the Morse Code
To distinguish dots from dashes in Morse code there are time rules.
- The length of a dot is 1 time unit.
- A dash is 3 time units.
- The space between symbols (dots and dashes) of the same letter is 1 time unit.
- The space between letters is 3 time units.
- The space between words is 7 time units.
Completed electronic circuit should look like this one on the image bellow. It's the same schematic as one for the simple Blink example Arduino provides you with. You probably already know how to connect and are familiar with this one example.
After installing the required software on your computer, you can start building/coding the encoder.
First create your blank Django application (search for the installation and settings tutorial if you don't know how to do it). After you create your blan Django App you can find all the required working code at my GitHub account.
The files on GitHub repository are organized by Django app structure:
- ArduinoCode.ino - This file contains code you need to upload to the Arduino board using Arduino IDE software
- base.html - HTML code for the WEB page form you will see in your browser and where you will be entering your message
- style.css - CSS styles for HTML page (design of HTML page)
- urls.py - Required URLs Django application needs to resolve views
- views.py - Logic for encoding the message to Morse code (code which is executed when you click enter and send your message)