Icom arduino band voltage decoder

Discussion in 'Homebrew and Kit Projects' started by WA4SIX, Apr 20, 2020.

ad: L-HROutlet
ad: l-rl
ad: Left-3
ad: L-MFJ
ad: abrind-2
ad: Left-2
ad: L-Geochron
ad: HRDLLC-2
ad: MessiPaoloni-1
  1. WA4SIX

    WA4SIX Ham Member QRZ Page

    Modded from http://www.5b4wn.com/main/a1921.html

    Using an ULN2803A Darlington array for relay driving. 2 spare Darlington pairs will key amp (160M & 30M)

    Here's the sketch.


    //icom band decoder
    //Marios Nicolaou 5B4WN (c) 2009 7 24
    //Use the code at your OWN risk
    //GPL licence
    //Modified by Ed Grafton WA4SIX
    //Mod is to directly select pin, instead of BCD

    int icomBandPin = 5; // select the input pin for the potentiometer
    //int realVoltage = 8; // variable to store the value coming from the sensor Volts
    int sensedVoltage=0;
    int H=5;
    int G=6;
    int F=7;
    int E=8;
    int D=9;
    int C=10;
    int B=11;
    int A=12;
    float calculatedVoltage=0;
    int band=0;
    int counter =0;
    int previousValue=0;
    void setup() {
    pinMode(A, OUTPUT);
    pinMode(B, OUTPUT);
    pinMode(C, OUTPUT);
    pinMode(D, OUTPUT);
    pinMode(E, OUTPUT);
    pinMode(F, OUTPUT);
    pinMode(G, OUTPUT);
    pinMode(H, OUTPUT);
    void loop() {
    // read the value from the sensor:
    sensedVoltage = analogRead(icomBandPin);

    //get 5 consecutive values
    // counter++;

    if (counter==5) {

    calculatedVoltage = float(sensedVoltage)*5/1024;

    Serial.print (sensedVoltage);
    Serial.print (" - ");
    Serial.print (calculatedVoltage);
    Serial.print (" - ");

    Serial.println(band, DEC);
    delay (20);

    } else {
    if (abs(previousValue-sensedVoltage)>10) {
    //means change or spurious number
    } else {



    int getBand(float voltage) {
    int band=0;
    digitalWrite(A, LOW);
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    digitalWrite(D, LOW);
    digitalWrite(E, LOW);
    digitalWrite(F, LOW);
    digitalWrite(G, LOW);
    digitalWrite(H, LOW);

    if (voltage>4.20 && voltage<4.68) {
    digitalWrite(A, HIGH);
    } else if (voltage>3.50 && voltage<4.20) {
    digitalWrite(B, HIGH);
    } else if (voltage>=2.95 && voltage<3.50) {

    digitalWrite(C, HIGH);

    } else if(voltage>=2.30 && voltage<2.95) {

    digitalWrite(D, HIGH);

    } else if (voltage>=1.70 && voltage<2.30) {

    digitalWrite(E, HIGH);

    } else if (voltage>=1.2 && voltage<1.7) {

    digitalWrite(F, HIGH);

    } else if (voltage>=0.75 && voltage<1.2) {

    digitalWrite(G, HIGH);
    } else if (voltage <0.75) {
    digitalWrite(H, HIGH);

    return band;

    WA7ARK, AF7XT and US7IGN like this.
  2. WA4SIX

    WA4SIX Ham Member QRZ Page

    This circuit is for automatic control of my Metron MA-1000 while mobile. I will add a relay to bypass the LPF section for 6 meters & add an outboard ICE 6M LPF.
    Radio is an IC-7000. Antenna is an HS-1800 screwdriver with BetterRF 7000 controller.
    There will eventually be a horizontal antenna for 6M, whether 1/2 wave or full wave.

    AF7XT likes this.

Share This Page

ad: vanity