Band decoder for Arduino
This revision is from 2016/01/15 10:33. You can Restore it.
- The hardware
- Front side
- Back side
- How to connect Power
- Firmware - General settings
- Configure inputs
- Configure outputs
← Web page | HamShop.cz version →
The hardware
- Schematics
- PCB
Front side
- 1-14 - green LED signalized switched relay.
- 15-16 - non used outputs.
- white square - sign defines the type of equipment.
Back side
- DATA - RJ45 input data connector for Band decoder
- - TXD (UART/232 dependency internal switch).
- - GND.
- - RXD (UART/232 dependency internal switch).
- - BCD-1 input.
- - BCD-2 input.
- - +5V DC power supply.
- - BCD-3 input.
- - BCD-4 input.
- USB - +5V DC POWER supply, or upload arduino firmware.
- ETHERNET - not used.
- OUTPUTS - 14 relay outputs and GND.
How to connect Power
- plug power via usb mini cable to AC adapter, computer or usb HUB
Firmware - General settings
- Preset Band to output matrix - in default settings Band-1 corresponds to Relay-1, etc. You can sets any combination outputs for each band separate. With change zeros and ones in Matrix table. Band-0 reserved for out of range inputs measure.
//=====[ Sets band --> to output in MATRIX table ]=========================================================== boolean matrix[15][15] = { /* Band 0 --> */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* if inputs out of range \ Band 1 --> */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \ Band 2 --> */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \ Band 3 --> */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \ Band 4 --> */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \ Band 5 --> */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \ Band 6 --> */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* IN ) Band 7 --> */ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, /* / Band 8 --> */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, /* / Band 9 --> */ { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, /* / Band 10 -> */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, /* / Band 11 -> */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, /* / Band 12 -> */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, /* / Band 13 -> */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* Band 14 -> */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }, /* | | | | | | | | | | | | | | V V V V V V V V V V V V V V ----------------------------------------------------------- | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ----------------------------------------------------------- OUTPUTS RELAY*/ }; //============================================================================================================
Configure inputs
uncomment and activate only one input in source code
//=====[ Inputs ]============================================================================================= // #define INPUT_SERIAL // telnet ascii input - cvs format [band],[freq]\n (serial.h) // #define ICOM_CIV // read frequency from CIV (icom_civ.h) ** you must enabled 'CI-V transceive' in TRX settings, and disable ICOM_CIV_OUT ** // #define KENWOOD_PC // RS232 CAT (kenwood_pc.h) // #define YAESU_CAT // RS232 CAT (yaesu_cat.h) // #define YAESU_BCD // TTL BCD in A (yaesu_bcd.h) // #define ICOM_ACC // voltage 0-8V on pin4 ACC(2) connector - need calibrate in (icom_acc.h)And connect to TRX as described below
Input Serial
Activate uncomment line
#define INPUT_SERIAL
Not need any hardware settings, only send via USB to serial line ascii characters in preconfigured baudrate.
X,YYYYYYY\n
- X - band output in range 0-14, if activate BCD output range is 0-10 because 11-14 reserved for BCD. 0 (zero) = no output will be turned on.
- YYYYYYY - frequency in Hz - has no effect on the output relays, used if any CIV/CAT outputs activated.
ICOM CIV
Input worked in sniff mode (data over one wire - RXD). This means that it is necessary to provide, transmit frequency of TRX to serial line
- enabled CI-V transceive in TRX menu settings
- comunicate TRX with other device or software (for example logbook with CAT support)
Activate uncomment line
#define ICOM_CIV
Requires baud rate and CIV address in setting section of source code
#define SERBAUD 9600 // [baud] Serial port in/out baudrate #define CIV_ADRESS 0x56 // HEX Icom adress (0x is prefix)
In icom_civ.h file you can set rules to select individual output relays, with a resolution of one Hz.
//=====[ Frequency (Hz) to Band rules ]====================================== // you can expand rules up to 14 Bands if (freq >= 1810000 && freq <= 2000000 ) {BAND=1;} // 160m else if (freq >= 3500000 && freq <= 3800000 ) {BAND=2;} // 80m else if (freq >= 7000000 && freq <= 7200000 ) {BAND=3;} // 40m else if (freq >= 10100000 && freq <= 10150000 ) {BAND=4;} // 30m else if (freq >= 14000000 && freq <= 14350000 ) {BAND=5;} // 20m else if (freq >= 18068000 && freq <= 18168000 ) {BAND=6;} // 17m else if (freq >= 21000000 && freq <= 21450000 ) {BAND=7;} // 15m else if (freq >= 24890000 && freq <= 24990000 ) {BAND=8;} // 12m else if (freq >= 28000000 && freq <= 29700000 ) {BAND=9;} // 10m else if (freq >= 50000000 && freq <= 52000000 ) {BAND=10;} // 6m else if (freq >= 144000000 && freq <= 146000000 ) {BAND=11;} // 2m else {BAND=0;} // out of range //===========================================================================
- short JP2 (RXD)
KENWOOD CAT
Input worked in sniff mode (data over one wire - RXD). This means that it is necessary to provide, transmit frequency of TRX to serial line
- comunicate TRX with other device or software (for example logbook with CAT support)
- activate function Frequency request which utilizes data output TXD, and prevent the use of any from CAT/CIV output.
Activate uncomment line
#define KENWOOD_PC
Requires baud rate in setting section of source code
#define SERBAUD 9600 // [baud] Serial port in/out baudrate // #define WATCHDOG 10 // [sec] determines the time, after which the all relay OFF, if missed next input data - uncomment for the enabled // #define REQUEST // use TXD output for sending frequency request (Kenwood PC, Yaesu CAT)
You can also use functions
- WATCHDOG - determines the time, after which the all relay OFF, if missed next input data
- REQUEST - use TXD output for sending frequency request - and prevent the use of any from CAT/CIV output.
In kenwood_pc.h file you can set rules to select individual output relays, with a resolution of one Hz.
//=====[ Frequency (Hz) to Band rules ]====================================== // you can expand rules up to 14 Bands if (freq >= 1810000 && freq <= 2000000 ) {BAND=1;} // 160m else if (freq >= 3500000 && freq <= 3800000 ) {BAND=2;} // 80m else if (freq >= 7000000 && freq <= 7200000 ) {BAND=3;} // 40m else if (freq >= 10100000 && freq <= 10150000 ) {BAND=4;} // 30m else if (freq >= 14000000 && freq <= 14350000 ) {BAND=5;} // 20m else if (freq >= 18068000 && freq <= 18168000 ) {BAND=6;} // 17m else if (freq >= 21000000 && freq <= 21450000 ) {BAND=7;} // 15m else if (freq >= 24890000 && freq <= 24990000 ) {BAND=8;} // 12m else if (freq >= 28000000 && freq <= 29700000 ) {BAND=9;} // 10m else if (freq >= 50000000 && freq <= 52000000 ) {BAND=10;} // 6m else if (freq >= 144000000 && freq <= 146000000 ) {BAND=11;} // 2m else {BAND=0;} // out of range //===========================================================================
- short JP2 (RXD)
- short JP7 (PWR max232)
- short JP2 (RXD)
- short JP1 (TXD)
- short JP7 (PWR max232)
ICOM ACC(2) voltage
Hardware
- short JP3
Software
- uncommented
#define ICOM_ACC
- calibrate voltage in icom_acc.h
Yaesu BCD
Hardware
- all open
Software
- uncommented
#define YAESU_BCD
- optionaly set BCD matrix in yaesu_bcd.h
Configure outputs
You can uncomment more than one output, but not all combinations are possible. See on Context table and description of parts.
//=====[ Outputs ]============================================================================================ // #define SERIAL_echo // Feedback on serial line in same baudrate, CVS format <[band],[freq]>\n // #define ICOM_CIV_OUT // send frequency to CIV ** you must set TRX CIV_ADRESS, and disable ICOM_CIV ** // #define KENWOOD_PC_OUT // send frequency to RS232 CAT ** for operation must disable KENWOOD_PC and REQUEST ** // #define YAESU_CAT_OUT // send frequency to RS232 CAT ** for operation must disable YAESU_CAT and REQUEST ** // #define BCD_OUT // output 11-14 relay used as Yaesu BCD