{"id":427,"date":"2025-07-12T12:54:03","date_gmt":"2025-07-12T11:54:03","guid":{"rendered":"https:\/\/ca.rstenpresser.de\/blag\/?p=427"},"modified":"2025-07-12T12:54:03","modified_gmt":"2025-07-12T11:54:03","slug":"changing-the-threshold-of-a-led-battery-indicator","status":"publish","type":"post","link":"https:\/\/ca.rstenpresser.de\/blag\/2025\/07\/changing-the-threshold-of-a-led-battery-indicator\/","title":{"rendered":"Changing the threshold of a LED-Battery indicator"},"content":{"rendered":"\n<p>A few years ago I bought some Battery indicators on Aliexpress. They are sold for different battery configurations, mine says 13.2..16.8V, so its most likely for 4S LiPo. The part apparently is called <strong>XW228DKFR4<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"314\" height=\"609\" src=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik.png\" alt=\"Aliexpress product image\" class=\"wp-image-429\" style=\"width:162px;height:auto\" srcset=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik.png 314w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik-155x300.png 155w\" sizes=\"(max-width: 314px) 100vw, 314px\" \/><\/figure>\n\n\n\n<p>But now I have a 8S LiFePo pack and want to modify it to match its voltage. LiFePo has a rather flat voltage over its state-of-charge, so most likely this will not work well. But it sure is better than no indicator. So I took a closer look so I can change the circuit to work with about double the voltage.<\/p>\n\n\n\n<p>I made a picture of the board, and traced it in KiCad.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"485\" src=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/pcb-reversing-1024x485.jpg\" alt=\"Reverse engineered PCB\" class=\"wp-image-430\" srcset=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/pcb-reversing-1024x485.jpg 1024w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/pcb-reversing-300x142.jpg 300w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/pcb-reversing-768x364.jpg 768w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/pcb-reversing.jpg 1144w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"976\" height=\"672\" src=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/sch-reversing.jpg\" alt=\"Reverse engineered Schematic\" class=\"wp-image-431\" srcset=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/sch-reversing.jpg 976w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/sch-reversing-300x207.jpg 300w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/sch-reversing-768x529.jpg 768w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><\/figure>\n\n\n\n<p>The schematic is quite simple:<\/p>\n\n\n\n<ul>\n<li>A protection diode on the input<\/li>\n\n\n\n<li>Reference-Voltage generation using a 431 type<\/li>\n\n\n\n<li>A four-tap voltage divider<\/li>\n\n\n\n<li>A quad OpAmp used as comparator<\/li>\n<\/ul>\n\n\n\n<p>So to make it work with out new voltage range, we just need to adjust the voltage divider. And because the voltage is higher, we also change the LED-Resistors and the TL431 current limiting resistor. The new values are written in pink, the original values are blue in the above schematic.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"572\" src=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik-1-1024x572.png\" alt=\"Spreadsheet resistor calculation screenshot\" class=\"wp-image-432\" srcset=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik-1-1024x572.png 1024w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik-1-300x168.png 300w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik-1-768x429.png 768w, https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/grafik-1.png 1229w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The trick to this calculation is to set the <strong>rTotalGoal <\/strong>resistor first, and then start changing the values in column B so that the <strong>Vthreshold <\/strong>matches the <strong>TargetVoltage <\/strong>as close as possible. The cell <strong>B10<\/strong> is calculated so that the sum of all the resistors is <strong>rTotalGoal<\/strong> and changing one resistor does not change the whole calculation. <\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-b68aa55b-75be-42ce-8528-464c315f3b11\" href=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/resistor-calc.ods\">resistor-calc<\/a><a href=\"https:\/\/ca.rstenpresser.de\/wp-files\/2025\/07\/resistor-calc.ods\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-b68aa55b-75be-42ce-8528-464c315f3b11\">Download<\/a><\/div>\n\n\n\n<p>I used the <a href=\"https:\/\/www.qsl.net\/in3otd\/parallr.html#\">https:\/\/www.qsl.net\/in3otd\/parallr.html#<\/a> resistor calculator to get solutions for the weird resistor values. For example 12104 is 22k||27k.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few years ago I bought some Battery indicators on Aliexpress. They are sold for different battery configurations, mine says 13.2..16.8V, so its most likely for 4S LiPo. The part apparently is called XW228DKFR4. But now I have a 8S LiFePo pack and want to modify it to match its voltage. LiFePo has a rather &hellip; <a href=\"https:\/\/ca.rstenpresser.de\/blag\/2025\/07\/changing-the-threshold-of-a-led-battery-indicator\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Changing the threshold of a LED-Battery indicator<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":430,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[168,156,47,169,81,170],"_links":{"self":[{"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/posts\/427"}],"collection":[{"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/comments?post=427"}],"version-history":[{"count":2,"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/posts\/427\/revisions"}],"predecessor-version":[{"id":435,"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/posts\/427\/revisions\/435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/media\/430"}],"wp:attachment":[{"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/media?parent=427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/categories?post=427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ca.rstenpresser.de\/blag\/wp-json\/wp\/v2\/tags?post=427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}