Connecting a Ham Radio PTT Mic to a Computer

This post is about how to connect a Ham radio push-to-talk (PTT) hand microphone to a computer to switch the radio between Tx and Rx in simple ham radio remote control software.

Most ham radio remote control software will have keyboard keys assigned to perform certain functions, one of those keyboard functions is Push-to-Talk.

So when I was operation remotely, I wondered if I could use a Ham radio PTT hand microphone with an electric element on a computer.

So I did a quick test with an old Icom HM-36 hand mic and, yes I can use a HM-36 ham radio PTT hand mic with an electric element on a computer.

So here is what I did: Connected the Icom HM-36 ham radio PTT hand mic to a computer, then turned an Arduino pro micro into a USB keyboard, to send keystrokes to the computer through the usb port to switch the radio between Tx and Rx.

sainsmart -usb-4-channel-relay-module -web-controlled-raspberry-pi-simple-ham-radio-remote

Show-Hide Arduino sketch

Arduino (Pro Micro) sketch to send PTT keystrokes to the computer

/*
 *
 * This sketch will send PTT keystrokes to the USB port when
 * the push to talk button on the microphone is pressed.
 *
 * Used Arduino IDE 1.8.10
 * Select Tools > Board > Arduino AVR Boards > Arduino Micro
 *
 * arduino-pro-micro-push-to-talk.ino
 * v0.0.1 8-14-2024
 *
*/ 

// Include the Keyboard.h library found here :
// https://www.arduino.cc/reference/en/libraries/keyboard/
#include "Keyboard.h"

// Define constant value
#define pin_ptt  5

// Declare variable 
int ptt_state = 0;
int ptt_toggle = 0;

void setup() {

  // Starts emulating a keyboard connected to a computer
  Keyboard.begin();
  
  // Set pin_ptt to input and enable internal pull-up resistor
  pinMode(pin_ptt, INPUT_PULLUP);

}

void loop() {

  // Refresh ptt_state
  ptt_state = digitalRead(pin_ptt);

  // Mic PTT Pressed Send F19 as if a key was pressed on the keyboard
  if ( ptt_state == LOW && ptt_toggle == 0 ) {

    // Delay to eliminate ptt click
    delay(150);

    // Send a key press
    Keyboard.press(0x81);
    Keyboard.press(0xF6);
    Keyboard.releaseAll();

    ptt_toggle = 1;
  }

  // Mic PTT Released Send F20 as if a key was pressed on the keyboard
  else if ( ptt_state == HIGH && ptt_toggle == 1 ){

    // Send a key press
    Keyboard.press(0x81);
    Keyboard.press(0xF7);
    Keyboard.releaseAll();

    ptt_toggle = 0;                                                                            

  }

}                                        

Conclusion

Having a push-to-talk microphone connected to the computer make ham radio remote operation so much easier and when there is more then one instance of simple ham radio remote active on the computer monitor the PTT microphone is active in that focused radio window.

Note: With a simple audio interface between the microphone and the computer most push to talk ham radio hand mic - desk to mic can be connected to a computer.

Simple Ham Radio Remote

Home | Cookies | Terms of Use | Privacy Policy

Last updated: 09/13/2024
sd
This site uses cookies. By continuing to use this website, you agree to their use.