[Open Source Firmware] FRME-PM-01A Coulomb Meter + Power Meter Firmware Recreation: OpenPM01 — libopencm3, a pure open-source technology stack.
Background
Those who power their shortwave radios with server power supplies or 13.8V lithium iron phosphate batteries should be familiar with the FRME-PM-01A – a two-way XT60, screen-equipped open-source current meter that is well-regarded in the community.
For ham, the basic functionality is sufficient. However, when I use a 4S phosphate iron lithium battery myself, I always wanted an energy display – otherwise, I would have to manually measure the voltage and estimate it on my own, which is quite inconvenient. Fortunately, I also saw someone asking in the comments section of oshwhub if it was possible to add a coulomb counter function. So I thought about writing my own firmware.
Unfortunately, the original firmware was not open-source. Since I want to write it myself, I'll switch to a completely free software stack: PlatformIO + libopencm3. This will eliminate any dependencies on ST's HAL and any proprietary blobs.
Thus, we have... OpenPM01。
Actual demonstration

IC-718 shortwave radio transmitting on FT8

Battery charging
Design Concept
Coulomb meter + Ammeter
In addition to the existing voltage/current/temperature and humidity values, we have added:
- Software comparison tool: Perform numerical integration on the current, accumulating in mAh/Ah.
- Energy meter: The voltage meter estimates the State of Charge (SOC), displayed as a progress bar in the CHARGE section (does not take up space and can be viewed or hidden as needed).
Obstacle)
To be honest, this power meter.Not precise— The differences between various battery chemical systems are significant. Furthermore, there is no EEPROM or similar storage device on the hardware side, making it impossible to save cumulative values or perform power calibration. Therefore, it can only rely on a lookup table for estimation. However, this is sufficient for everyday scenarios such as "how much battery life remains and whether to charge."
Currently, I have only written... 4S Lithium Iron Phosphate The lookup curve (the most common configuration for a Ham radio), and other battery types (3S/6S lithium batteries, lead-acid batteries, etc.) are not yet implemented. Add the code to do so. #else if To fix this issue, simply run a diff check. Feel free to submit your pull request.
Refresh rate & Scheduling
The original firmware update rate was very slow; I suspect that all the logic was being crammed into it. main() Inside use delay() It requires a high sampling/refresh rate. However, both the Coulomb integral and instantaneous power display require relatively high frequencies, and the STM32F103's main clock frequency is sufficient. Therefore, I designed a simple, non-preemptive cooperative scheduler.
Each task is triggered independently based on its own cycle, without blocking others. This results in improved accuracy of the Coulomb integration, and also allows for a higher refresh rate – the changes in voltage, current, and power readings are now more visibly smooth to the eye.
Alarm display
The alerts for over-pressure, over-current, and temperature limits were originally displayed in a small area next to the main screen. I have changed this to:Highlight and flash directly in the display box corresponding to the value.More prominent, as shown below.


Example: Low Voltage/Low Battery Warning
UI and Color Palette
The UI layout has been redesigned to improve space utilization. Added a convenient feature. Catppuccin Four color schemes (Mocha / Macchiato / Frappe / Latte, three dark and one bright), with the ability to expand by adding a new color palette in the code. Also, I have done...Four orientations(Portrait/180° portrait rotation/Landscape/Landscape rotation), compile options control, for convenient installation methods with different cases. See specific images on Github.
Build & Burn
Requires PlatformIO:
# Modify build options in platformio.ini
platformio run
platformio run --target upload
The orientation and color scheme are determined by build_flags Choose compilation options, and battery profiles are similar (default: 4S phosphate iron lithium).- DNO_BATTERY The power meter function can be completely disabled.
GitHub releasesThe page provides pre-compiled HEX files that users can flash themselves.
Burn
The PCB has SWD pins, so you don't need to solder jumper wires. Simply insert the jumper wires and press them down with your hand.



Statement
The hardware for FRME-PM-01A was designed by @FrostAutumn and is released under the CC-BY-NC-SA 3.0 license.This document is an independent project and has no affiliation with the original manufacturer; it is not endorsed by them.It also does not reference the original firmware (which is not open source). The firmware itself is based on GNU GPLv3, which allows for free use (including commercial use). However, if you plan to create derivative products, the hardware part still needs to comply with the original author's CC-BY-NC-SA terms.
Reliance & Acknowledgments
| Components | Author | Agreement |
| stm32f1_st7789_spi | Avra Mitra | MIT |
| INA226 library | Rob Tillaart | MIT |
| SHT30 library | LibDriver | MIT |
| libopencm3 | libopencm3 project | LGPLv3 |
| Caskaydia Cove (a fork of Cascadia Code) | Eli Heuer / Microsoft | SIL OFL 1.1 |
Warehouse
GNU GPLv3 open source, welcome to fork, contribute, or provide feedback. Currently, only the 4S phosphate iron lithium battery capacity meter has been implemented. We especially welcome contributions for table curves of other battery types.
Warehouse address:https://github.com/sophiel-meow/OpenPM01
Pre-compiled firmware:https://github.com/sophiel-meow/OpenPM01/releases
Hey, if you have a board, please let us know your feedback after testing it!