Call Search
     

New to Ham Radio?
My Profile

Community
Articles
Forums
News
Reviews
Friends Remembered
Strays
Survey Question

Operating
Contesting
DX Cluster Spots
Propagation

Resources
Calendar
Classifieds
Ham Exams
Ham Links
List Archives
News Articles
Product Reviews
QSL Managers

Site Info
eHam Help (FAQ)
Support the site
The eHam Team
Advertising Info
Vision Statement
About eHam.net

donate to eham
   Home   Help Search  
Pages: [1]   Go Down
  Print  
Author Topic: Arduino Controller for 6x2 Antenna Switch Request  (Read 4575 times)
ZL1KFM
Member

Posts: 2




Ignore
« on: November 17, 2017, 12:11:43 AM »

G'Day fellow Hams,
I am searching for a design for a controller to control a 6x2 antenna switch.
The antenna switch has the capability to switch between 2 inputs and 6 outputs (antenna, in any combination).
Preferred option would be to have a Arduino control the selection, but not to have the other port to select an active connection that is already connected.
I would like to be able to use a graphical interface if possible.
Any help would be grateful.

Regards Kevin.
Logged
KG4RUL
Member

Posts: 3077


WWW

Ignore
« Reply #1 on: November 19, 2017, 08:15:17 AM »

I can add part of the design.  MANY years ago I constructed an antenna switch for a USN project to allow 4 HF radios to share 2 antennas.  The switch was operated from the parallel port of an IBM PC and provides good isolation.  I have expanded the circuit and changed the nomenclature to instead switch 2 radios between 6 antennas.  Un-selected antennas are grounded.  

Here is the relay schematic:
http://www.kg4rul.info/AntennaSwitchRelays.jpg

A truth table for the relay operation:
http://www.kg4rul.info/RelayTruthTable.pdf
Logged
ON5MF
Member

Posts: 137


WWW

Ignore
« Reply #2 on: November 19, 2017, 10:44:35 AM »

A few years ago I made one but it's not fully documented: http://www.on5mf.be/2013/04/12/my-current-project/

The rats nest you see is now in a box but it's still a rats nest :-)

I'm thinking of rebuilding it using a raspberry pi but I have way to many projects and an even bigger lack of time.
Logged

Mostly (low power) rtty contesting using OQ6A, sometimes dxing using ON5MF
in november '14,'15,'16,'17 and '18 also OP5MF, special prefix in commemoration of 100 years WW 1

www.on5mf.be
WD4ED
Member

Posts: 34




Ignore
« Reply #3 on: November 27, 2017, 08:54:23 PM »

This exact project has been in the back of my mind for a while now.  The KG4RUL schematic and truth table at a glance look good.  Is there any particular relays in mind?  Latching, non-latching?

What type of Display?  Simple LCD and a couple push buttons or some more fancy like an Oled touch?  I'd start with an LCD and two push buttons.  One to cycle between the input selections and one to cycle through the output antenna ports.  Obviously a "lockout" to prevent conflict.

Am I missing anything?  The type of relay will be important in the code. 

Thanks,

Ed
Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #4 on: November 28, 2017, 07:42:41 AM »

Another quick question.  Power level capability for the matrix?  100-200w?  LL?  I think LL would be the obvious choice.  Maybe prototype a lower power unit.  I think that there are some hardware designs out there but I haven't seen any Arduino code.  I just started on some basic code to see it it's as basic as I hope.

Thanks,

Ed
Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #5 on: November 28, 2017, 07:56:02 AM »

Is the switch remotely located?  Communications?  hardwired Serial? wireless Ethernet?  Wireless serial?  Wifi Ethernet means there wouldn't be a need for two arduinos.  A simple PC application could be developed to remote control the switching unit. 

The more I think about this the more it evolves in my head.  Input?

Thanks,

Ed
Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #6 on: November 28, 2017, 08:04:13 AM »

