This is all based on egzumer custom firmware!
Some features have been added to make it possible to use the radio as an amateur radio direction finding (ARDF) receiver on the 2m and 70cm band.
Understand this as a proof of concept! This is experimental software, there is absolutely no warranty! Use it at your OWN RISK as a base for own experiments.
Despite all the limitations this is one of the quickest and cheapest ways to get a usable ARDF receiver for the 2m and 70cm band!
Warning
Use this firmware at your own risk (entirely). There is absolutely no guarantee that it will work in any way shape or form on your radio(s), it may even brick your radio(s), in which case, you'd need to buy another radio. Anyway, have fun.
- Main ARDF Features
- Compatible Devices
- ARDF Feature Manual
- Firmware Flashing
- Headphones
- Antenna Proposals
- Radio Performance
- Compiler
- Building
- Credits
- Other sources of information
- License
- Example changes/updates
- AM demodulation
- Manual gain control
- Transmission function completely disabled (safe for non ham radio licenced operators!)
- Active fox and remaining cycle time display
- Beep signal before end of fox cycle
- Fox distance prediction
- small bandwidth modes
- Simplified mode for Draussenfuchs
- 2m and 70cm band (but not 80m)
- FCC ID "XBPUV-K5"
- Quansheng UV-K5 version 1 ✅
- Quansheng UV-K5+ ("UV-5R PLUS") version 1 ✅
- Quansheng UV-K5(8) version 1 ✅ / Quansheng UV-K6 version 1 ✅
- Quansheng UV-K5(99) version 1 ✅
Warning
There are new hardware versions out. Check carefully which hardware version do you have before flashing any new firmware!
❗ All versions have different processors and need the right firmware and flash tool to run. ❗
The hardware version of a device usually can be found on the label under the battery:
Version 1 devices have no version label, version 2 has "V2", version 3 has "V3" and Software Version 7.x (Menu 53 "VER").
Warning
There are falsely labeled devices out! (Internally V2 but V3 on the label.) Please check this discussion first.
NOT COMPATIBLE with this project but alternative firmware available:
- Quansheng UV-K5(8) / UV-K5(99) (with FCC ID "XBPUV-K5") version 2
- Check this project: Quansheng UV-Kx firmware with ARDF support for hardware version 2
NOT COMPATIBLE with this project but alternative firmware available:
- Quansheng UV-K5(8) / UV-K5(99) version 3
- Quansheng UV-K1 / UV-K1(8)
- Check this project: Quansheng UV-K5 version 3 and UV-K1 firmware with ARDF support
NOT COMPATIBLE:
- Quansheng TK-11 / TK-11(8) ❌
- Similar looking baofeng radios ❌
Download a precompiled release or compile with ENABLE_ARDF=1 and preferable with ENABLE_PREVENT_TX=1. To get enough free flash space disable some unneeded TX features (e.g. ENABLE_DTMF_CALLING=0).
You need a quansheng programming cable with an integrated USB to serial converter. Most baofeng cables are working fine, too.
- Find out which hardware version do you have and which firmware do you need for it. See compatible devices.
- Backup your settings!
- Charge battery if almost empty!
- Press PTT key while turning the radio on. This will NOT work if the programming cable is already plugged. White LED on top MUST be on.
- Connect the programming cable NOW
- Run flash program which fits to your hardware version (see next sections)
- HW Version 1 Webflasher for chrome based browsers (Choose
firmware.packed.bin)⚠️ Do NOT flash V2 or V3 hardware devices with this flasher!
- On linux k5prog can be used: Run
k5prog -b firmware.bin -F -YYY - On windows k5prog_win can be used. (Choose
firmware.packed.bin) - Official quansheng flash tool (Windows only. Choose
firmware.packed.bin)
- There is no working webflasher for this hardware version.
- On linux k5prog can be used: Run
k5prog -b UVK5-V2.ARDF.bin -F -YYY - On windows k5prog_win can be used. (Choose
UVK5-V2.ARDF.packed.bin)
- Either programming cable or USB-C cable can be used.
⚠️ k5prog and k5prog_win are NOT compatible.- UVTOOLS2 for chrome based browsers
⚠️ Do NOT flash V1 or V2 hardware devices with this flasher!
- If device does not boot after flashing something went wrong. Try flashing another firmware file or a different flash tool.
- If serial port is not found on linux add your username to the
dialoutgroup (sudo usermod -aG dialout your_username) and reboot.
- Turn the power knob at least 90° to switch the device on.
- Draussenfuchs Mode can be enabled in the menu (ARDF = "DF Simple"). This enables manual gain control stepping by pressing UP/DOWN keys. Smaller values have lower sensitivity. Use this close to loud transmitters. "DF Simple" mode automatically preconfigures the most important settings.
- Set frequency stepping to 1 kHz. (Menu: Step = 1.00kHz)
- Select amplitude demodulation (Menu: Demodu = AM)
- Enter frequency (Main Screen: 433920 for 433.920 MHz)
That's it.
Main screen in "DF Simple" mode. Gain step 5 is used, received signal strength is 062 (the higher the stronger the signal). A means "VFO A" (can be A or B, does not matter), "AM" means amplitude demodulation (selected in the menu before), "U-" means lowest bandwidth (can be "N-", "N" or "W", too. Does not really matter.). 433.920 is the selected frequency (433.92 MHz).
For amateur radio direction finding (ARDF) with timing some more steps are needed:
Turn the power knob at least 90° to switch the device on.
ARDF Mode can be disabled/enabled in the menu (ARDF = OFF / ARDF / DF Simple). "ARDF" or "DF Simple" enable manual gain control stepping by pressing UP/DOWN keys. On step changes the attenuation by approximately 5dB. Index 0 has the smallest sensitivity. "DF Simple" has a simplified display especially created for Draussenfuchs or when no timing is needed.
-
Disable squelch (Menu: Sql = 0)
-
Disable dual watch (Menu: RxMode = MAIN ONLY).
-
Select number of foxes in menu "NumFox" (default = 5, min = 1, max = 10; 0 disables fox timing).
-
Choose duration time of one fox transmission in menu "FoxDur". Default is 60s. Modify with UP/DOWN key in 0.1s steps or enter value as 5 digit number in 1/100s resolution. Confirm with menu button (min = 001.00s, max = 999.99s).
-
Enter beep signal before end of fox cycle time (menu "EndSig", 0s = off, 1..30s).
-
Adjust clock correction if necessary (menu "ClkCor", details below).
-
Activate VFO A (long pressing key "2 A/B" toggles between both VFOs.
-
Enter the frequency of the foxes using the number keys. If memory mode is active long press "3 VFO MR" to change to frequency mode.
-
Choose the modulation type of the foxes in menu "Demodu" (e.g. AM).
-
Select a narrow bandwidth mode in menu "BW W/N": "U 1K7" is 1.7 kHz, (this is the smallest possible value; shown as "U-") or "U 2K5" which is 2.5 kHz (shown as "N-" on the ARDF screen).
-
Switch to VFO B by long pressing "2 A/B". This VFO will mostly be used for the return beacon.
-
Configure frequency, modulation and bandwidth the same way as for VFO A.
-
Change back to VFO A by long pressing "2 A/B".
-
If you want to use distance prediction, calibrate RSSI0 at 100m distance (menu "RSS100", details below.).
-
Unscrew antenna and add a directional antenna with good front/back ratio.
-
Select a medium volume and try not to change it. Volume adjustment should be done with gain control (UP/DOWN keys).
-
Listen for foxes, synchronize fox number and timer in menu with "ActFox" and "TiRst" options (details below).
-
Start hunting foxes and have fun!
This pictures shows the radio screen if ARDF mode is enabled. The battery voltage is 8.54V. The second (big) line shows active fox (2), seconds left in this fox cycle (5), chosen gain index (0) and the raw received signal strength indicator (RSSI, 151 here).
The bold line below show the settings for the active VFO: VFO "A", demodulation "AM", bandwidth mode "W" (wide) and receiving frequency "144.525 MHz".
In the middle the signal strength is shown: -93 dBm / S9 and a strength bar. The value at the end of the line is called RSSI0 (151). It is used for distance calculation and distance calibration. It adds the influence of the selected attenuation (gain index) to the raw RSSI value.
For the active VFO (A) the gain remember mode (details below) is active so the gain index history table for up to 5 foxes is shown. The active fox number is bold. The last column behind the gain remember table shows a rough prediction of the distance to the fox (100m). It is roughly estimated out of the normalized signal strength "RSSI0". If the received signal is too weak no prediction is shown.
The last line shows the configuration for the inactive VFO. It is recommended to put the fox settings in VFO A and the return beacon on VFO B. By long pressing "2 A/B" key can quickly be switched between both configurations.
The manual gain index (attenuation) value can be chosen with UP/DOWN keys. Smaller values mean more attenuation. Use smaller values if you get closer to a transmitter.
To get even more attenuation negative gain indexes were introduced:
- -1 disables the input LNA
- -2 and -3 tune to the second/third harmonic frequency (if the radio can receive this range)
All methods give you a huge additional attenuation and can be used to prevent overdriving the receiver. Use this only close to a transmitter if the RSSI value is rising above 200. Be aware that the radiation pattern of your antenna might be different when receiving harmonics.
On system boot the device starts with active fox number 1 and full duration time left. In menu "ActFox" the active fox can be changed. The timer can be reset in menu "TiRst". Select "TiRst" with "M"-key, a triangle appears. Another press on "M"-key will reset the timer. Use this for synchronization. Active fox and timer are shown on the top in the status bar if the menu is opened.
To get a notice if the fox cycle is ending soon a beep sound can be played. The number of seconds for this tone before the ending of a fox cycle can be configured in menu "EndSig" (1..30s or "off" for no signal). Please read the headphone section before activating this feature with headphones.
This firmware supports gain remember for manual gain control. If gain remember is activated, the manual gain index is handled for every fox separately. At the beginning of a fox cycle the last gain index for this fox is restored from the last cycle. The manual gain index history table for up to 5 foxes is shown in the lower part of the screen.
If gain remember is off, there is only one gain index for all foxes independent from any fox cycle times. This feature can be configured for both VFOs separately (menu "GainRe": Off / VFO A / VFO B / BOTH).
A usage scenario would be to configure the fox frequency on VFO A with gain remember mode on. Put the return beacon frequency on VFO B without gain remember on. (The return beacon is transmitting permanently so there is no need for different gains in different time slots.)
You can quickly switch between both VFOs by long pressing "2 (A/B)" or a configured function key (see below).
If gain remember is not activated on the actual VFO or "no timing" is selected (NumFox=0), no gain index history is shown in the lower part of the screen.
The distance to the fox is calculated out of a simple model: A change of 30dB in signal strength in a forest is a factor of 10 in distance. This is only a rough model. The real signal strength highly depends on the topology of the area and can vary a lot especially in hilly areas. So don´t overestimate the predicted value.
The signal strength highly depends on the real transmitted power of the fox and the antenna at your receiver. To calibrate this combination place yourself 100m away from a transmitting fox. Choose a gain index as low as possible (preferable 0, but NOT negative!). Point your antenna directly to the fox. Watch the RSSI0 value (right from the signal strength bar, above the predicted distance) if the fox is transmitting its identifier. Enter the observed peak value in the "RSS100" menu. If the shown distance values are too low, increase the value of RSS100. If the shown distance values are too high, decrease the value of RSS100. The resolution is 0.5dB. A value of 0 disables distance prediction completely.
The microcontroller of the radio has no crystal oscillator and runs on an internal 48 MHz resonator only. So all timers in the CPU are not very precise. This leads to a heavily drifting clock.
Note
If no timing is used (e.g. in ARDF="DF Simple" mode) clock correction is not necessary.
The firmware provides a correction mechanism to reach acceptable ranges.
To find the right correction value
- Set the corretion value to 0 (menu "ClkCor")
- Start ARDF mode
- Stop how many seconds really pass until the radio tells 1 hour is up (useful settings: NumFox = 10, FoxDur = 60.00s)
The formula for the correction value is:
E.g. if the radio finished 60 one minute cycles in 59 min and 36 seconds = 59 * 60 + 36 = 3576s the calculation would be:
Enter this value in menu "ClkCor" using UP/DOWN keys (allowed range: -500 ... 500). The value is stored in eeprom.
Two different ARDF actions can be mapped to function keys:
- Set manual gain to a medium index value (4). It is recommended to configure "ARDF Set Med.Gain" to short press on F2 key, menu: F2Shrt)
- Enable/Disable ARDF function (e.g. for long press on F1 key / menu: F1Long = "ARDF off/on").
It is recommended to configure "Switch VFO" to F1 short (menu F1Shrt).
A chirp driver is shipped with every firmware release. The radio (including ARDF settings) can be programmed only with this module and not with the standard UV-K5 chirp module.
Chirp does not support separate settings for modulation and bandwidth, bandwidth is selected implicitly by the modulation. This chirp driver uses in AM mode already "narrow" bandwidth and "U1K7" (1.7kHz) for "NAM" and "USB".
- The lowest possible frequency of the receiver chip is 18 MHz. So this is NOT usable on 80 m.
- In ARDF mode any TX functionality is disabled. However it is recommended to compile with ENABLE_PREVENT_TX=1 to permanently disable TX. This is done for official releases. ARDF receivers with a builtin TX functionality are not permitted in official competitions anyway.
- You can glue an arrow on the volume knob to keep the position under control (simply cut a triangle from a sticker).
- It is possible (but not recommended because it is more complicated) to use memory mode instead of frequency mode on each VFO. If memory mode is active on the current VFO, frequency and memory number are are displayed alternately one after each other. Number keys change the memory number (enter 3 digits) and not the frequency. You can switch between memory mode and frequency mode by long pressing "3 VFO/MR" key.
- If you modify settings in memory mode don´t forget to save them before switching off (menu "ChSave").
- You can long press F/# to lock the keypad. If keypad is locked a small lock symbol in the top status bar is shown. As result in ARDF mode only manual gain control (with up/down keys) and "Switch VFO" and "ARDF Medium Gain" on the function keys is possible (if configured, see Function keys). So ARDF function is possible but no configuration changes can be done. This can be useful if preconfigured devices are handed to non experienced users. To unlock the keypad just hold F/# key.
- The gain index history is flickering.
- Disable dual watch (RxMode = MAIN ONLY).
- Only 3 digits are accepted when entering a frequency.
- The active channel is in memory mode. Long press "3 VFO MR" to change to frequency mode.
- The entered frequency is modified.
- Decrease frequency step in menu "Step" to desired channel raster (e.g. 1.00 kHz).
- Chirp does read different channel settings than in my radio.
- If you changed channel settings on the radio you have to store them first (menu "ChSave").
- Signals are all very low, antenna does not respond to rotation movement.
- Increase volume knob to 90 degree position or more.
- After activating "DF Simple" and switching back to "ARDF" mode the gain remember table is not shown.
- Reactivate Fox Timing (NumFox > 1) and Gain Remember (GainRe) for the desired VFO
Headphones can be connected to the 2.5mm jack. The audio signal is between the tip and sleeve of the jack, but there are some limitations:
Warning
There is a DC voltage of around 4V (half battery voltage) between tip and sleeve. Use a DC blocker before connecting your headphones to the device! Your headphones might be destroyed otherwise!
To make it even worse the DC voltage is switched off and on when playing signal tones (fox cycle end warning beep). This leads to voltage peaks and crackling noises in your headphones.
Use a DC blocking capacitor for removing the DC voltage from the audio signal:

