Skip to content

leventelist/ham_hat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry PI hat for radio amateurs

History

I've been doing a lot of SOTA activations with Raspberry PI like SBCs, and there where always issues, like RF interference, and power supply shorts. I started to add things like galvanically decoupled audio interface, a step down power supply. It was working, but it looked like a mess.

This piece of hardware integrates all needed equipment in one nice hat. It is designed to put the RPI in a metallic box to further isolate from RF signals.

It was designed using KiCad.

Applications

  • HF/VHF digital modes (PSK, FT8, etc)
  • HF/VHF AX.25 based modes (Packet, APRS, etc)
  • CW keying
  • Clock synchronization
  • Position tracking

Features

  • 3A power supply with wide input voltage range: 8 to 35V
  • Ublox MAX-8/10 GPS receiver for position and time synchronization
  • Inductive audio couplers to minimize GND loops. Up to 4kHz.
  • PWM controlled cooling fan
  • GPIO controlled PTT from the PI
  • GPIO controlled CW key from the PI
  • RTC
  • Shutdown button
  • Run LED

GPS antenna is not integrated in the device, so an external antenna connector is mounted on the PCB.

Ufortunately, the sound card of the PI can not record audio, so an external sound card must be used. I use this particular device with good results. I usually break the plastic housing, and solder a shielded cable directly to the audio interface (J109).

The GPS is needed for APRS and time synchronization. There is an onbard RTC to have some redundancy.

Placing variants

There are a few components that mounted or unmounted depending on particular application.

HT radio

When this device is used with a handheld radio, that has a PTT and mic input (Like the FT-4X), mount C108 and R116. Please note that the value of R116 might vary based on the actual transceiver used.

If used with a radio that has separate input for audio and PTT, mount a 0 Ohm resistor to C108. You might also leave C108 as a capacitor (22uF), but it is not really needed.

C108 and R116 is placed on the layout that it can be mounted or replaced after everything else is mounted too. All you need is the dismount tha cooling fan.

High bandwidth audio

If you want to have direct access to the audio interface of your radio, you can leave T101 and T102 unpopulated and short JP102 and JP103, JP104. Please note that you will loose GND separation as well.

Mechanics

It is designed to fit on the Raspberry PI 4. Be aware, that if the heatsink on the CPU is too high, it might conflict with the screws of the fan. If that happens, mount the heatsink 45 degrees.

Box

A box is designed in FreeCAD using sheets of PCB. The idea is to use bare, one sided PCBs, and solder the plates from the inside. The sheets can be easily milled by a CNC machine.

There are several cutouts on the box.

In the front, you have the power inlet, and a second cutout for powering the attached LCD screen. On the right side of the front sheet, there is a cutout for the power chord to the GPS antenna, if needed.

On the right, there are anouther cutout for the audio cable.

The assembly does not include some (all) the models, hence they might violate copyright.

Connection to the radio

The hat comes with a DB9 connector to connect up your rig. I wanted to have a screw lock connector, and this was the best choice. The pin out looks like this.

Signal name Pin of the DB9 Comment
TX audio 1 Audio input of your rig
KEY 2 CW key of the rig
PTT 3 PTT input of your rig
NC 4 Not connected
RX audio 5 Audio output of your rig
GND 6 Audio ground
GND 7 Audio ground
GND 8 Audio ground
GND 9 Audio ground

GPIO connections

Signal name GPIO Commnet
PTT 12
KEY 21
DCD 16

Connection to the soundcard

J105 provides connection to the soundcard.

Signal name Pin of J105 Comment
RX audio 1 Mic input of your soundcard
TX audio 4 Speaker output of your soundcard
GND 2,3 Audio ground

Power connection

J101 provides power connection. The maximum input voltage is 35Volts.

GPS

Use u-blox MAX-8C/Q or MAX-M10S GNSS module. When the MAX-10 is used, don't populate R113.

Connect your passive or active GPS antenna to J104. Use 3.3V active antenna. PPS signal is provided on GPIO18.

When passive antenna is used, don't populate L102.

Here is an excellent article how to set up GPIO-PPS for ntpd.

RTC

BQ32000 based precision RTC is provided for backup if the GPS can't provide accurate timing.

Enable I²C on Raspberry Pi

sudo raspi-config

Navigate to:

Interfacing Options → I2C → Enable

Reboot the Raspberry Pi:

sudo reboot

Check I²C Communication

sudo apt install i2c-tools
i2cdetect -y 1

You should see the RTC at 0x68.

Configure Linux to Use BQ32000

sudo modprobe rtc-bq32k
echo bq32000 0x68 | sudo tee /sys/class/i2c-dev/i2c-1/device/new_device

# This next one line only needed to set initial time of the RTC
# Otherwise it'll fail to read
sudo hwclock -w

# Test to read the RTC
sudo hwclock -r

Make It Persistent

Edit /boot/firmware/config.txt:

Add the following line:

dtoverlay=i2c-rtc,bq32000

Save and reboot:

sudo reboot

Disable Fake RTC (if needed)

sudo systemctl disable fake-hwclock
sudo systemctl stop fake-hwclock

Edit /lib/udev/hwclock-set and comment out:

#if [ -e /run/systemd/system ] ; then
#    exit 0
#fi

Sync RTC with System Time

Set RTC from system time:

sudo hwclock -w

Set system time from RTC:

sudo hwclock -s

Final Test

Check that the RTC retains the time after reboot:

sudo hwclock -r

Connect a 3V battery to BT101 for offline RTC operation.

FAN control

PWM shall be enabled on GPIO13.

If you don't want PWM control, short JP101, and the fan will spin at full power all times.

There's a non-PWM control of the fan that works out of the box using the Raspberry PI OS.

Open raspi-config, under Performance Options, you shall select the desired temperature, and the GPIO pin which is 13.

Shutdown button can be connected to J106

To make it work, you have to add these lines to /boot/firmware/config,txt

dtoverlay=gpio-shutdown,gpio_pin=26

Ther's also a LED (D107 )that shines when the system is running. When it Doesn't, it is safe to remove power from the RPI.

To make this work, add this too:

dtoverlay=gpio-poweroff,gpiopin=7,active_low=1

Accessories

These items needed for the hat for full functionality.

All sourced from Farnell, unless othervise noted. (Sorry, I'm Hungary based.)

Item Source designator Comment
RTC Battery 1892670 The idea is to use heatshrink tube and some wires.
RTC Battery holder 3583203 External battery holder for CR2032
Heatsink 1211701 or https://www.alza.hu/raspberry-pi-rb-hutoborda-d4147799.htm?o=21
Standoff 1466844 It must be 12mm in length
Mounting screws M2.5x6
GPS antenna This or this Use 3V active antenna
RPI4 3369503 (8GB) or 3051887 (4GB)
USB audio interface Alza Any other do the job. Check Linux driver availability.
Monitor Ebay
Keyboard https://www.pcland.hu/genius-luxemate-100-usb-fekete-hun-billentyuzet-31300725113 Any USB Keyboard. I use the one without keypad, for its compact size.
Mice Any USB, or BLE mice
SD card with Raspbian image.
uHDMI to HDMI cable Alza
DB9 Male connector To connect to your radio
Data connector for your radio
Shielded audio cable To connect the soundcard to the hat, and for the DB9 connector

About

Raspberry PI hat for amateur radio operators

Resources

Stars

Watchers

Forks

Packages

No packages published