Project tutorial
Straight Key Morse Code Oscillator

Straight Key Morse Code Oscillator © GPL3+

Simple circuit for building a Morse code practice oscillator. Push button is used in place of a straight key used in amateur radio.

  • 1,260 views
  • 0 comments
  • 3 respects

Components and supplies

About this project

Wanted to make a simple oscillator to practice sending Morse code with a straight key. Useful in a code class setting for students to copy and send code. Image shows a push button. An amateur radio straight key should be used in place of the push button when using this project. After the code is loaded into the Arduino, the USB cable can be unplugged and board can be powered with either batteries or power supply. Do not exceed 12 volts.

Code

Straight Key Oscillator.fzz.inoArduino
Code practice oscillator for use in amateur radio
/*
 This circuit is for a Straight Key Code Practice Oscillator. 
  
  Straight Key (using pushbutton in place of a straight key in this Sketch)

  Sends tone to speaker connected to digital pin 8,
  when pressing the Straight Key (pushbutton) attached to pin 2.

  The circuit:
  - Speaker - from pin 8 through potentiometer to speaker to ground 
  - Straight Key (pushbutton) attached to pin 2 from +5V
  - 10K resistor attached to pin 2 from ground

  created 2018
  by Jon Garber AC8XU

  This example code is in the public domain.

 */

// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2;     // the number of the pushbutton pin
int audio8 = 8;      // output audio on pin 8
int note = 800;      // music note/pitch

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);

}

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn Speaker on:
    tone(audio8, note);
  } else {
    // turn Speaker off:
    noTone(audio8);
  }
}

Schematics

Straight Key Oscillator
Straight key oscillator bb h49rocla94

Comments

Similar projects you might like

Morse Code Receiver

Project showcase by Alireza Karkon

  • 3,385 views
  • 5 comments
  • 23 respects

Morse Code Communication Using Laser Module (Both)

Project tutorial by SURYATEJA

  • 968 views
  • 1 comment
  • 9 respects

Morse Code Communication Using Arduino

Project tutorial by Jalal_Mansoori

  • 2,701 views
  • 7 comments
  • 19 respects

Morse Code Translator

Project showcase by Team ONYX

  • 10,192 views
  • 2 comments
  • 15 respects

Morse Code Machine

Project showcase by brzi

  • 3,131 views
  • 1 comment
  • 7 respects

Morse Code Transceiver

Project tutorial by Achindra Bhatnagar

  • 16,054 views
  • 13 comments
  • 92 respects
Add projectSign up / Login