HDSDR PTT Device

This page contains instructions on how to use an Arduino Uno or Nano to switch HDSDR to TX mode using a contact closure (PTT switch)

Prerequisites:

    • Your HDSDR setup must be set up, operational and keying up when you press the SPACE bar. If your HDSDR is not transmitting, adding this will not make it start!

    • We recommend an Arduino Uno Plus instead of a Nano. If you use a CH340 based Nano it can have issues with the CH340 based Nano in the RS-HFIQ if plugged into the same USB controller.

    • You are on your own for wiring your PTT switch to the Arduino. You must connect the switch between pin 2 on the Arduino and ground. Open is RX closed is TX.

    • You must download and install the Arduino IDE to be able to program the Arduino. Once you get the Arduino programmed, you can uninstall the IDE.

Connections:

Here is how to connect your Arduino:

The PTT detection is interrupt driven and only pins 2 and 3 can be used for pin change interrupts. You can get away with using pin3 if you change it in the Sketch but not any other pin.

Getting Set up to Program the Arduino

First, download and install the Arduino IDE (integrated development environment). After you install the IDE, plug your Arduino into a USB port and start the IDE program. Select TOOLS then Board then ARDUINO/GENUINO UNO (this will be different if you choose to use a Nano). Then TOOLS, PORT and select the port your Arduino is on.

Then go to FILES > EXAMPLES > 01.BASICS > BLINK. This will load the BLINK program that will blink the LED on the Arduino. Select SKETCH > UPLOAD to send the program to the board. If everything went OK the LED on the Arduino should be blinking 1 second ON, 1 second OFF, again and again.

You can view a YouTube Video of this process. You'll need to get Blink complied, uploaded and working before you attempt to load the HDSDR_PTT sketch.

Loading the HDSDR_PTT Sketch

Download the HDSDR_PTT.zip file below by clicking on the blue down-arrow on the right side of the screen (don't click on the file name). Put the zip file on your desktop and open it. Use file explorer to open DOCUMENTS > ADRUINO then drag the HDSDR folder out of the zip file and place the entire folder in the ARDUINO folder. A quirk of Arduino is that the Sketch MUST be located in a folder with the same name as the Sketch.

The HDSDR_PTT Sketch about 10 lines of code and requires no special libraries so if you got Blink working HDSDR_PTT should go just fine. Open the HDSDR_PTT Sketch in the Arduino IDE and click on SKETCH > UPLOAD.

Setting Up HDSDR To Work With the PTT Device

Start the HDSDR Program and set the following options:

OPTIONS > CAT to HDSDR > Port - set this to the same port as the Arduino in the IDE

OPTIONS > CAT to HDSDR > Baudrate - set this to 19200

OPTIONS > CAT to HDSDR > PTT Activation Pin - set this to none

OPTIONS > CAT to HDSDR > Activate - make sure it's checked

Start HSDSR and pressing your PTT button will switch HDSDR to TX and releasing it will switch HDSDR back to RX.

Remember, as with all things USB and HDSDR, if you plug it in a different USB port, it will enumerate as a different COM port and immediately stop working until you change the port setting in HDSDR.

Also, I put 25 msec of debounce in the Sketch if your D104's switch bounces longer just increase the time.

Adding a 16 Button Keypad

HDSDR supports more then just keying the transmitter via CAT commands. You can also control the frequency and change the operating mode. I have written a Sketch that uses a 16 button keypad to access some of these features. I connected my keypad like this:

You don't have to connect it the same way I did you can connect the row and column lines to any numbered pin. Don''t use the pin you are using PTT. Don't use 0 or 1 since they are the serial communication pins and 13 has the boards LED attached to it.

PTT and KEYPAD Sketch

Below is a zip file (HDSDR_PTT_KPD.zip) to use, download the zip file, open it and move the HDSDR_PTT_KEYPAD folder into your ARDUINO folder and the Keypad-master folder to your ARDUINO\LILBRARIES folder.

The Sketch changed HDSDR's operating mode using A, B, C and D and changes the band when you press 1-9. It's easy looking at the Sketch to see what to change to make the buttons do different things. You can combine the CAT commands so a single button sets the frequency and the mode.