Voltage level monitor

Discussion in 'The Projects Forum' started by akis02, Sep 6, 2012.

  1. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    Hello, I am building a small battery monitor, which could be done with the LM3914, however I am trying to do it from parts.

    Typically I create a reference voltage, eg 5V, and then for each LED I want to light up, I compare a given fraction of the battery level with the reference voltage using an op-amp, which then drives the LED.

    This all works (albeit a lot of parts).

    What I cannot do nicely, is to work in "DOT" mode, so that when a LED lights up, all the previous ones switch off.

    Could anyone please suggest a way to do this?

    I attach a provisional/ experimental schematic. I use transistors to drive the LEDs so as to have constant brightness / consumption (5mA per LED). I use Vr to simulate a varying battery voltage. Vref is a 5V from a 7805.



    Thanks
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,403
    3,352
    Use an LM3914.
     
  3. paulktreg

    Distinguished Member

    Jun 2, 2008
    608
    120
    If you must use individual comparators then take a look at the internal structure of the LM3914 here.
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,078
    3,014
    That requires using window comparators. I believe the LM339 datasheet describes how to do that.

    You could simplify things a bit by dropping the transistors. The comparator can sink enough current (5mA) to light an LED.

    But, why not just use the LM3914 in dot mode?
     
  5. absf

    Senior Member

    Dec 29, 2010
    1,490
    371
  6. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    Thanks for the replies.

    The transistors are not really needed unless I want to keep the current (brightness) constant and am expecting a wide input range, eg 10 to 40 volts.

    Another trick to get rid of the transistors is to power the op-amps/comparators from a single 7805 or 7809 so as to keep the brightness constant.

    But I have not yet found a schematic that works in dot mode. The LM3914 has a lot of circuitry to control the power to the LEDs as well as work in DOT mode as well as overlap the LEDs and stop them from flashing.

    It seems very sensible to use the LM3914 after all.
     
  7. wayneh

    Expert

    Sep 9, 2010
    12,078
    3,014
    +1
    No shinola, Sherlock! :p
    Glad you've come around. Using the right tool for the job simplifies life. ;)
     
  8. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    OK, while the LM3914 is in the post, and I cannot really simulate it (no SPICE models), I was thinking of modifying the battery monitor requirements a bit.

    Instead of having a green, yellow or red LED at all times (5mA), I had the idea of using some circuitry that every so often will "wake up" and test the battery level and flash the appropriate colour LED for half a second, then sleep for 4-5 seconds and so on. One idea would be to use a 555 (maybe a low power one), and then have it "wake up" the LM3914 once every 5 seconds. What do you think?
     
  9. MrChips

    Moderator

    Oct 2, 2009
    12,403
    3,352
    How much do you know about microcontrollers? This would be a lot easier to do with an MCU.
     
  10. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    Never used them, I'm afraid.
     
  11. wayneh

    Expert

    Sep 9, 2010
    12,078
    3,014
    Certainly doable. Just use a 10% (or 90%, depending on the downstream logic) duty-cycle, 0.2Hz waveform. You may need a MOSFET to switch the rest of the circuit cleanly to full-on; the timer may not produce enough voltage and/or current, depending on your supply and which 555 you choose. It's a simple addition if it's required.
     
  12. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    ok, how do I wire up the 555 to do 10% on and 90% off? I can do 50-50, or 80 on- 20 off, but not really the other way :)
     
  13. MrChips

    Moderator

    Oct 2, 2009
    12,403
    3,352
    Add a one-transistor inverter.
     
  14. absf

    Senior Member

    Dec 29, 2010
    1,490
    371
    Use the 555 calculator here

    R1=120K, R2=15K, C=47uF to get 0.2Hz 90% duty cycle and invert the output with a transistor to get 10% on and 90% off; as suggested by MrChips & wayneh.

    http://www.ohmslawcalculator.com/555_astable.php

    Allen
     
  15. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    The LM3914 has arrived, I have experimented with it, and it does not seem an easy solution for what I want.

    I want to monitor a battery with range from 23-28 Volts. So to start with I should need to divide this voltage by 2 and a bit, to go down to 12V which is the max the LM3914 can take.

    Then there is the LM3914 internal voltage divider which is 12.6K Ohms - at 12V this is 1mA right there. Why could it not be 120K Ohms? Temperature coefficients? Low input resistance comparators? Who knows.

    Setting up the external low and high references also requires low value resistors, below 1K, else the reference voltage comes out all wrong (and will be further loaded by a 12K resistor divider), but at the same time this sets the LED brightness, which I want to set to 4mA-5mA at most, and certainly not 10mA or 20mA which seems to be what the LM3914 has intended.

    So it is seems too much trouble. I have already designed a circuit using discreet components and it has a larger component count, but at least it is as I want it. Once I have the schematic I will post it.
     
  16. absf

    Senior Member

    Dec 29, 2010
    1,490
    371
    Show us how you wired the LM3914. May be we can help you to improve it to do what you wanted....

    Allen
     
  17. MrChips

    Moderator

    Oct 2, 2009
    12,403
    3,352
    Or I can program you a MCU to do what ever you want.
     
    absf likes this.
  18. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    OK here it is in the most simple form. Monitor a battery voltage using 3 or 4 LEDs. I show below the case with 4 LEDs. Lowest expected voltage is 21.6 Volts and highest is 25.2 Volts. I want the red LED to start at 20.5 Volts, the orange to start at 22.3 V, the yellow at 23 V and the green at 24.3 V, all in DOT mode.

    If we use just 3 LEDs, drop the orange, and shift the voltages around a bit.

    I'd be very interested to see how an MCU would be wired up and used.
     
  19. akis02

    Thread Starter Member

    Apr 30, 2011
    57
    3
    Here's is how I'd have it. To simplify things, say we are monitoring a 24V battery, so we are interested in a range from 22V to 26V.

    I'd power the LM3918 with 15V and would halve the voltage under test so as to be always below 13V. Then I would use a 2.2K resistor to set the LED brightness to 5mA and the last part is to create two voltage references, one for 13V at pin 6 and a smaller one at pin 4.

    Edit: But the very precise voltage reference must also be able to supply 1mA to pins 6-4 which is a 12K divider. So I have to use a reference followed by a buffer, just for the stupid pins 4 and 6.

    Edit2: Actually the attached will do the trick I think. The 12K resistor represents the divider inside the LM3918. But we are at about 20mA with just one LED up.
     
    Last edited: Sep 11, 2012
  20. absf

    Senior Member

    Dec 29, 2010
    1,490
    371
    I attached my schematic using the LM3914 to monitor the battery voltage.

    I use a LM7815 to get 15V from the 26V battery instead of using op-amp.

    I will write a description on how my circuit works tomorrow as I have some other works to attend to. Read through my schematics and we shall discuss it later.

    cheers

    Allen
     
Loading...