Hackster is hosting Hackster Holidays, Ep. 5: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 5 on Friday!
ddufault
Published © GPL3+

External S-Meter on Icom Radios with CI-V Port

Add an external S-meter on any Icom amateur radio transceiver that has a CI-V control port.

IntermediateFull instructions provided21,491
External S-Meter on Icom Radios with CI-V Port

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 4.75k ohm
Resistor 4.75k ohm
×1
Diode 1N4148
×1
Capacitor 10 µF
Capacitor 10 µF
×1
Ferrite Core Round Cable
Ferrite Core Round Cable
×2
Connector 3.5 mm (1/8)
×1
Connector Icom tuner (computer supply)
×1

Story

Read more

Custom parts and enclosures

icom_ci-v_-_arduino_external_s-meter_1_-_copie_d3ccibBjYE.jpg

icom_ci-v_-_arduino_external_s-meter_2_2MlMq3xvm1.jpg

icom_ci-v_-_arduino_external_s-meter_3_Edfe66OhJm.jpg

icom_ci-v_-_arduino_external_s-meter_4_GoLb4FDoPd.jpg

icom_ci-v_-_arduino_external_s-meter_5_8BB9YuMgOR.jpg

icom_ci-v_-_arduino_external_s-meter_6_I6a4pvohqr.jpg

Schematics

Icom CI-V S-meter schematic

Code

Icom CI-V S-meter

C/C++
// IC7300 Testbed for S-meter readout and other functions
// by Luc Decroos - ON7DQ/KF0CR
// modified & adapted by Daniel VE2BAP, 2018-12-01

#include <SoftwareSerial.h> // for comms to IC7000
#define BAUD_RATE 19200     // CI-V speed
#define TRX_address (0x70)  // HEX $70 = Icom IC-7000
//#define TRX_address ((byte)00)  // $00: Icom universal address (works for all radios).

// serial connection
// RX = Icom radio to Arduino  : to pin 2 via resistor 4k7
// TX = Arduino to Icom radio  : to pin 7 via diode 1N4148, with pull up 10k to Vcc (5V) on tip of 3.5 mm connector

SoftwareSerial mySerial = SoftwareSerial(2, 7); // (RX, TX)

int readCounter; // counts the number of bytes received from the radio
int sMeterVal1;  // stores the most  significant BCD byte containing signal info.
int sMeterVal2;  // stores the least significant BCD byte containing signal info.
int sMeterOut = 11; // External analog S-meter connected to pin 11.

//---------------------------------------------------------------------------------------------

void setup()
{
  pinMode(13, OUTPUT); digitalWrite(13, LOW); // force LED (pin 13) to turn off.

  pinMode(2, INPUT);  // CI-V serial communication from IC7000
  pinMode(7, OUTPUT); // CI-V serial communication to IC7000
  pinMode(sMeterOut, OUTPUT); // set sMeterPin for output
  
  mySerial.begin(BAUD_RATE);
  mySerial.listen();  // only one port can be made to listen with software serial
  // see reference https://www.arduino.cc/en/Reference/SoftwareSerialListen
  while (mySerial.available()) mySerial.read(); // clean buffer
}

//---------------------------------------------------------------------------------------------

void loop()
{
  // read and display S-meter value

  mySerial.flush();

  // start sequence: send "read S meter" command to radio.
  mySerial.write(0xFE); mySerial.write(0xFE); mySerial.write(TRX_address); mySerial.write(0xE0);
  mySerial.write(0x15); mySerial.write(0x02); // Read s-meter , command 15 02
  mySerial.write(0xFD); // end sequence
  delay(20);
  
  // now read info from radio
  int nbChar = mySerial.available();
  
  if (nbChar > 0) {
    for (int readCounter = 0; readCounter < nbChar ; readCounter++) {
      byte byteRead = mySerial.read();

      if (readCounter == 6){
        sMeterVal1 = ( (byteRead/16*10) + (byteRead%16) ); // First byte: convert from BCD to decimal.
      }

      if (readCounter == 7){
        sMeterVal2 = ( (byteRead/16*10) + (byteRead%16) ); // Second byte: convert from BCD to decimal.

        analogWrite(sMeterOut, ((sMeterVal1 * 100) + sMeterVal2)); // Calculate and write the S-meter value on the S-meter output pin.
        delay(20);
      }
    }
  }
}

Credits

ddufault

ddufault

1 project • 7 followers

Comments