http://kk1l.com/kk1l_2x6switch/
Logged
VK4FFAB
Member

Posts: 424




Ignore
« Reply #7 on: November 28, 2017, 05:50:41 PM »

Is the switch remotely located?  Communications?  hardwired Serial? wireless Ethernet?  Wireless serial?  Wifi Ethernet means there wouldn't be a need for two arduinos.  A simple PC application could be developed to remote control the switching unit. 

The more I think about this the more it evolves in my head.  Input?

Thanks,

Ed

Use a ESP8266 or ESP32 and control it via wifi using your computer.
Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #8 on: November 28, 2017, 09:19:15 PM »

I played with it for a while today usin an Arduino Uno and just serial control.  Still has a few bugs but it’s fairly close.  I’ve setup the serial code so that it should move over to Ethernet fairly easily.  Then I’ll start on the windows app for control. 

Thanks,

Ed
Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #9 on: November 29, 2017, 06:02:27 PM »

Okay,

I have Arduino code for a 2x6 antenna switch working.  It should be able to work with both of the schematics in this thread.  I did manage to get an Arduino Uno to work with a standard Arduino Ethernet shield.  I managed to reserve the two serial port pins but I think all of the rest are used. 

I did also manage to get a small Windows Form application working as a control for it via Ethernet.  It's pretty simple but it's controls are based directly on what is returned from the Arduino after commands are sent. 

Yes, active antennas are locked out. 

One last thing I could add.  There is a "default" configuration.  But the current settings could be save to flash so that the last config would be the startup config. 

Thanks,

Ed 
Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #10 on: November 30, 2017, 08:11:39 AM »

Okay,

The last known configuration is now being saved and recalled from EEPROM.  Windows software syncs perfectly with the Arduino controller no matter the starting sequences.  It should work with Arduino UNO and Mega without issues.  Portability is limited due to the EEPROM usage.  Using the SD card slot on most Ethernet shields could be used.  This would be a bit slower but speed isn't really an issue in this case.  It would resolve the issue of max EEPROM writes.  But even that isn't much of an issue.

I plan on building this project, but I need to finish an HF-Auto type antenna tuner I'm working on.  That's a much bigger project and I should post my progress on it so far in another thread.  It uses an AD8302, AD8307 and a frequency counter to turn two stepper motors driving a roller inductor and Differential cap.  All of the building blocks are working but I'm kind of stuck on the actual tuning of the antenna.  It saves tuning solutions based on a frequency +/- a configurable bandwidth.  Essentially unlimited memories per band and will eventually track with a rig's vfo via cat.  But initially there's no datalink as I'm targeting 100% remote automatic operation.  A wireless data link was implemented in the project's earlier life as an manual tuner controlled via wifi with a Windows application.  There are a few older videos on youtube of the manual version in operation.  Search for wd4ed.

If you have a need for this Arduino firmware/Windows software for a project PM or email me directly.  edclarkiv1@verizon.net  It would probably be a good idea for some further testing with actual hardware.  During development I was monitoring the pins switching with a relay shield and voltmeters. 

The cool part for me is that I've been wanting to tackle this for a long time and just kept putting it off.  This thread helped motivate me!  Thanks!
I'll make a short video of it's operation... the software anyway. 

Ed
Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #11 on: November 30, 2017, 12:01:17 PM »

Application and configuration Notes:


2x6 Antenna Switch Controller Written By Ed Clark WD4ED 11/30/2017
For Arduino UNO and MEGA

Firmware and Windows Form application are intended to work with several existing 2x6 Hardware solutions already on the Internet.
For the purposes of this firmware/software operation all that is required is an Arduino UNO/MEGA2560, a standard Arduino Ethernet shield
and a Networked PC. Windows Application requires MS Framework 4.7.1 or later.  I intend on using a cheap wireless bridge to make my 2x6 switch "wireless'.

