Basic Arduino Keyer

Several posts back, we made an Arduino Morse code oscillator. These are great if you are only using a standard straight key. To use a paddle you need a keyer. Today we will build a Basic Arduino Keyer. Construction of the keyer is very similar to the Arduino Oscillator. The main difference is the addition of the extra pin. Most of the changes are in the programming.

//Basic Arduino Keyer 6/9/19
//Author Matthew Carr KM4NMP
//common plug pinouts are:
//  Tip – left lever, or left side of single lever, normally Dot
//  Ring – right lever, or right side of single lever, normally Dash
//  Shaft – common

int LeftPin = 2;  //left paddle push pin
int RightPin = 3; //right paddle push pin
int LeftPinState = 0;
int RightPinState = 0;
int audio = 12;   //audio out pin
int note = 600;   //note pitch change for a different tone
int dotTime;
int dashTime;

void setup() {
  Serial.begin(9600);        //for debugging
  pinMode(LeftPin, INPUT);   //set pin as input
  pinMode(RightPin, INPUT);  //set pin as input
  dotTime = 125;             //dot time in milliseconds
  dashTime = dotTime * 3;

void loop() {
  LeftPinState = digitalRead(LeftPin);
  RightPinState = digitalRead(RightPin);

  if (LeftPinState == 1) {
    Serial.print("left ");         //for debugging
    Serial.println(LeftPinState);  //for debugging
    tone(audio, note);             //start tone
    delay(dotTime);                //tone length

  if (RightPinState == 1) {
    Serial.print("Right ");         //for debugging    
    Serial.println(RightPinState);  //for debugging
    tone(audio, note);              //start tone
    delay(dashTime);                //tone length
  delay(dotTime);                   //time between tones


Latest Posts

8 thoughts on “Basic Arduino Keyer

  1. Have you tried the KC4IFB iambic sketch?


    1. No I will have to look it up


        QEX issues are not available for download, but I once found a copy on the net by Googling.
        I think anyone can download the code from the QEX software page
        THat’s what started me on building Arduino keyers. It is unclear if there is copyright baggage. I have tried several times to contact Chapman with no response.

        Liked by 1 person

      2. Looks interesting. I don’t have a subscription but was able to see several articles about it just by googling. I found one you wrote. I kinda like the crayon box. Over time I will be adding more functions to this project. Too bad, he won’t reply. I have copyrights on my pages but usually have no issue with other sites referring to my content as long as they credit me and have a link to the original content.


  2. wonderful 73 de F8EZZ

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close