wBitx

Build your own

Everything that makes a wBitx is open: the schematic, the printed case and the software, under the GNU GPL v3. It can be built on a perfboard in an evening.

Why we made it

Every year, the LARC team brings an interesting and different project for the attendees. We try to introduce something that is new, educational and above all a fun project. This year, when we started to think about the year’s project, it was clear to us that with the advent of AI’s ability to quickly develop very capable software, we should bring that to LARC.

As radio hams, we are always interested in free communications that release us from the dependencies of telecom. It is interesting that the world has recognized this, and we now have license-free frequencies that don’t even need a ham license. Worldwide, the license-free 2.4 GHz band has allowed the proliferation of Bluetooth, WiFi, LoRa and a whole host of communication methods that are now regarded as commonplace.

The entire stack of this communication system has millions of lines of code, and the ubiquitous smartphone, with 200,000,000 lines of code, is neither amenable to being homebrewed nor really understandable. This is due to the proprietary chips and large parts of the software being hidden and inaccessible to ordinary hams: the original communication engineers.

All the large platform providers like Google and Meta have further confused the essence of communications. Many, probably most, of the engineers who built the early Internet were radio hams. The early Internet grew out of the packet radio networks that were built and operated by radio hams. But now, sadly, we radio hams have no Internet-based communication systems of our own, except for a few proprietary systems like EchoLink or the DMR radios.

The wBitx serves a twin purpose:

  1. How can hams start to homebrew for the Internet? How do hams who have until now only built CW transmitters and direct-conversion radios move to building with the Internet? Something that is easy to program, and can be put together with the same effort as a CW transmitter?
  2. How can we use license-free spectrum to draw makers to ham radio? We need a “gateway drug” to ham radio for unlicensed folks who want a taste of communicating with equipment they have built themselves, without depending on any platform.

Thus the wBitx. The “w” stands for WiFi, and the Bitx for our approach to building communication equipment that is simple, useful, self-built and fully open source.

What it does

The wBitx is a communicator that works over WiFi. It needs a WiFi access point in the vicinity to work with. Once it is connected to WiFi, it operates like a VHF/UHF handy transceiver. You dial in a channel and press the PTT to talk to anyone on the Internet, across the world, who is dialled into your channel.

You can also call another wBitx by its callsign. To do this, add the callsign, select it and press the PTT button.

Third, you can send messages to other hams the way a ham would: the UP and DOWN keys become your paddle, and you send your messages in Morse code.

This is a project you can build in one evening. It can be assembled on a perfboard, and it will work fabulously well regardless of your layout. It will work with any battery, or even without one if you power it through the USB connector.

Design decisions

As we discussed this project for LARC, a few things stood out:

The last decision drove us to a simple four-key user interface on the cheapest display we could find: the 128 × 64 pixel OLED. Millions of these were made for the oxygen monitors during the Covid epidemic. They need just two wires to interface over the I2C bus, consume very little power, and are very readable.

Our battery decision took a long time, and it was painful. Most of the small flat LiPo batteries sold online are of spurious quality; many are duds and just don’t work. When switched on, the wBitx draws 100 mA with the WiFi fully on. That meant we needed at least 2500 mAh, and the only battery of that capacity available to us and to builders around the world is the standard 18650: 1.8 cm wide and 6.5 cm tall. The early pictures of the wBitx show this format.

A late breakthrough, understanding how the ESP32 can receive WiFi even while asleep, brought the power consumption down drastically. It now switches on fully only when you are using it or someone is transmitting to you. This let us move to a smaller battery: the Nokia BL-5C, which is universally available and used in a number of cameras and other devices. Replacing one shouldn’t be a problem.

The final size of the wBitx is really small: 57 × 98 × 23 mm. It slips into your pocket.

The user interface

The traditional radio had just two main controls: a volume control and a tuning knob. You tuned to a frequency, pressed the PTT to talk, and adjusted the volume for comfortable listening. Digital communicators make that a greater challenge.

The four-key interface is easy to use. The UP and DOWN keys move forward or backward. The other two are ENTER and MENU. ENTER can be thought of as “select this”, “OK” or “do this”: it affirms what you have chosen. MENU can be thought of as “cancel”, “go back” or “show the menu”.

The interface needs very little text entry, but it is essential when you enter a WiFi password or a callsign. Mostly you are entering just a few letters at a time. When entering text, you are shown the list of all the letters, digits and symbols:

The home screen shows the channel or callsign you will talk to when you transmit:

How it works

The wBitx is built around the popular and inexpensive ESP32-C3. It costs just $2 (₹200) and is easily available on the Internet. The ESP32-C3 is a RISC-V microcontroller with a built-in 2.4 GHz radio. It consumes very little power in sleep, and it is a fast enough CPU for our needs.

For voice-quality audio, we skip the audio codec chips entirely: the ESP32-C3 itself can be the audio peripheral.

Audio in

The ESP32’s ADC is good enough to capture voice. The MEMS microphone produces around 50 mV of audio, while the ADC’s range is a little over one volt. A single-transistor preamplifier, with 2.2 k in the collector and 100 Ω in the emitter, gives a voltage gain of about 20, which brings the microphone’s 50 mV up to the 1 V the ADC wants.

There are two separate preamplifiers, one for the internal microphone and one for the handsfree. Each draws 1 mA, so to save power they are switched on by a GPIO pin labelled AUDIO_ON.

Audio out

The audio is made by toggling one digital pin quickly between 3.3 V and 0 V, which charges a capacitor. Depending on how long the pin is on or off, the capacitor charges to different voltages. This analog voltage can be heard directly in earphones, or amplified by a PAM8403. The PAM8403 is a new breed of amplifier that works at very low voltages and consumes very little power compared to even the good old LM386. It also has a MUTE pin that turns it off when no audio is playing.

Battery

The wBitx works off a LiPo battery. We have used everything from a 350 mAh “pill” cell to a 3500 mAh 18650; you can use any LiPo battery, or even four AA cells.

Charging and programming are both through the USB-C port of the ESP32-C3. A TP4057 charges at 500 mA: an 18650 takes six hours to charge, the BL-5C two.

The USB connector’s power is brought to the ESP32 module’s 5 V pin through a Schottky diode. When the charger is plugged in, current flows from the 5 V pin to the TP4057 through D1. When it is unplugged, the 5 V line falls to zero, D3 turns on, and the battery’s 4 V supplies the ESP32. We use a linear charger to avoid the EMI and RFI that often plague WiFi devices. Feel free to use any other charger you have at hand, or just power it from a USB port to test it.

The schematic is on GitHub.

The case

The wBitx lives in a 3D-printed case of three parts: a front, a back, and a lever on the side for the PTT. It measures 57 × 98 × 23 mm. The front carries the display’s window, the four keytops (printed as one piece, joined by a thin frame) and a 50 mm speaker under a grille. The back holds the BL-5C cell behind the board. Four M3 × 20 self-tapping screws hold the two halves together. The PTT switch on the board is pressed by the lever, which swings on an M3 × 16 screw.

The front and the back print in about 70 minutes on a Bambu Lab A1, in PLA, without supports. The lever adds about ten minutes. Self-tapping M3 screws need a 2.9 mm hole in PLA; at 2.6 mm they spin on top of the hole and will not start.

The case is a Python program, written with build123d, in case/wbitx2 of the repository; make wbitx2 writes the STL files to print. Before anything is printed, verify.py checks every fit: that no two parts overlap, that the lever swings freely and presses the PTT, that each screw has enough thread, and that nothing needs supports. It took many test prints to get the fits right, and the program now remembers all of them.

The software

It is about 8,000 lines of simple C. You can study the code just as you would a circuit diagram, change things around, or ask your favourite coding agent to do it for you.

The code is cleanly split into modules that handle the WiFi, the voice, and the sBitx protocol (which connects, authenticates, and carries voice and text). It is well documented and released under the GNU General Public License at github.com/afarhan/wbitx. A CLAUDE.md file in the repository lets you use a coding agent to develop any feature you wish to try.

The best way to understand the software is to read it. Start with wifitalkie.ino. It is short: setup() opens each module in turn, and loop() calls each module’s poll function, over and over. Nothing waits for anything else, so a slow network never freezes the keys. Every file begins with a comment that says what it does and why, so you can read the code from the top down, one module at a time:

A good first exercise is to follow a press of the PTT from ptt.c through microphone.c, speech.c and voip.c until the packet leaves for my.sbitx.net, and then follow a packet back in through voip.c and speaker.c to the speaker. Plug the wBitx into your computer and type STATUS on its console (make monitor) to watch it work while you read.

The section on reading the code was written with Claude.ai. The rest of this page is written by us.