*Standard Arduino Ethernet shield pin usage. 13, 12, 11, 10, and Pin 4 if SD card slot use is desired.
   But is currently not supported in this application.

*Allows control of 2 Radios connected to 6 Antennas.  Allows any non-conflicted combination of Radios and Antennas

*Active antennas are locked out to the opposite radio.

*Receive data format (input to Arduino from Windows software via Ethernet) is "<R1A1>".  Which would set Radio 1 to Antenna 1.

*9600 Serial data rate by default.

*if relay is not already in use and pin toggle is successful the new radio/antenna combination is returned to the Ethernet port if connected
   or Serial port. Or both if both are configured.

*Return format (Data from the Arduino controller back to the Windows application via Ethernet) is "1,1,2,2\n\r".  Or "Radio1#,Ant1#,Radio2#,Ant2#\n\r".
   This allows the Windows application control states to be determined by the actual relay states.
   If you cannot select an antenna it is locked out.
   If you can select the same antenna for with both radios.... you are not connected.

*Setup tab allows for basic IP/Port configuration.  No hostnames.

*Other options are "Always On Top" and "Connect on Start".  "Always on top" should be obvious.  
   "Connect On Start" is only for use after the local configuration is working and stable.  
   Otherwise connection timeouts will become annoying.

*Last known pin states are saved and restored during reboots via AVR flash.  Writes occur immediately after each successful configuration change.  
   But only if there are actual changes.  This is an attempt to cut back on needless EEPROM writes.

*Simple debugging window assists in troubleshooting.

Bugs, Comments or suggestions to edclarkiv1@verizon.net

This sketch works on an Arduino UNO but with an Ethernet shield most of the digital capable pins are used.
Pins 0 and 1 are tied to the Serial port.  That leaves only A5 open for potential use.  
Using an SD card via flash would require at least pin 4 reassigned to probably A4 or A5.  UNO is a tight fit.

Suggested Pin usage:  

High select Antenna 1, Two Relays Pin 2
Radio 1 LOW, Radio 2 HIGH, Antenna 1 Radio Relay Pin 3

High select Antenna 2, Two Relays Pin 4
Radio 1 LOW, Radio 2 HIGH, Antenna 2 Radio Relay Pin 5

High select Antenna 3, Two Relays Pin 6
Radio 1 LOW, Radio 2 HIGH, Antenna 3 Radio Relay Pin 7

High select Antenna 4, Two Relays Pin 8
Radio 1 LOW, Radio 2 HIGH, Antenna 4 Radio Relay Pin 9

High select Antenna 5, Two Relays Pin A0
Radio 1 LOW, Radio 2 HIGH, Antenna 5 Radio Relay Pin A1

High select Antenna 6, Two Relays Pin A2
Radio 1 LOW, Radio 2 HIGH, Antenna 6 Radio Relay Pin A3
« Last Edit: November 30, 2017, 12:06:01 PM by WD4ED » Logged
WD4ED
Member

Posts: 34




Ignore
« Reply #12 on: December 01, 2017, 05:16:37 AM »

While researching how BCD band decoders work, I found that RemoteQTH.com has much of the Arduino code for projects just like this.  It's highly configurable for different hardware.  This makes it I bit harder to read through but every educational.  It gave me some ideas for incorporating a BCD encoder into my own version of the 6x2 switch.  In both the firmware and the windows application.  A lot of good information on that site if you are an Ham Radio Arduino nerd! 

Because of what I learned on that site, it only took a few minutes to get a basic Yaesu BCD decoder working on a separate MEGA.  Since the 6x2 project on an UNO doesn't have much space left, it will have to move to a MEGA to combine the BCD decoder with the 6x2 controller.  It's probably best.  I'll  merge up the code sometime today.

It's very good of them to publish code for others to learn from.  I suggest looking there.  The products are too steep for me currently and I prefer to use my own code, but I do appreciate the sharing of information!  It is educational.

Thanks again,

Ed
WD4ED
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!