From charlesreid1

Line 9: Line 9:
Let's review each part of this circuit.
Let's review each part of this circuit.


==The Arduino Code==
==The Arduino Pseudocode==


The pseudocode running on the Arudino will be picking letters at random, sending them to the speaker, then updating the display with the letter. The pseudocode for the Arduino sketch, then, will look something like this:
The pseudocode running on the Arudino will be picking letters at random, sending them to the speaker, then updating the display with the letter. The pseudocode for the Arduino sketch, then, will look something like this:

Revision as of 01:09, 20 July 2015

Overview

Here's a block diagram of what this circuit will look like. The Arduino sends voltages through its output pins to control an I2C LCD screen (see , where it prints the letters that it has sent and its current words per minute (WPM) sending speed, and a piezoelectric speaker, which will generate the morse code output:

Diagram MorseCodeGenerator.png

Eventually this will also include an input potentiometer, but for now we're building this to send at a fixed WPM speed.

Let's review each part of this circuit.

The Arduino Pseudocode

The pseudocode running on the Arudino will be picking letters at random, sending them to the speaker, then updating the display with the letter. The pseudocode for the Arduino sketch, then, will look something like this:

Include libraries
Set pins

Setup:
    Set CW speed
    Set fixed messages

Loop:
    Read speed potentiometer (if applicable)
    Set CW speed (if applicable)

    Randomly select character
    Send character to morse code speaker
    Update display message

The Speaker Sub-Circuit

This one's pretty easy - we just hook up one of our pulse width modulation (PWM) output pins to the speaker, so that we can send modulated morse code tones to the speaker. See the Morse Code Beep Arduino Micro article for more on that circuit.

The Display Sub-Circuit

For the LCD display, I will be using a 4-pin, 5-volt Sainsmart LCD display. Here are photos of the front and back:

Front Back
Sainsmart front.jpg Sainsmart back.jpg

I already covered a basic Hello World example with this LCD display in the Arduino LCD Display article, so head over there to check it out. Controlling this display will require an additional two voltage pins. We've still got plenty of room left to expand this project with more pins!