stm8ef icon indicating copy to clipboard operation
stm8ef copied to clipboard

ZB2L3 Battery Capacity Tester

Open TG9541 opened this issue 5 years ago • 35 comments

Yes the link you showed is the exact tester. I have 3 of them and use them to validate battery capacity of NiMH as well as my 18650's. I see this as a useful tool 3 buttons, 4 digit LED plus current sense. After seeing this forum, I desoldered the display hiding underneath it was the stm8s along with a TM1650 LED controller. Also hidden by the picture is what appears to be swim connections. I have not had time to further analyse it, but may do that in the future. I just don't have enough time and to many hobbies. Added a pic and noticed that silkscreen on the board states ZB2L3 on my other two that I purchased. hw-586 @VK6TT

Originally posted by @suskitech in https://github.com/TG9541/stm8ef/issues/247#issuecomment-453892683

TG9541 avatar Jan 14 '19 05:01 TG9541

@suskitech: This board looks interesting - thanks for letting us (and others) having a peek under the LED display!

I guess that the 321 on the silkscreen near the SOT23-5 chip is a generic single OP-AMP. The 8205 might be a Dual N-Channel logic enhancement mode power FET. For the TM1650 I couldn't find a datasheet - I found one e for the TM1651 and there is example code on TM1650 on GitHub.

I'll do the same surgery with my board. Let's see what else it's good for.

TG9541 avatar Jan 14 '19 05:01 TG9541

Here's a non-English one which is surprisingly clear on what is happening. It appears to be quite different than the TM1650. I couldn't find another source for this part to see if that manufacturer had an easier to read datasheet.

Thomas, I think you're right regarding the other parts. The only thing to watch out for is the regulator. I tested 10 of the 5 volt versions of these on W1209 boards recently. Half let out smoke at 15.6 volts applied to the power connector.

It still looks very appealing.

Regards Richard


