Fancy 12V car battery level indicator

Discussion in 'Power Electronics' started by garynobles, Jul 4, 2013.

1. garynobles

10
0
Jul 4, 2013
Hi, I have been trying to design a circuit to monitor my 12V leisure car battery, I'm thinking this should be fairly simple, but its been years since I did any real electronics.

So the basic idea: Use the circular bargraph to indicate the level of the battery when a momentary push button is pressed
the circular LED bar graph: https://www.sparkfun.com/products/11492

So the range of the battery would be something like 10.5V to 13.5V, there are 32 LEDs in pairs, so essentially 16.

1. So if we take the first LED pair, this should illuminate when less than 10.5V, so that should be easy, as long as there is some life in the battery it should illuminate

2. The next LED should only illuminate at the next step, 16 LEDs, 3V range 16/3= steps of 0.2V So at the following steps:
10.5, 10.7, 10.9, 11.1, 11.3, 11.5, 11.7, 11.9, 12.1, 12.3, 12.5, 12.7, 12.9, 13.1, 13.3, 13.5.
So for 10.7V I guess I should use resistor before each LED.

3. The LEDs should light up after a momentary push switch is triggered, I would like this to be graceful, so the ring lights up smoothly one LED at a time as the voltage increases, I guess capacitors between the resistors and LEDs?

This is the simplest way I can think of doing it, I have seen circuits which use a LM339 chip, but that can only monitor 4 voltages, perhaps 4 of these in series could do the job? http://www.electroschematics.com/7068/lm339-lm239-lm2901-datasheet/ I think this is the way to go rather than using inline resistor/ capacitor pairs?

So I am a clear novice when it comes to electronics (but I'm enthusiastic), so if anyone can help me with this I would be more than happy to put together a how to so others can copy/develop it, something similar has been done before: http://www.instructables.com/id/Car-battery-tester/
In that example only one bar is lit, I want the other bars to stay lit.
I can use Eagle to make the PCB diagram and get it printed, but I need to figure out what components I need and how to do it!

Thanks for any help.

Gary

Last edited: Jul 4, 2013
2. davennModerator

13,782
1,934
Sep 5, 2009
hi Gary
welcome to the Electronics Point forums

Im thinking it may be a bit difficult to do such fine resolution as that and still be accurate
is that sort of stepping really needed ?

thats just the difference between using the chip in DOT or BAR mode

Dave

3. garynobles

10
0
Jul 4, 2013

Well, this is a battery status indicator, so jumps of 0.2v or thereabouts as I have 16 LED positions, otherwise some LEDs would never be used.

With more searching I have discovered the LM3914. This can cope with 10 LEDs, so I am 6 short, perhaps 2 LM3914 chips?

A few resistors and potentiometers are needed, I have found a similar post here: http://www.electro-tech-online.com/...gn-ideas-reviews/108340-lm3914-voltmeter.html

Thanks again

4. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,480
2,827
Jan 21, 2010
Have a look at the LM3914. It does 10 LEDs, but you can cascade them. As long as your gaps are regular, you can do it with this chip.

Expanded scale voltmeters made with these were one of the frequent applications (in fact I think the datasheet contains the circuit for one)

5. garynobles

10
0
Jul 4, 2013

Attached is a partial circuit, I got stuck.

So I've gone with the LM3914 IC set to Bar mode (pin 9)
On the wiring diagram I saw the LEDs were connected cathode to anode from the IC, with this ring LED setup they share 4 common cathodes, so how do I get around this?

I am returning to electronics after 15 years and a very bad teacher, so I'm learning as I go, any obvious problems?
The capacitors are going to be used to create a fade out effect, I guess this is where they should go?
You will notice I have only concentrated on the right side LEDS, I will use a second IC for them once I have this side working.

Thanks for any input

Gary

6. davennModerator

13,782
1,934
Sep 5, 2009
not sure what you mean by "sharing 4 common cathodes" ?

you actually have the LED's reversed and the anodes should be commoned and going to +V

from memory the outputs of the 3914 are current sinks rather than current sources
that is ... current is supplied via the +V rail through the LED and through the collector emitter junction to ground within the chip for that output pin

Dave

Last edited: Jul 5, 2013
7. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,480
2,827
Jan 21, 2010
Bar mode is OK, but the current requirements can get large when you have the entire bar on. You can also run into package dissipation limits too..

Pretty much, you don't. If you can't wire the LEDs the way you need to, then something is going to have to change.

In your case, the diodes have a common cathode. A common anode would be great, so you're faced with the complete opposite.

You could use a transistor on each output to invert the signal and use it to drive the LEDs, but then the circuit starts to get needlessly complex.

Can you use some other LEDs?

Another approach is to use a micro-controller to sample the input voltage and to control the LEDs directly. This has some complexities (5V supply required, protection for the ADC input, level shifting, programming) that meant I did not recommend it previously, but you can make it work with your LEDs.

I guess the main one is that you need to determine if your design is feasible before you go into great detail with it.

It is good that you stopped as soon as you encountered the LED issue.

You'll have to describe the fade out effect you're after, but I'm pretty certain that capacitors there will not be the solution.

Last edited: Jul 5, 2013
8. davennModerator

13,782
1,934
Sep 5, 2009
Steve,
that diode ring as shown in his first link is common anode so not a problem

its just that he as drawn them incorrectly in his diagram

Dave

9. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,480
2,827
Jan 21, 2010
True, the schematic you've drawn Gary has the LEDs around the wrong way.

The LEDs in the device you've linked to are common anode, which is just what you want (and not what you've drawn).

