enter image description here

Many of battery indicator circuits are designed using 2 or more leds like in the image above but how to design a simple battery indicator circuit using only RGB LED and transistor for 12v battery indicating different voltage levels

  • 1
    \$\begingroup\$ what kind of a transistor? .... is this a school assignment? \$\endgroup\$ – jsotola Feb 26 '19 at 17:53
  • 1
    \$\begingroup\$ "How to design" is a design request. First have your proposal shown. \$\endgroup\$ – Eugene Sh. Feb 26 '19 at 17:55
  • 1
    \$\begingroup\$ You supposedly found a circuit online. What have you tried so far? \$\endgroup\$ – KingDuken Feb 26 '19 at 17:56
  • \$\begingroup\$ Any transistor,no it's not school assignment,I just want to design for My project,I had no idea how to do it \$\endgroup\$ – PRASH Feb 26 '19 at 17:58
  • 1
    \$\begingroup\$ "Wanting to try" and "having no idea" are indications that you haven't properly described your goals yet. Could you provide a circuit of your own that you believe could work? I would like to see how you're going to hook up your transistor. I think you're forcing yourself to do something you're not understanding. It's like programming. Hopefully you don't write scripts without an algorithm, right? You plan out what you need for a script. Same thing happens when you do anything in life. You've told us what you want to do but you haven't provided a way to execute your goal. \$\endgroup\$ – KingDuken Feb 26 '19 at 18:37

It would seem that the circuit you provided would light up each individual light dependent on the voltage of the battery..... The zener diodes will begin conducting at their listed zener voltages, ie- 8.2V, 9.1V, 12V, etc. The voltage leaving the anode of the zener should (sort of, IE- if you had no LED and, say, a 1MOhm resistor to ground) equal the supply voltage minus the zener voltage, ie 12.6V - 8.2V = 4.4V. The resistors are there to limit current on both the zener diode and the LED. It is an extremely crude circuit but it would work for, say, an LED bar graph. You won't be able to use this circuit to drive an RGB LED.... or, at least not in the way that they should be driven, IE- you being able to define the color of the LED, rather than having what I assume would be white light if all of the zener diodes are conducting.

You can test the circuit you provided (along with an RGB LED I included and an example 5.1V zener with ~6.9V on the anode at 12V on the cathode) at TinkerCAD. As you can see, this is certainly not a circuit you could use to drive an RGB LED, and you really shouldn't be using it to drive LEDs in general, its just an extremely crude and vague design, which seems to be an unfortunate commonality between websites that "provide electronic schematics" such as circuitdiagram.org. Sometimes there are some gems on those websites, but most of the time it's really not helpful at all and often leaves you with more questions than you had before the fact (or the circuit is flat out wrong and would probably cause a fire).

You would be better off using window comparators to determine which LED color to use, and then driving a set of MOSFETs to display that color on the RGB LED, or better yet, use an ATtiny10, which would be an absolutely perfect one chip solution for a simple LED battery voltage indicator. You will only have to use one simple resistor divider for the voltage input, compared to the arrays of dividers or voltage references you would need for the comparators. You can use one of the I/O (probably the RESET pin) as an ADC input, and the other three I/O can be used to drive the gates of small NFETs, you just have to make sure that your program works, IE- test it on an arduino uno first since you will have to turn the RESET pin on the ATtiny10 off to use it as I/O. If you need an arduino compatible core, you can use this variant of optiboot with a USBasp. There are plenty of diagrams on google that show you how to hook up a RGB LED to MOSFETS and then control them via a microcontroller, doing it through discrete hardware like comparators/OP amps is really convoluted and unnecessary for something so simple. If you lack the knowledge you need to design such a circuit, plenty of resources exist throughout the web, such as Youtube videos. electronics-tutorials.ws has some reasonably well written tutorials on the subject as well as a litany of other websites.


