r/18650masterrace • • 29d ago

I got live data out of the cheap 18650-4CHN tester without touching the firmware (SWD + a $5 WCH-Link)

I have one of those 4-slot 18650 testers with the color screen (sold as 18650-4CHN / BT4-4CHN-18650). It works fine, but it has no data port, so logging a capacity test meant writing numbers down by hand.

Turns out the MCU (Cortex-M0+, almost certainly a Puya PY32F040, the marking is sanded off) has its SWD pins on a little header labelled ISP under the board. With a WCH-Link switched to CMSIS-DAP mode and pyOCD you can attach to it while it runs, without halting it, and just read RAM.

All four slots live in one struct in SRAM: state, elapsed time, mAh, mWh, internal resistance, a presence flag. There's also a separate ADC buffer that updates all four voltages continuously. The voltage the screen shows is only refreshed for whichever slot is selected, which confused me for a while.

Fun bit: two floats in each slot looked like random voltages. If you assume they're the no-load / loaded voltages from the resistance test, the math gives a load of about 3.9 ohm on all four channels. Then I flipped the board: the discharge resistors are marked 6W3R9J. 3.9 ohm.

Current isn't stored anywhere I could find, so it's estimated from the mAh counter. The tool labels every value as direct, estimated or experimental, so you know what you're looking at.

I turned it into a small Python tool: a terminal monitor, CSV/JSONL recording, and a local WebSocket stream if you want to plug it into Home Assistant, a web page or whatever. It's strictly read-only: it never writes to the chip, never resets it, and the charger stays in charge of the cells.

Repo: https://github.com/Pupariaa/18650-4CHN-SWD-Monitor

Only tested on my unit, one firmware version, Windows. If you have one of these (or a lookalike) and a CMSIS-DAP probe, I'd love a capture to see if the layout is the same. The tool has a record mode that only saves the bytes it reads.

92 Upvotes

20 comments sorted by

14

u/CesiumSalami 29d ago

That’s amazing! I didn’t even think about this. I’d love to integrate this into an ESP32 or something so i could have a local dashboard instead of having to check the screens.

2

u/enygmatique 10d ago

Thanks! An ESP32 would actually be a pretty cool way to do it. Having all your testers connected over Wi-Fi and accessible from a single dashboard would be so much nicer than constantly checking those tiny screens haha.

If you ever give it a shot, I'd love to see what you come up with!

6

u/frobnosticus 29d ago

Okay THAT'S funky!

Guess I'm gonna buy two of these. (There being a 100% chance I'll screw one up.)

2

u/enygmatique 10d ago

That's the unofficial rule of electronics: buy one to destroy, one to experiment with, and one that actually works. 😂

1

u/frobnosticus 10d ago

Heh. And even that can be optimistic at times :)

3

u/neuromonkey 28d ago

I just said the same thing. This time I ordered three of something, and it was damned good that I did!

2

u/frobnosticus 28d ago

Heh. Yeah I've met me. The first one will explode or something.

3

u/BenchZero 28d ago

Great job. I've one of these testers. Gonna save this to try out later. Thanks :)

1

u/enygmatique 10d ago

Thanks! I've actually made quite a bit of progress since this post, including a custom USB-C PCB. If you ever give it a try and run into any issues, feel free to reach out! :)
https://www.reddit.com/r/18650masterrace/comments/1y39i3y/from_a_5_wchlink_hack_to_a_custom_usbc_pcb_for/

3

u/kr0m 28d ago

That's a cool proj, well done!

Slightly off-topic -- are there any similar testers that have higher max discharge current? This one seems to be only 1A.

1

u/enygmatique 10d ago

Thanks! Yeah, unfortunately this one is limited to around 1A per channel.

You could look into something like the ATORCH DL24, which supports up to 20A of adjustable discharge current, although it's a single-channel electronic load rather than an all-in-one charger/tester.

I haven't really looked into higher-current multi-channel testers yet. What kind of discharge current are you looking for?

1

u/kr0m 9d ago

Yeah I run atorch for this stuff but boy it's slooow bc just one cell per run

Oh well

1

u/enygmatique 13d ago

Quick update! I've taken this project a step further and designed a dedicated USB-C PCB with a CH552G and custom firmware! 😄

I'm planning to release everything as open source once it's polished.

Here's the new post with some pictures: https://www.reddit.com/r/18650masterrace/s/TafhKhiHHq

-2

u/habichtfreak 29d ago

Diese Teile sind nicht zum erstellen von Messungen geeignet. Beispiel: gestern hatte ich Tenpower 60XG drin (ich habe die Variante mit 2x 18650 und 2x 21700). Entladen wurde bis 2,5V. Gemessen wurde bei mehrere Durchläufen weniger als 5800 mAh. Was will man mit diesen Daten eines Schätzeisens??? Auch die Messung des Innenwiderstands ist sehr ungenau.

1

u/enygmatique 10d ago

Well, it's a cheap battery tester, not a calibrated laboratory instrument. I never claimed otherwise. 😅

The point of this project is to extract data from an inexpensive device that wasn't designed to provide it in the first place.

Even if the absolute accuracy isn't great, having repeatable measurements under the same conditions is still useful for sorting and comparing salvaged cells, identifying weak ones and tracking their degradation over time.

And having access to the raw data actually gives us more opportunities to investigate measurement errors and potentially compensate for them.

Not everything needs to be laboratory-grade to be useful, and reverse engineering cheap hardware is also just fun in itself.

3

u/mfsamuel 29d ago

I just got one of these from aliexpress. I guess I am taking it apart to play with your tool now.

3

u/SinoSoul 28d ago

Phrasing!

1

u/mfsamuel 28d ago

🤦I should know better.

1

u/neuromonkey 28d ago

Okay, you know what you do? You buy yourself a tape recorder, and you just record yourself for a whole day.

1

u/alphadom4u 28d ago

I don't blame you! My man just put his Python out there for the whole world to play with. I want to play with it too, but I'm at work, so all I can do right now is just look at it.