10. garynobles

10
0
Jul 4, 2013
The LED diagram should be right as it is from the retailer, they provide the eagle libraries.
https://www.sparkfun.com/products/11492

so for now if we ignore the fade effect, can this LED setup be controlled per LED? Or do I have to have a major rethink?

thanks

11. Rleo6965

585
9
Jan 22, 2012
I've already build Bar Graph Car Battery indicator. But it uses only 10 LEDs.

File size:
50.2 KB
Views:
703
12. garynobles

10
0
Jul 4, 2013
Thanks Rleo, that is along the lines of what I want, although I have 16 LEDs so I will have to configure 2 LM3914s accordingly, but for now If I can get half of them designed the other half should be fairly straight forward.

13. davennModerator

13,782
1,934
Sep 5, 2009
believe Steve and I when we tell you ... the LED's are shown with the incorrect polarity in the circuit

look at them and compare them to the LED's in the LM3914 datasheet
I personally manufacture a commercial product using this series of chips,
if I wired the LED's the way shown in that circuit, my product wouldnt work

EDIT: OK looking again at the that page... there's no circuit there but it appears that I have misread the info
they are common Cathode not common Anode. My comments still are valid
What it means is you cannot directly drive the LEDS as shown in your diagram cuz the polarity is incorrect, The 3914 works directly with common Anode, it means you need additional switching transistors between the 3914 outputs and the LEDs.
This is what Steve was suggesting earlier

Dave

Last edited: Jul 5, 2013
14. davennModerator

13,782
1,934
Sep 5, 2009
note the polarity if the LEDs compared to the cct you supplied

that top common rail VLED is positive NOT ground

cheers
Dave

File size:
29.5 KB
Views:
1,570
15. garynobles

10
0
Jul 4, 2013
Thanks Dave, that makes sense now, I will start playing with transistors!
I guess no other version of the 3914 which works the other way?

16. garynobles

10
0
Jul 4, 2013
So, the transistor route...
As the 3914 is a sink I need a PNP Transistor, right?
So if I only use 1 LED for example (see attached) this should work?

Thanks again for all your work, I wish the internet was around when I was being taught (badly) this at school!

17. garynobles

10
0
Jul 4, 2013

So if the previous is correct my transistors will look a little like this?
(Note pins 11 and 10 are not needed)

18. garynobles

10
0
Jul 4, 2013

Ok, so before anyone points out some clear errors, here is a corrected version with the +V coming into the PNPs and out to the common cathode. I have include the 2nd IC, I'm pretty sure I will need some more resistors between R2 and the power source otherwise the current will go straight to ground! So I will need to do some calculations.

But for now, how is it looking?

19. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,480
2,827
Jan 21, 2010
At the very least (i.e. this may not be sufficient) you need to place a resistor in series with each LED to limit the current.

Normally you need a resistor in series with the base of the transistor. While this would be a good idea, since the LM3914 is a current sink, another (easier) way is to program the output current to a suitable value. 0.2mA might be appropriate.

20. davennModerator

13,782
1,934
Sep 5, 2009
and for the second 3914 you will need to tie the 2 chips together so that the range runs smoothly from one set of LEDs to the next
Look in the datasheet, it gives an example of cascading 3914's

Dave