From: Thomas [mailto:[email protected]] Sent: Monday, 14 January 2019 1:59 PM To: TG9541/stm8ef Cc: Richard; Mention Subject: Re: [TG9541/stm8ef] ZB2L3 Battery Capacity Tester (#248)

@suskitech https://github.com/suskitech : This board looks interesting - thanks for letting us (and others) having a peek under the LED display!

I guess that the 321 on the silkscreen near the SOT23-5 chip is a generic single http://www.ti.com/lit/ds/symlink/lm321.pdf OP-AMP. The 8205 might be a Dual N-Channel logic enhancement mode power FET https://www.ait-ic.com/uploads/2011-01/05/_1294200000_5amsl7.pdf . For the TM1650 I couldn't find a datasheet - I found one e for the TM1651 <http://aitendo3.sakura.ne.jp/aitendo_data/product_img/ic/LED-driver/TM1651_ %20V1.2/TM1651_V1.1_EN.pdf> and there is example code on TM1650 on GitHub.

I'll do the same surgery with my board. Let's see what else it's good for.

You are receiving this because you were mentioned. Reply to this email directly, view https://github.com/TG9541/stm8ef/issues/248#issuecomment-453908065 it on GitHub, or mute <https://github.com/notifications/unsubscribe-auth/AT7ya_NVqrxmVvKy2z-dHqmnc 2FX-7fJks5vDBysgaJpZM4Z9o3J> the thread. <https://github.com/notifications/beacon/AT7ya3NC8FBNdU5M0Wwris2NLVQWwhfAks5 vDBysgaJpZM4Z9o3J.gif>

VK6TT avatar Jan 14 '19 10:01 VK6TT

@VK6TT saw to it that I got a new ZB2L3 in my mailbox. The first thing I did was to remove the LED display:

20190203_080919

My specimen has a Nuvoton chip (which was designed to be pin compatible to the STM8S003F3P6 and it's an open question if STMicroelectronics compete on the price - Nuvoton certainly does, and it won't go away).

Did anybody trace PD1/SWIM?

TG9541 avatar Feb 03 '19 07:02 TG9541

Man that is to bad. I ordered 4 more battery testers in hopes that it would still have the STM8 in them.

I have traced everything on the board, but did not have a chance to put it in nice format. Here is what I do have:

STM8S003F3P6 Signals
Pin	STM	Connected to
1	PD4	<-> TM1650 3 SDA
2	PD5	
3	PD6
4	NRST <- (ICP header pin 3)
5	PA1
6	PA2
7	VSS	GND
8	VCAP 105 capacitor to GND
9	VDD
10	PA3	-> LT8205 N-Channel MOSFET pins 6 and 4 (gates) 
11	PB5	-> A LED
12	PB4	-> Ah LED
13	PC3	-> V LED
14	PC4/AIN4	<- V+ in 10k/51K ratio plus .06V
15	PC5	<- OK switch closes to GND 104 cap debounce
16	PC6	<- + switch closes to GND 104 cap debounce
17	PC7	<- - switch closes to GND 104 cap debounce
18	PD1/SWIM <-> (ICP header pin 2)
19	PD2/AIN3 <- LM 321 OpAmp
20	PD3/AIN4 -> TM1650 2 SCL

I numbered the head pins left to right while reference the board in its nor usable orientation.

1 VCC (left pad only)
2 SWIM
3 NRST
4 GND (right pad only)

I also see that the version you received came with an ET6226M for the display driver instead the Titan Micro Electronics TM1650A, which has drivers in the Arduino environment.

I have to admit that the research I did on the Nuvoton showed qty 1000 pricing of $.25US vs around $.75US so with that kind of cost difference we will see more and more of this transition. There are a few tutorials that discuss programming these, but I just don't have time to learn another CPU.

suskitech avatar Feb 03 '19 08:02 suskitech

The LED driver chip on the new board is an ET6226M

The chip is pin compatible with the TM1650

Here is a Google translation of the functional register description:


ET6226 Control Program Format The ET6226 control program format is shown in the figure below.

The instruction shown below is SYSON. Start 0 1 0 0 1 0 0 0 Ack 0 0 0 0 0 0 0 1 Ack Stop

The specific control instructions are shown in the table below.

High 8 bits low 8 bits function
48 00 Off display
48 01 On display (eight-segment mode)
48 09 Turn on display (seven-segment mode)
48 04 Turn on sleep
48 X1 Turn on the display, keyboard, X-level brightness X=1, first-level brightness; X=4, four-level brightness; X=0, eight-level brightness, the rest
68 XX digital tube position 0 display, XX is 8 bits of data, the highest position is punctuation
6A XX digital tube position 1 display, XX is 8 bits of data, the highest position is punctuation
6C XX digital tube position 2 display, XX is 8 bits of data, the highest position is punctuation
6E XX digital tube position 3 display, XX is 8 bits of data, the highest position is punctuation
4F Get button, return button code

The Control Register description is sketchy but it appears to be consistent with the more detailed description in the TM1650 datasheet:

  MSB LSB  
  B7 B6 B5 B4 B3 B2 B1 B0 Function Description
  ×  0  0  0  -  ×  ×  -  Brightness setting 8 levels of brightness
  ×  0  0  1  -  ×  ×  -  1 level brightness
  ×  0  1  0  -  ×  ×  -  2 brightness
  ×  0  1  1  -  ×  ×  -  3 levels of brightness
  ×  1  0  0  -  ×  ×  -  4 brightness
  ×  1  0  1  -  ×  ×  -  5 brightness
  ×  1  1  0  -  ×  ×  -  6 brightness
  ×  1  1  1  -  ×  ×  -  7 brightness
  ×  -  -  -  0  ×  ×  -  7/8 segment display control bit 8-segment display mode
  ×  -  -  -  1  ×  ×  -  7-segment display mode
  ×  -  -  -  -  ×  ×  0  Turns the display bit on/off off
  ×  -  -  -  -  ×  ×  1  on display

TG9541 avatar Feb 03 '19 08:02 TG9541

@suskitech thanks for the pin description! I inserted some Markdown formatting, I hope you don't mind :-).

The good news is that PD1/SWIM can be used as a communications interface just like that. An interesting observation: these guys didn't even bother to use the I2C GPIOs PB4 and PB5.

TG9541 avatar Feb 03 '19 08:02 TG9541

I appreciate the reformatting please feel free to do so anytime. It was after midnight my time and did not want you to have duplicate my effort tracing the pins. I am new to GitHub and formatting with markdown code is another thing I need to look into. We need a cheap source of STM8S103 chips. I can get them for about $1 each on eBay, but most of the China and HK vendors are on vacation until Feb 11 celebrating their New Year.

suskitech avatar Feb 03 '19 17:02 suskitech

The best price for an STM8Sx03F3P6 I've seen in a while is $0.32@10pcs. I guess it's best to order some now, they won't go bad :-) Sometimes STM8S103F3P6 breakout boards are cheaper than single STM8S003F3P6 chips.

On the other side, I think that we all have at least one board with an STM8 chip, and unless you're really in a hurry, it will take some time until the board is fully supported.

TG9541 avatar Feb 03 '19 17:02 TG9541

I made a start by flashing the SWIMCOM binary to a ZB2L3 board - I'm trying to use M.Mahlows VOC-I2C demo in the examples folder. So far, I still get the error message I2C: ACK missing?. Maybe there are no pull-up resistors and I need to set internal pull-ups and the proper GPIO mode?

TG9541 avatar Feb 03 '19 19:02 TG9541

Hi Thomas,

I had huge issues getting I2C working. My solution is shown below and it might help you.

: I.tx ( byte -- ) \ Send a byte to the I2C Bus. DUP 7 FOR $80 AND IF SDA1 ELSE SDA0 THEN SCL1 2* DUP SCL0 NEXT 2DROP SDA1 \ **** guess fix by earlier SDA1 ?I.ACK ;

Not so much as a guess, since the logic analyser showed there was a timing issue. The guess was where to pull SDA high.

Regards Richard


From: Thomas [mailto:[email protected]] Sent: Monday, 4 February 2019 3:32 AM To: TG9541/stm8ef Cc: Richard; Mention Subject: Re: [TG9541/stm8ef] ZB2L3 Battery Capacity Tester (#248)

I made a start by flashing the SWIMCOM binary to a ZB2L3 board - I'm trying to use M.Mahlows VOC-I2C demo in the examples folder. So far, I still get the error message I2C: ACK missing?. Maybe there are no pull-up resistors and I need to set internal pull-ups and the proper GPIO mode?

You are receiving this because you were mentioned. Reply to this email directly, view https://github.com/TG9541/stm8ef/issues/248#issuecomment-460080784 it on GitHub, or mute <https://github.com/notifications/unsubscribe-auth/AT7ya4YxFjT77MmlBxcGs1SHj 4Wn9spMks5vJzlBgaJpZM4Z9o3J> the thread. <https://github.com/notifications/beacon/AT7yawGAwLH4t37H5Tavo9j6Je3toOoeks5 vJzlBgaJpZM4Z9o3J.gif>

VK6TT avatar Feb 04 '19 00:02 VK6TT

I gave up on flea market style sourcing when I found this https://lcsc.com/product-detail/ST-Microelectronics_STMicroelectronics_STM8S 003F3P6_STM8S003F3P6_C18615.html

I use LCSC for some of my business sourcing and I have been very happy. But I still watch the flea market wit great interest. Can't help myself!


From: Allen Suski [mailto:[email protected]] Sent: Monday, 4 February 2019 1:01 AM To: TG9541/stm8ef Cc: Richard; Mention Subject: Re: [TG9541/stm8ef] ZB2L3 Battery Capacity Tester (#248)

I appreciate the reformatting and it was after midnight my time and did not want you to duplicate effort. Thanks for the clean up feel free anytime. I am new to GitHub and formatting with markdown code is another thing I need to look into. We need a cheap source of STM8S103 chips. I can get them for about $1 each on eBay, but most of the China and HK vendors are on vacation until Feb 11 celebrating their New Year.

You are receiving this because you were mentioned. Reply to this email directly, view https://github.com/TG9541/stm8ef/issues/248#issuecomment-460068660 it on GitHub, or mute <https://github.com/notifications/unsubscribe-auth/AT7ya3CuNZqz1Ag87A3pV0rIP pDVfuXaks5vJxXKgaJpZM4Z9o3J> the thread. <https://github.com/notifications/beacon/AT7ya-DMI14FSCN0HGitqKaN9iRMqCUnks5 vJxXKgaJpZM4Z9o3J.gif>

VK6TT avatar Feb 04 '19 01:02 VK6TT

I ordered 10 pieces last October and paid CDN$5.56 including shipping. The same vendor is only CDN$4.42 today including shipping https://www.aliexpress.com/item/Free-Shipping-10pcs-lots-8S003F3P6-STM8S003F3P6-TSSOP-20-New-original-IC-In-stock/32919745220.html?spm=a2g0s.9042311.0.0.99794c4dgWvW62. The site Thomas quoted above is right now CDN$8.51 including shipping. The shipping is slow, 70-90 days to Canada, but if you are not in a rush...

paulcrawford avatar Feb 04 '19 04:02 paulcrawford

@VK6TT Richard, thanks for the code! In the far past I wrote several bit-banged I2C interfaces that were used at industrial scale, and I also learned quickly that timing is critical.

LCSC looks interesting (e.g. STM8S003F3P6 for 0.285 @10pcs) but they add $3 for handling and at least $5 for shipping... I agree that if one's business depends on the delivery that's a small price to pay.

TG9541 avatar Feb 04 '19 06:02 TG9541

Greetings! 1st, I found this great video on how it works (analog part). 2nd, TM1650 datasheet is found on the vendor site.

ildar avatar Oct 29 '19 06:10 ildar

@ildar thanks for reviving the discussion! The video is indeed very useful. Maybe I'll find some time working on this during the winter break - if you'd be willing to push support for this board I'd be willing to provide support.

TG9541 avatar Oct 29 '19 07:10 TG9541

Unfortunately my device came with some other MCU, I'll post photos later

ildar avatar Oct 29 '19 07:10 ildar

Can somebody provide the soft to calibrate this tester please?? it seams that the IC lost the stuff, so when I plug it now, the 3 led blink and device turn off, so maybe I need to re upload the soft/code to the IC?? Thx for any help

DrSaad77 avatar Apr 16 '20 08:04 DrSaad77

https://lmgtfy.com/?q=ZB2L3+calibration

ildar avatar Apr 16 '20 09:04 ildar

@ildar I didn't quite manage to get to it during the winter break, sorry

TG9541 avatar Apr 16 '20 15:04 TG9541

Has anyone worked out how to read data from the SWIM port to log the data from the ZB2L3?

ddodge40 avatar May 13 '22 23:05 ddodge40

@ddodge40 I'm still waiting for someone to write some specs:

  • what do you expect the board to do so that a replacement software can be designed
  • be inventive, e.g., remember that you don't need the buttons to control all of the behavior if it can be done with a script
  • what kind of data do you expect to receive

TG9541 avatar May 14 '22 07:05 TG9541

I would like to grab the data as it comes in and also the final reading. Adding time to a file is easy. I saw on a blog that it is a ST processor, but would need to know where the readings are stored. There was a post about some software being available, but no info as to where to get it Thanks

Don Dodge Cell 714-271-7888 W6SNX

On May 14, 2022, at 12:37 AM, Thomas @.***> wrote:

 @ddodge40 I'm still waiting for someone to write some specs:

what do you expect the board to do so that a replacement software can be designed be inventive, e.g., remember that you don't need the buttons to control all of the behavior if it can be done with a script what kind of data do you expect to receive — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

ddodge40 avatar May 14 '22 15:05 ddodge40

@ddodge40 what you've described is the use case, not the specs of a software so that it can be designed. Unfortunately, I can't do the reverse engineering of the original firmware. Someone else will have to do that :-)

TG9541 avatar May 14 '22 17:05 TG9541

I have asked HiLetgo and other sellers for the software and only HiLetgo have responded that they are looking for itThanks 

Sent from the all new AOL app for iOS

On Saturday, May 14, 2022, 10:19 AM, Thomas @.***> wrote:

@ddodge40 what you've described is the use case, not the specs of a software so that it can be designed. Unfortunately, I can't do the reverse engineering of the original firmware. Someone else will have to do that :-)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

ddodge40 avatar May 14 '22 17:05 ddodge40

Yes the link you showed is the exact tester. I have 3 of them and use them to validate battery capacity of NiMH as well as my 18650's. I see this as a useful tool 3 buttons, 4 digit LED plus current sense. After seeing this forum, I desoldered the display hiding underneath it was the stm8s along with a TM1650 LED controller. Also hidden by the picture is what appears to be swim connections. I have not had time to further analyse it, but may do that in the future. I just don't have enough time and to many hobbies. Added a pic and noticed that silkscreen on the board states ZB2L3 on my other two that I purchased. hw-586 @VK6TT

Originally posted by @suskitech in #247 (comment)

Which load do you use to test your NiMH?

FBMinis avatar Jan 17 '23 18:01 FBMinis

I bought this board recently but he micro USB port broke off after very limited use and I was unable to re-attach it. I identified tat I could power the board by soldering a severed USB cable's + and - wires directly to two exposed solder points on the rear of the board. It works fine but it will not allow me to enter calibration mode, which would normally be achieved by pressing and holding the three micro-switches while powering up the board. It would seem that the physical insertion of a micro USB male to the original port provides an additional trigger to initialise the calibration function. Can anyone suggest a way of entering calibration while the unit is being powered in my unconventional way?

wolf-t-me avatar Jun 24 '23 00:06 wolf-t-me

it's now others mcu and other pinout ft61f135-rb The era of quick and easy modification of ready-made devices is history

IMG_20231007_210807_edit_331079661148959

selevo avatar Oct 11 '23 14:10 selevo

Have one and checked the calibration and it is within 5%. Not bad for an inexpensive tester.  I use it for a few 12 volt batteries removed from FIOS service. Even 5 year old text at about 50% of original Don DodgeCell 714-271-7888W6SNXOn Oct 11, 2023, at 7:26 AM, Serega @.***> wrote: it's now others mcu ft61f135-rb

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

ddodge40 avatar Oct 11 '23 14:10 ddodge40

it's now others mcu and other pinout ft61f135-rb

Here is FT61F13X datasheet - the device appears to be PIC16-like and it has just 3K words ROM and 256 bytes. That's what I call "old school" and "frugal".

The era of quick and easy modification of ready-made devices is history

Yes, that appears to be the case.

TG9541 avatar Oct 11 '23 18:10 TG9541

it's now others mcu and other pinout ft61f135-rb The era of quick and easy modification of ready-made devices is history

IMG_20231007_210807_edit_331079661148959

I have this new version 3.0 of the HW-586, it does not enter calibration mode using the method used in older versions, which is to press the three buttons simultaneously and connect the power to USB, has anyone found out if they changed the method for entering calibration mode Or if in this v3.0 there is no way to enter calibration mode ???

I will be very happy and grateful if anyone can help !!!

Thanks Edward

dumaster avatar Jan 18 '24 07:01 dumaster