HackerBox 0096: Two Meter
by HackerBoxes in Circuits > Wireless
6391 Views, 15 Favorites, 0 Comments
HackerBox 0096: Two Meter
Welcome to HackerBox 0096. Get radio active by exploring the two meter very high frequency (VHF) amateur radio band, how to obtain an amateur radio license, and how to join an amateur radio club. Configure the ESP32 T-Display module for easy programming via the Arduino Integrated Development Environment (IDE). Assemble the exclusive HackerBox Two Meter (2m) radio lab hardware platform featuring the SA818-VHF radio transceiver module operating on VHF frequencies 134-164 MHz. Program radio firmware for receiving the NOAA National Weather Service radio broadcasts on at least one of seven established VHF frequencies. Explore digital models of radio communications as well as amateur radio direction finding and the sport of fox hunting.
HackerBox is the original monthly subscription box for electronics, computer technology, and hacker culture. Each HackerBox is a discovery box, which means all members await and enjoy a new surprise each month. Tech, toys, knowledge, and fun. It's like having a hacker convention, your birthday, and the first day of school - every month - right in your mailbox.
There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we'd really appreciate it if you can take a few minutes to read the FAQ.
Supplies
This Instructable contains information for getting started with HackerBox 0096. The full box contents are listed on the product page for HackerBox 0096 where the box is also available for purchase while supplies last. If you would like to automatically receive a HackerBox like this right in your mailbox each month, you can subscribe at HackerBoxes.com and join the party. Subscribers save at least $15 every month and get each new HackerBox shipped immediately off of the production line.
A soldering iron, solder, and basic assembly tools are generally needed to work on the monthly HackerBox. A computer for running software tools is also required. Have a look at the HackerBox Workshops for tools and supplies along with a wide array of introductory activities and experiments.
The most import thing you will need is a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.
WEAR SAFETY GLASSES WHEN SOLDERING, WHEN TRIMMING WIRE LEADS, OR WHEN CUTTING, DRILLING, ETC.
Two Meter Ham Band
The Two Meter (2m) amateur radio (ham radio) band is a portion of the VHF radio spectrum that comprises frequencies stretching from 144 MHz to 148 MHz. Electromagnetic waves in this frequency range are around 2m in length. The license privileges of amateur radio operators on 2m include Voice, FM, AM, Single-Sideband (SSB), CW (morse code), Satellite, Digital Modes, and more. VHF signals generally have a line-of-sight range of about 100 miles (160 km). For extended communicates, many amateur radio organizations operate radio repeaters on the 2m band. Because it is local, reliable, and the licensing requirements are relatively easy, the 2m band is one of the most popular. The compact size of 2m radios, antennas, and the band's ability to provide easy reliable local communications means that it is also a very common band for use in local emergency communications efforts, such as providing communications between Red Cross shelters and local authorities. (Wikipedia)
TWO METER (2m) RADIO
The SA818 radio transceiver module that we are working with uses the same circuitry as the very popular Baofeng Handheld Transceiver. This handheld radio was featured way back in HackerBox 0003: Radio Active. What a long, strange trip it's been. That HackerBox online guide is still quite useful and the Baofeng radio itself has continued to become ever more affordable.
Anyone can use the SA818 transceiver, or any other 2m radio, to receive, listen to, and decode all the radio signals we want. However, transmitting on frequencies in the 2m VHF band REQUIRES A RADIO LICENSE. If you are not a licensed radio operator or haven't verified the laws in your country, you should definitely not assert the PTT (push-to-talk) control signal on the SA818 module. Please take these laws seriously.
HAM RADIO LICENSES
While there is quite a lot to hear and explore in the 2m band without transmitting, you may want to consider getting an amateur radio license! What better place than here? What better time than now?
In the US, the initial radio ticket is the Technician Class License. It is obtained by passing a 35 question exam that, while not trivial, is easy enough to prepare for. All of the possible test questions are available free online to study at your leisure and you can find an exam location in your area or even take one online. You do not need to learn morse code.
Additional resources to prepare for the exam:
Ham Radio Crash Course Technician License Prep 2022-2026 Playlist (12 videos)
Free PDF copy of the No-Nonsense Technician Class License Study Guide
ARRL Technician Course 2022-2026 Playlist (37 videos)
HamStudy.org: free online study and practice tests
RADIO CLUBS
Ham Radio Village, K0HRV
ESP32 T-Display Module
To build confidence, configure the required tools, and reduce troubleshooting variables, we will initially be working with the T-Display Module WITHOUT SOLDERING the pins (or anything else) to the module.
The LilyGO TTGO T-Display ESP32 is a very compact ESP32 development board with a built-in 1.14 inch IPS 240x135 Full-Color Display. The T-Display module also provides Wi-Fi, Bluetooth, a battery charging interface, two onboard GPIO buttons, and a USB-C connector.
The IPS Color Display is controlled by an ST7789V Driver Chip that is prewired to the ESP32 pins shown in the diagram.
- Power up the T-Display using a USB-C cable
- Pre-programmed firmware will display a graphics demo
- Install the Arduino IDE
- Use the Arduino IDE Boards Manager to add ESP32 Support
- Within Tools menu, select:
- Board: ESP32 Dev Module
- Upload Speed: 921600
- CPU Frequency: 240Mhz (WiFi/BT)
- Flash Frequency: 80Mhz
- Flash Mode: QIO
- Flash Size: 4MB (32Mb)
- Partition Scheme: Default 4MB with spiffs (1.2MB APP/1.5 SPIFFS)
- Core Debug Level: None
- PSRAM: Disabled
- Port: COM port that appears and disappears when T-Display is connected/disconnected
- Form Tools > Library Manager, search for TFT_eSPI
- Install the TFT_eSPI Library from Bodmer
- Find the folder where Arduino Libraries are installed and the folder for TFT_eSPI
- Locate and open the file User_Setup_Select.h in a text editor
- Comment out the line with #include User_Setup.h (default)
- Uncomment the line with #include User_Setups/Setup25_TTGO_T_Display.h
- Load File > Examples > TFT_eSPI > Test and Diagnostics > Colour_Test
- Compile and Upload Colour_Test onto the ESP32 T-Display Module
A new program is now loaded onto the ESP32, which will generate an example of colorful text display. This confirms that our ESP32 T-Display Module is fully functional and also that our tools and libraries are properly configured.
Shall We Play a Game? (Nice graphics Volos)
Additional References:
TTGO-T-Display GitHub Repository
SA818-VHF Radio Transceiver Module
The SA818 is available in two frequency band variants: VHF (134-174 MHz) and UHF (400-480 MHz). While we are presently working with the VHF variant, both are shielded modules with integrated high performance microcontrollers, narrow band RF transceiver ICs, and RF power amplifiers. The SA818 provides a standard UART interface for easily configuring transceiver parameters and controlling radio transmit and receive functions.
Detailed specifications are provided in the attached SA818 Product Spec file. The attached SA818 Programming Manual details the five AT commands that can be sent to the SA818 over its serial interface:
1: Connection Handshake
AT+DMOCONNECT
2: Set Group Parameters
AT+DMOSETGROUP
3: Scan Frequencies
S+ReceiveFrequency
4: Set Volume
AT+DMOSETVOLUME
5: Set Audio Filter
AT+SETFILTER
Use of AT commands are reminiscent of the old Hayes telephone modems or, more recently, the original 8266 firmware interface.
Exclusive HackerBox 2m Radio Lab
The 2m Radio Lab is an easy to assemble solder kit. The PCB is essentially a deluxe breakout board for the shielded SA818 transceiver module that also provides audio connections, buttons, an SMA antenna port, and connections to the ESP32 T-Display microcontroller module.
Start assembly with the SA818 transceiver module. Carefully position the module to match its castellations over the corresponding pads on the PCB. Solder the small castellations on three sides of the module. The two large pads on the fourth side can be left unsoldered. Have a look at SparkFun's guide on How to Solder Castellated Mounting Holes.
The two 3.5mm jacks, three tactile switches, and the SMA antenna port are all soldered in the obvious way.
The ESP32 T-Display module must be oriented such that the USB-C port extends just over the edge of the PCB. The two rows of header pins provided in the plastic box with the T-Display can be used to permanently affix the ESP32 module by soldering each header pin on both sides - one at the top of the small module and one on the reverse of the large radio lab PCB. OPTIONALLY: Female header sockets can be added onto the radio lab PCB to allow the T-Display module to be removed and reinserted as desired.
The eight pin header between the SA818 and ESP32 breaks out the connections between the SA818 and the ESP32 as labeled on the PCB silkscreen. When the T-Display is on the radio lab PCB, a tiny disable sketch can be written to set the eight I/O pins associated with the SA818 as INPUTS. Setting the eight I/O pins to INPUT mode effectively disables those pins at the ESP32 and allows the SA818 to be accessed from the eight pin header located between the ESP32 and the SA818.
The seven pin header at the edge of the radio lab PCB breaks out three power rails (5V, 3V3, and GND) as well as the four unused I/O lines of the ESP32 that are not allocated to the SA818 module or the buttons.
Finally, twist the telescoping antenna onto the Invisible Airwaves SMA port.
Audio Signals
The audio signal interfaces of the SA818 radio transceiver include an input signal that can be transmitted and an output signal that can be received and listened to. Each of these signals connect to three other points on the radio lab PCB. That makes eight different audio sources/sinks. Eight ports gives us a lot of flexibility, but can also be quite confusing. Accordingly, it is worth pouring over these diagrams and notes prior to proceeding.
RECEIVING AUDIO
Audio signals received by the SA818 radio module are output from the SA818 on pin 3 (AF_OUT). AF_OUT means audio frequency output. This signal goes to three destinations:
- line out jack (3.5mm TRS socket)
- analog to digital (ADC) input to ESP32 (I/O pin 38)
- output at center header pin "38 / LOUT"
Note that the 3.5mm line out jack has the received audio fed to both left and right channels, so ear buds can be used to listen to the received signals. Amplified speakers can also be fed from the line out socket. The line out signal can also be fed into a PC (or other gizmo) to process digital mode signals received by the SA818 radio module.
TRANSMITTING AUDIO
Audio signals fed to the SA818 radio module for transmissions are fed into the SA818 on pin 18 (MIC_IN). MIC_IN means microphone input. This signal can be fed from three sources:
- line in jack (3.5mm TRS socket)
- digital to analog (DAC) output from ESP32 (I/O pin 25)
- input at center header pin "25 / LIN"
While the signal can be fed from three sources, it should only be fed by one source at a time. For example, while outputting audio from pin 25 of the ESP32, the 3.5mm line in jack and the corresponding pin of the eight pin header should be left unused. Similarly, when feeding an audio signal into the 3.5mm line in jack or the corresponding pin of the eight pin header (but not both), I/O pin 25 of the ESP32 should set to INPUT mode so that it is not also driving the same signal line.
Example Code - NOAA Radio
Grab the attached example sketch HB0096_TwoMeter_Demo.ino and program it onto the assembled HackerBox 2m Radio Lab platform.
The sketch code has two arrays for configuring radio channels. One array for the frequency of each channel and another array to assign a text nickname for each channel. Eight channels come predefined in the code, but you can easily edit the number of channels, their frequencies, and their nicknames.
The eight predefined channels include one channel in the 2m amateur band and the seven frequencies used by the National Oceanic and Atmospheric Administration (NOAA) for its Weather Radio station broadcasts. All NOAA Weather Radio stations broadcast on one of seven frequencies in the VHF Public Service band: 162.400 MHz, 162.425 MHz, 162.450 MHz, 162.475 MHz, 162.500 MHz, 162.525 MHz, and 162.550 MHz. (National Weather Service FAQ)
Button A cycles through channels. Plug earbuds or amplified speakers into the LINE OUT port to hear the weather information received on one or more of those channels.
Button C controls the Push to Talk (transmit) signal into the SA818 module. Do not use this feature if you do not hold the proper license and without making the required call sign identifications. Regardless of license held, never transmit on the NOAA frequencies.
Downloads
Digital Modes
According to the American Radio Relay League, "A great number of exciting new digital operating modes have developed, largely because of the availability of personal computers, soundcards, and advanced software. But amateur digital communication began in earnest in the late 1940's (if you don't count Morse as a digital mode!) when hams worked out techniques of connecting mechanical Teletype keyboard/printers to amateur gear using FSK and AFSK modulation."
The video Getting Started With Digital Modes nicely introduces amateur radio digital modes. As presented in the video, radio operators generally use a computer to encode and decode (modulate and demodulate) digital information to audio band frequencies for use over radio channels. Obviously, for us embedded system hobbyists, it should be possible to perform these tasks directly on a microprocessor or microcontroller such as our ESP32.
Between the computational prowess of the ESP32 microcontroller and the audio frequency interfaces to the SA818 transceiver, the HackerBox 2m Radio Lab is an excellent platform for exploring integrated digital communications modes. Contribute your integration efforts so we can link to them with full attribution!
Various links to existing projects and general references to get the ball rolling:
TNC (Terminal Node Controller)
ESP32TNC: Packet Radio Modem implemented on an ESP32
APRS (Automatic Packet Reporting System)
Arrow: APRS TNC on 2m using ESP32
Sampling audio frequency signals into the ESP32
HackerBox 0079 Audio DSP includes a hardware platform used for the 2m Radio Boondock Echo Project
Fox Hunting
Fox Hunting (video) is an activity wherein participants use radio direction finding techniques to locate one or more radio transmitters hidden within a designated search area. This activity is most popular among amateur radio enthusiasts, and one organized sport variation is known as amateur radio direction finding. (Wikipedia)
Our friend c0ldbru of rot13labs, yes the same one who designed the jumbo 8266 IOT Wi-Fi Hacking Badge featured in HackerBox 0093, made the very cool ham radio fox badge shown in the photo. This fox badge was as a fox hunt game at DEF CON 31. It was a huge hit, so c0ldbru made a limited additional batch available on Tindie.
Turns out that c0ldbru's fox badge features a similar radio transceiver module to the SA818, so we snatched his fox code, which he had actually snatched from Gregory Stoike's Yet Another Foxbox (YAFB), and we modified it for use on the HackerBox hardware...
- get an amateur license and callsign
- while(!licensed) {repeat first step}
- download the two sketch files attached here
- put them both into the same folder
- open fox.ino in the Arduino IDE
- find the string N0CALL and replace it with your callsign
- compile, program, and HIDE THE FOX!
- never gonna...
Hack the Planetary Airwaves
We hope you are enjoying this month's HackerBox adventure into electronics, computer technology, and hacker culture. Reach out and share your success in the comments below or on other social media. Email support@hackerboxes.com anytime with questions or whenever you need some help.
Want more? Surf over to HackerBoxes.com and join us as a monthly HackerBox subscription member. You'll get a cool box of hackable gear delivered right to your mailbox every month and you'll enjoy a generous member discount.
Please consider sharing this free Instructable with others who may be interested in learning about these subjects. We really appreciate your support and "word of mouth advertising" is the greatest compliment that we can receive.