I use MAX17055 for battery gauge (ı don't work with MAXIM:). MAX17055 IC measure SOC,Voltage, Current etc if u use an MCU in the system it is good to use a gauge.


I offer you the following that I think you may find useful if you'd like to learn how voltage dividers and comparators work instead of diving right into microcontrollers. All of the voltage divider resistors must be 1% or better accuracy, and the potentiometers shown are minimum top of range values (you could use 250k\$\Omega\$ or 500k\$\Omega\$ trimmers for all of them, but keeping closest to these values will make it easiest to adjust.

The trimmers are cheap and necessary to achieve adequate accuracy with this method. The reference voltage trimmer is adjusted in place with a voltmeter to provide an accurate 2V. Using 2V as a reference rather than something closer to 5V means that an input voltage of 29V is required to overvoltage the 5v comparator inputs through the voltage dividers, and the automotive TVS diode should prevent this from happening.

When you receive the 1% resistors for the 4 voltage dividers, you'll have to meter their actual values and adjust the trimmer for each divider according to the instructions on the schematic so that the high side resistor+trimmer have the correct ratio with the low side resistor.

Your budget would be about the following from more reputable fast shipping in north america sources(by all means shop around for much lower prices, see schematics for component names/values):

8-1% resistors - 20c each

MCP6544 quad 5V comparator - $2

7805 drop in replacement - $2 - this is a cheap switching regulator. If you use an actual 7805, use a heatsink suitable for 20mA at an input voltage of 24V

5mm common anode rgb(2v, 3.2v, 3.2v) led - $2

5mm flashing red led - $.50

bs107p 5v gate drive mosfet -$1

A few 5 or 10% resistors for the LEDs - $1

A few 30v or higher bulk capacitors - $1

A TVS diode - $0.86

A fuse and pushbutton - $1 - Use a 50mA fuse because it's the smallest one I could find in el cheapo format.

4 single use 250k\$\Omega\$ trimmers - $4

These are all roughly what you'll pay buying single units from a reputable supplier. If you'd like to do hobby electronics you might want to buy bulk resistor/capacitor/inductor kits, and buy some things (like a few bags of el-cheapo trimmers) from a less reputable supplier(no direct datasheet links, etc). Only the comparator and 1% resistors are high spec parts. You could also build accurate voltage dividers from the sums of actual measured values of 5% resistors but using 1% resistors and trimmer pots will allow you to use a very simple circuit layout. With a >75% efficient switching regulator, this design should consume about 0.13W.

You'll need a voltmeter and a resistance meter, and you'll need to accurately adjust the voltage dividers.

The reference divider passes roughly 5v/5M\$\Omega\$=1uA current, and the other dividers pass roughly 11.6V/5M\$\Omega\$=2.32uA, more than enough to feed the pA input currents of the comparators, and low enough to be negligible compared to the LED currents.

The LED resistors are sized for 6mA current on each LED, which, if continuous on the 4 pin RGB LED is equivalent to ~18mA, about as much as you'd want to run continuously(Reduce to 5mA ea if you replace the pushbutton and do run continuously.

Rather than using window comparators, this battery meter uses a separate red flashing LED to show <20%, and energises R, then R+G, then R+G+B as the voltage goes up, giving actual output colors of red, yellow, white for 20-50%, 50-90%, >90% charge. This allows the use of a cheap(ish) extremely easy to use "rail to rail push-pull TTL" 10mA through-hole quad comparator. The search terms in quotes are key for the easy to use part.

Disclaimer, I'm not an engineer, but this is something you should be able to breadboard and fully understand how it works. The voltage dividers, as their name would indicate, split voltages up in ratios proportional to the resistance of the resistors they are made of, and the comparators perform a comparison of voltages, outputting 5V(true) if the voltage on the + terminal is higher than that on the - terminal, otherwise 0V. COMPRF and COMPR check below and above the lowest voltage threshold, COMPG checks above the middle voltage threshold and COMPB checks above the highest voltage threshold. All you need from the 5V regulator is a very steady 5V output at a decent efficiency so your 2V reference will stay the same over the 20mA output range you're using.

You could add a few 5V cmos logic gates between the comparators and mosfets to get window comparators and a more particular color scheme like red/orange/yellow/green/blue or something. Using mosfets instead of transistors lets you bypass some resistor calculations, and shouldn't be a problem since you're switching tiny currents and not very often.

You'd have to do your own shopping, but this is everything you'd need to know to build this project. If you wish I can add the math for choosing voltage divider resistors and trimmer pots to ensure the correct voltage can be sensed.


simulate this circuit – Schematic created using CircuitLab


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.