HAT FOR A WHOLE STATION
By Gary, VK3TGR
Some time ago I developed an interest in deploying a remote station in an RF quiet location. My initial idea was to setup a remote receiver and take things from there. In the background I was thinking about how I might control the station and what it was I might eventually have there.
Obviously there would be a remotely controllable transceiver or receiver; power supplies that need to be controllable preferably with a dead-man timer so if we lose control the station it will not stay on transmit. A rotator or two and antenna selector would also be handy along with a means of measuring battery voltage and a temperature or two. A real time clock might come in useful as well.
With the popularity of the Raspberry Pi in amateur radio applications and the wide range of AR applications written for Linux (the operating system running on the Pi) and my previous experience in this area, I decided to build a HAT for a Pi to do as much as possible towards having a fully controlled remote station.
To make the hardware work, software is needed. I found RemoteQTH to be a good platform on which to work as some extension was required to work with the different hardware I was developing. I found it fairly easy to follow the code and make the changes needed. But RemoteQTH is only about station control with no integration of the audio paths and the use of external rotator controllers via USB interfaces.
The other aim I had for the software was for it to be accessible from as many platforms as possible. RemoteQTH meets this as it works via a web interface so can be accessed using any device with a web browser. The audio chain will need to be equally versatile while keeping any delays to a minimum.
The target facilities I had in mind were:
- Control the transceiver (TTL/RS2323/CI-V/USB)
- Control the power to the receiver (relays)
- Control two integrated rotators (3 relays and ADC/resistive or I2C feedback each)
- Control an integrated antenna selector (up to 4 antennas)
- Monitor battery voltage (1 ADC)
- Monitor temperature (1 ADC)
- Local control facilities (16*2 display, 4 buttons and misc. leds)
- Power supply for the Pi that can run from the same supply as the transceiver
Keeping in mind that the Pi works at 3.3 volts and a lot of the other equipment works at 5 volts; level converters were also included. They also function as buffers to protect the Pi if some things go wrong.
To design and have the PCBs made I used ExpressPCB software which is free and services which are not. The ExpressPCB software is easy (if a little tedious) to use even when new pad layouts or component diagrams are needed. They provide a range of PCB making services. I chose to use the MiniBoard service where you get 3 PCB’s of the same design with solder mask and component overlays but the boards must be 3.8 * 2.5 inches which suited as a HAT will fit in that with a little lift over for the board for the buttons etc. The PCB as returned from ExpressPCB needs to be cut into two at least. I have included two small sections that can be used to replace the relay drivers so a simple series resistor (could be 0 ohms) can be used instead if for example you want to use a relay PCB that already has drivers.
The outcome of this once the PCB has been cut is one PCB that plugs into the IO connectors and has a 26 pin connector for 14 * open collector relay drivers, 4 ADC channels, 2 * 5 volt PWM channels, Rx and Tx for TTL or RS232 or CI-, 12-15 volt power input and 5 volt output, a 14 pin connector for the display, LEDs and buttons, 2 I2C interfaces (one at 3.3v and one at 5v), programming connector for the small PIC used for PWM outputs for the rotators and controlling the LEDs and jumpers to select between the TTL/RS232/CI-V interfaces.
Also included is an EEPROM that can be setup to tell the Pi what resources are required by the board so that appropriate drivers can be loaded automatically. I have not programmed the EEPROM yet.
The ADC inputs are designed to take up to 20 volts but this can be adjusted by changing the resistive divider in the input circuit.
It should be noted that the connector and variable resistor for the display are outside the HAT specified area and can be cut off if required. Alternate arrangements for connecting a display via I2C are available although the buttons and LEDs would be lost.
The second PCB (below) supports the 16 * 2 (or similar) display, 4 push button switches and 8 LEDs that can be controlled by software and a power LED.
The pictures show the initial prototype in which a couple of errors had to be corrected, hence the blue wires. Some of the components loaded on the prototype board were selected on the basis of what I had on hand.
While I have not set up the complete system yet I have developed software to communicate with all the components on the board.
The one real use I have made of the board to date is to remotely control a system of lights on a stage prop (a 3 metre high shoe) that had glittering lights, a smoke machine and flashing pumpkin via a RemoteQTH based Pi web server, the HAT and a bunch of relays. This was very well received.
Circuit diagrams and pcb files (for ExpressPCB only) are available. Let me know via the usual WIA email forwarding service.
Anyone interested in joining me in this ongoing development would be welcome.
What a great article Gary. So, are you interested in doing something more around the Raspberry Pi? There are some generous club members who have been approached by your hard working president to explore lessons in programming. Watch this (or the next) space. Regards Martin, VK3TMP (Ed). PS, if you have something to share, drop me a line via the club email or via the useful WIA email address.