Rotary Knob and Morse Manipulator for Remote SDR

Remote Keys

Remote SDR, application for controlling a transceiver from a web browser, can now (version> = 4.1) connect via USB to:

  • a frequency controller by rotary button
  • a Morse code manipulator interface
  • a push button to switch to transmission

This system, “Remote Keys”, is built around an Arduino Nano microcontroller which collects datas and transmit them via USB to Remote SDR, which uses the “Web Api” interface as described here.

The set is mounted in a box with a large frequency control button on top and a push button to transmit. On the side, a jack socket allows a telegraphy manipulator to be connected to one or two paddles.

Hardware

The frequency control button alternately lights up when turning, 2 brightness sensors which provide 2 digital signals on the D2 and D3 inputs of the Arduino Nano. A push button between ground and D4 allows to change state between transmission and reception, at each press. Inputs D5 and D6 receive digital signals from the Morse manipulator paddles.

The arduino Nano is connected to the PC running Remote SDR in a recent browser like Chrome or Edge capable of processing the Web Serial API.

Power for the assembly is supplied by USB.

Rotary Knob (DIY Version)

There are rotary knobs on the market that provide 2 compatible digital signals from an Arduino. Unfortunately, they typically only provide about 20 states per 360 ° turn. For ease of use, you need many states per revolution to quickly scan a band. Likewise, a heavy button, with a certain inertia, enables rapid sweeping by rotating it.

Luminosity sensor

For this project, I built a 7cm diameter epoxy wheel drilled with 16 6mm holes on the periphery and a 6mm central hole to pass a rotation axis. Two LEDs, above two light sensors, lit or not depending on the position of the wheel, provide an output at 0 or 1. They must be placed judiciously to have a change of state on each sensor alternately in a sequence:

00, 01, 11, 10, 00,… ou 00, 10, 11, 01 , 00… according to the direction of rotation.


An adjustment by potentiometer, makes it possible to adjust the luminosity threshold for switching. 0, 1. The 16 holes allow 64 state changes per 360 ° turn.

Rotary Knob (Chinese version)

By looking a little we find optro coders on the Chinese market (Aliexpress) at a very good price (10 €). Take the model at 300 or 600 pulses per revolution. The output signals (in open collector) are identical to those of the personal model, namely 2 phase-shifted oscillations which directly attack inputs D2 and D3. The button is supplied between + 5V and ground.

Push Button

A simple push button allows the passage in transmission like the TX Audio On / Off button of Remote SDR.

Morse Manipulator Input

Two digital inputs (grounded or not) allow the connection of a manipulator with one or 2 paddles. A 3.5mm 3-point jack plug is used.

Software

The software installed in the Arduino is very simple. It only transmits state changes. No command is received from Remote SDR. If you do not want the 3 functions: the knob, the push-button and the Morse manipulator, all you have to do is set to 0 the corresponding inputs or simplify the code. I will not detail here, how to develop code for Arduino, there are hundreds of tutorials on the subject. I just provide the source below:

/*
  Remote SDR
  Interface Serial-USB 
  - Frequency Tuning
  - TX/RX state change
  - CW Key
  F1ATB 26 December 2021
*/

// digital pin 2 and 3  has a luminosity sensor attached to them.
int Led_A = 2;
int Led_B = 3;
// digital pin 4 has a pusbutton attached to it
int pushButton = 4;
int OldButton = 1;

//CW Key
int LeftKey = 5;
int RightKey = 6;
int OldLeft = 1;
int OldRight = 1;

int Delay = 1;

int total=0;
// the setup routine runs at start up
void setup() {
  // initialize serial communication at 115200 bits per second:
  Serial.begin(115200);
  // make the pushbutton's pin an input:
  pinMode(Led_A, INPUT_PULLUP);
  pinMode(Led_B, INPUT_PULLUP);
  pinMode(pushButton, INPUT_PULLUP);
  pinMode(LeftKey, INPUT_PULLUP);
  pinMode(RightKey, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(Led_A), A_Rising, RISING) ;
  
}

// the loop routine runs over and over again forever to read the button and the morse key:
void loop() {
    Delay = 1;
   
    // Read PushButton
    int Button = digitalRead(pushButton);
    if (OldButton != Button) {
        Serial.println("B"+String(Button));
        OldButton = Button;
        Delay = 10;
    }

    // Read LeftKey
    int kLeft = digitalRead(LeftKey);
    if (OldLeft != kLeft) {
        Serial.println("L"+String(kLeft));
        OldLeft = kLeft;
        Delay = 2;
    }
    // Read RighttKey
    int kRight = digitalRead(RightKey);
    if (OldRight != kRight) {
        Serial.println("R"+String(kRight));
        OldRight = kRight;
        Delay = 2;
    }
    // Total is the sum of impulsions received from the rotating knob
    if (total<0){
       Serial.println("D"+String(total));
       total =0;
       Delay = 10;
    }
    if (total>0){
       Serial.println("U"+String(total));
       total =0;
       Delay = 10;
    }
    delay(Delay);        // delay in between reads for stability
}
void A_Rising() { // Rotating Knob interruption
    int LedStateB = digitalRead(Led_B);
    if (LedStateB ==0){
      total--;
    } else {
      total++;
    }
}

In this new software version, the button triggers an interrupt on a rising edge of pin D2. The Arduino counts up or counts down the edges depending on the state of pin D3. The total is sent for processing via the serial link. The use of interrupts helps to properly count the pulses when throwing the knob in rapid rotation.

When the push button is pressed, the Arduino sends “B0”. When released, “B1”.

A press on the left pallet or the simple manipulator, an L0 is sent. On release L1. For the right palette, it is R0 and R1.

The serial link is at 115200 bits / second so as not to take too much transmission delay.

Construction

The assembly is mounted in a light-tight box so as not to disturb the operation of the light sensors.

The components (Arduino, Brightness sensors) can be found on Ebay or Aliexpress.

To define the USB port to connect to, click on the button at the top right.

11 thoughts on “Rotary Knob and Morse Manipulator for Remote SDR”

      1. Interesting alternative solution. I did one myself, as I had all the components.
        The software, I propose for the Arduino is very simple and can be adapted to different encoder.

    1. The last version online works with a 600p/r.
      If it’s too sensitive, tell me, I will reduce by 2 or 4 the number of pulses per tour.

      73
      André

      1. lets go for 10 since your sensor setup was 60p/r ? we should as get close to your great selfmade rotory

        If possible make it some parameter, but this could be on the wishlist

        And a very Merry Happy Christmas!

        73 Frans

        1. In the version 4.2 to be released within 1 week, I will put in the configurationRX.js file a velocity factor to adapt, with only one coefficient, the speed of the rotating knob.
          73
          André

  1. On 26 december, I have updated the software. Now, it used the interruptions to perfectly counts the pulses when you throw the knob in rapid rotation. With the 600 pulses per revolution knob, it works fine.

Leave a Reply to F1ATB André Cancel reply

Your email address will not be published.