Both headphone channels are connected in parallel. The needed capacity depends on your headphones. Try inline capacitor values of 0.1uF .. 10uF as a start. For my 8 ohms (2x 16 ohms parallel) headphones 1 uF works quite well.
Warning
Use cheap headphones or some you can go without only!!!
Tip
A kenwood connector with a combined 2.5 and 3.5mm plug is mechanically more stable than a single 2.5mm stereo plug.
Tip
Kenwood connectors with spiral cable can be taken from cheap external baofeng microphones.
Tip
Experienced people in SMD soldering can add the capacitor inside the device. With this modification a normal 2.5mm stereo plug to 3.5mm stereo jack adapter cable is sufficient.
Pro: Very easy and fast to build, tolerant, very good SWR, light weight, cheap.
Cons: Front to back ratio not optimal (but not bad!), radials move on boom if not secured.
| Element | Length | Position |
|---|---|---|
| Reflector | 103.9cm | 0 cm |
| Radiator | 102 cm | 30 cm |
| Director | 92,6 cm | 47 cm |
Pro: Better front to back ratio, flexible elements better when running in the fields. Standard ARDF antenna!
Cons: More complex to build, not suitable for TX because of missing adaption.
Tip: Use 2 layers of tape measure. Outer 25cm can be single layer.
| Element | Length | Position |
|---|---|---|
| Reflector | 106.5cm | 0 cm |
| Radiator | 2*47cm | 20 cm |
| Director | 90,5 cm | 52 cm |
Pro: Comfortable 3D printed solution with 16mm PCV pipe.
Cons: Pressing buttons needs 2 hands
Uses pawsay stub as balun.
Download Freecad model here.
Made out of 12mm tape measure. Designed for Draussenfuchs Project.
Pro: Very good F/B ratio, light weight (70g), cheap, foldable.
3d printed parts available here.
| Element | Length | Position |
|---|---|---|
| Reflector | 34.6 cm | 0 cm |
| Radiator | 30 cm | 12 cm |
| Director | 28 cm | 23 cm |
Made out of 3.2mm welding rods.
Pro: Quite nice F/B ratio, light weight.
Cons: Thin rods not so suitable for younger children.
| Element | Length | Position |
|---|---|---|
| Reflector | 35 cm | 0 cm |
| Radiator | 32,6 cm | 12 cm |
| Director | 30 cm | 23 cm |
3d printed mounts for tape measure elements (19mm) on 10mm aluminium u-profile. Driven simply in center of radiator. RG174 cable and M3x12mm screws.
Pro: Radio and antenna combined.
Cons: Not for TX.
| Element | Length | Position |
|---|---|---|
| Reflector | 34 cm | 0 cm |
| Radiator | 32,5 cm | 12.6 cm |
| Director | 29.5 cm | 18 cm |
3d printed mounts for electric cable elements on 10mm aluminium u-profile. Driven simply in center of radiator.
Pro: Radio and antenna combined, very light weight.
Cons: Not for TX, elements might bend.
| Element | Length | Position |
|---|---|---|
| Reflector | 38 cm | 0 cm |
| Radiator | 30 cm | 8.5 cm |
| Director | 27 cm | 14 cm |
Notes: This prototype has a switchable attenuator (approx. 25dB), this is optional. Boom is made of electrical conducting material.
2 m:
| Element | Length | Position |
|---|---|---|
| Reflector | 106 cm | 0 cm |
| Radiator | 94 cm | 20 cm |
| Director | 90 cm | 51.5 cm |
70 cm:
| Element | Length | Position |
|---|---|---|
| Reflector | 34,8 cm | 0 cm |
| Radiator | 31 cm | 14,5 cm |
| Director 1 | 30,2 cm | 19 cm |
| Director 2 | 29,8 cm | 31,5 cm |
| Director 3 | 29,2 cm | 46 cm |
- 3D printed 3 element draussenfuchs yagi by DG1JAN
- Yet Another Shitty Draussenfuchs Antenna by DN9PSC
Please note that the Quansheng UV-Kx radios are not professional quality transceivers, their performance is strictly limited. The RX front end has no track-tuned band pass filtering at all, and so are wide band/wide open to any and all signals over a large frequency range.
Using the radio in high intensity RF environments will most likely make reception anything but easy (AM mode will suffer far more than FM ever will), the receiver simply doesn't have a great dynamic range, which results in distorted AM audio with stronger RX'ed signals. There is nothing more anyone can do in firmware/software to improve that, once the RX gain adjustment I do (AM fix) reaches the hardwares limit, your AM RX audio will be all but non-existent (just like Quansheng's firmware). On the other hand, FM RX audio will/should be fine.
But, they are nice toys for the price, fun to play with.
arm-none-eabi GCC version 10.3.1 is recommended, which is the current version on Ubuntu 22.04.03 LTS. Other versions may generate a flash file that is too big. You can get an appropriate version from: https://developer.arm.com/downloads/-/gnu-rm
clang may be used but isn't fully supported. Resulting binaries may also be bigger. You can get it from: https://releases.llvm.org/download.html
- Install gcc-arm-none-eabi 10.3.1 or later
- Open Makefile
- Edit build options, save Makefile changes
- Run
makein main project folder
If everything is ok firmware.bin (unmodified) and firmware.packed.bin (obscurified for official flash tool) can be found in the main folder.
If you have docker installed you can use compile-with-docker.bat (Windows) or compile-with-docker.sh (Linux/Mac), the output files are created in compiled-firmware folder. This method gives significantly smaller binaries, I've seen differences up to 1kb, so it can fit more functionalities this way. The challenge can be (or not) installing docker itself.
- Open windows command line and run:
winget install -e -h git.git Python.Python.3.8 GnuWin32.Make winget install -e -h Arm.GnuArmEmbeddedToolchain -v "10 2021.10" - Close command line, open a new one and run:
pip install --user --upgrade pip pip install crcmod mkdir c:\projects & cd /D c:/projects git clone https://github.com/egzumer/uv-k5-firmware-custom.git - From now on you can build the firmware by going to
c:\projects\uv-k5-firmware-customand runningwin_make.bator by running a command line:cd /D c:\projects\uv-k5-firmware-custom win_make.bat - To reset the repository and pull new changes run (!!! it will delete all your changes !!!):
cd /D c:\projects\uv-k5-firmware-custom git reset --hard & git clean -fd & git pull
I've left some notes in the win_make.bat file to maybe help with stuff.
Many thanks to various people on Telegram for putting up with me during this effort and helping:
- OneOfEleven
- DualTachyon
- Mikhail
- Andrej
- Manuel
- @wagner
- @Lohtse Shar
- @Matoz
- @Davide
- @Ismo OH2FTG
- OneOfEleven
- @d1ced95
- and others I forget
- egzumer
ludwich66 - Quansheng UV-K5 Wiki
amnemonic - tools and sources of information
Copyright 2023 Dual Tachyon https://github.com/DualTachyon
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.




















