# Recomputing circuit math for LED bargraph

Discussion in 'General Electronics Chat' started by doug3460, Jan 1, 2009.

1. ### doug3460 Thread Starter Active Member

Oct 19, 2008
87
0
Question: Where does one begin when wanting tp recompute the component values when changing a circuit to handle a different supply voltage or range of voltages? Is it resistors, capicitors, then diodes, etc., or some arrangement thereof, or does it matter, or is it dependent on each net in the circuit?

I want to compute the necessary changes to datasheet schematics for the LM3914 so I can add it to my variable supply output to indicate percentage of voltage change from 0 to max available.

As always, thanks for your valuable time, & best wishes to all for 2009!

2. ### Audioguru Expert

Dec 20, 2007
10,481
1,156
The datasheet for the LM3914 shows how to calculate the values of its resistors. You might need to attenuate the input voltage so it is within the allowed common-mode voltage range which is from 0V to 1.8V less than its supply voltage.

R1 has 1.25V across it and its current is also in R2 which increases the reference voltage at pin 7 which is the top of the internal ladder at pin 6. The current in R1 and R2 determines the LED current divided by 12.5.

3. ### SgtWookie Expert

Jul 17, 2007
22,202
1,791
In other words:
1) Determine the current requirement of your LEDs.
2) Divide 12.5 by the LED current requirement. This is the approximate value for R1.
3) Determine the reference voltage required.
4) Ref V=1.25 (1+(R2/R1))

Last edited: Jan 2, 2009
4. ### doug3460 Thread Starter Active Member

Oct 19, 2008
87
0
Thanks Audio for the quick response. I guess I can't use the 3914 then since my signal source is 0-22V. The datasheet puts the signal source @ 5V & the supply between 6.8 & 18V. Unless I'm misunderstanding it (which is definately possible since I thought the chip could handle ±35V & the LED current was determined by 12.5/R1).

Since voltage meters are connected across rails & ammeters are connected in series w/ the supply, I guess I need to find a chip that can handle the ≈22Vdc the circuit puts out.

5. ### doug3460 Thread Starter Active Member

Oct 19, 2008
87
0
Oops. Thanks Sarge. While answering Audio, missed your post. Let me do the numbers.

6. ### SgtWookie Expert

Jul 17, 2007
22,202
1,791
OK, your 22v input can be handled with a resistive voltage divider. It could be as simple as a 10-turn 10k or 50k trim pot. Ground on one end, 0v-22v on the other, and a small cap (say, 10nF) on the wiper to keep the noise down. If you have the pot set to 25%, your output range will be 0v-5.5v.

7. ### italo New Member

Nov 20, 2005
205
1
Ref outv=1.25 (1+r2/r1)
I led=12.5/r1
now you have to formulas go for it.

8. ### doug3460 Thread Starter Active Member

Oct 19, 2008
87
0
I've attached my drawings for review. Thanks.

File size:
167.7 KB
Views:
29
File size:
152.3 KB
Views:
11
9. ### Audioguru Expert

Dec 20, 2007
10,481
1,156
Why is your schematic as big as my neighbourhood? I cropped it.

You showed a positive 12V battery and a negative 12V battery. I think you have only a single 12V battery.

You show an LM317 as a stepup voltage converter. It is NOT. With a +12V input its max output voltage is about +9.5V.

You had a capacitor at the ground end of the pot feeding the LM3914. Why? What is the 22V variable input? An audio signal?

You had the resistors with such high values for the reference of the LM3914 that the LEDs would have been very dim.

I fixed your circuit but I do not know what it is measuring.

EDIT: I cropped the attachment.

• ###### 22V variable to LM3914 cropped.PNG
File size:
175.9 KB
Views:
16
Last edited: Jan 3, 2009
10. ### SgtWookie Expert

Jul 17, 2007
22,202
1,791
You live in a small neighborhood. He's new at this. It was large, but quite legible, which I find preferable to those that one need an electron microscope to read.
Why did you leave so much white space around your crop?

He's using the +12v and -12v from an ATX power supply that's been converted to a "bench" supply. He may not yet realize that the +12v will be capable of far more current than the -12v supply; the latter usually being limited to less than 1A, as it's normally only used for RS-232.

No, he showed it correctly considering his inputs.

Dropout voltage for the LM317 is 1.7V (give or take, depending upon temp of the device) so the maximum output voltage will be 22.3V. If he's not drawing at least an Ampere or two from the +5v supply, the +12V/-12V regulation on the ATX supply will be lousy (quite a bit undervolt).

He gets a Mulligan on that one. The lower side of pot R3 should be grounded. The cap C3 should be on the wiper arm to hold down the resistor noise.
Actually, it's his 0v-22.3v output from the LM317 regulator.

Slippery decimal points have been the scourge of experimenters for aeons.
Well, it's fixed for what you assumed would be a 12v input.

Since you now know it's to make a variable voltage supply from a converted ATX form factor supply, some further adjustments need to be made.

11. ### doug3460 Thread Starter Active Member

Oct 19, 2008
87
0
Audio - thank you for the review & corrections. As Sarge has clarified the background, I'll continue modifying my original schematic.

Sarge - thanks for the clarification. Some notes.

The current on the +12V is 6A; it's 0.3A on the -12V.
For grins, the others are: +5V,18A; +3.3V,10A; -5V,0.3A & +5VSB,0.7A.
LOL. Thank you. You made it very clear in your original suggestion that the capicitor was to go on the wiper. I corrected it.
Well said . My computations were based on the LEDs needing .020 (the bargraph datasheet indicates up to .025mA is okay). I am constantly confused by when to use the whole number mA versus the decimal A. So I did it both ways & the numbers went like so:
.020/12.5=0.00016 or 20/12.5=1.6
1.25/0.00016=7812.5 (8.2kΩ) or 1.25/1.6=0.78125 (1Ω) (R1)
5V-1.25V=3.75; 3.75/0.00016=23437.5 (24kΩ) or 2.34375 (2.4Ω) (R2)
Since E24 resistors don't come in those sizes, I was going to use parallel reisistors to get the numbers needed . I just didn't want to muck up the schematic showing them.

Anyway, when I computed the divider number:
V2 = (R2 / (R1+R2))*V1, I got 3.529V (low R1 & R2) or 3.727V
Using my most advanced mathmatics, the differentiated result of TCF indicated 3.7V, so I went with that.

On the plus side, I'm happy because I didn't get the "you're gonna blow yourself up" response I'm use to.

I've attached the corrected version (for the wiper capacitor), but have left the resistor values alone pending further input.

File size:
103.3 KB
Views:
18
File size:
152.5 KB
Views:
8
12. ### SgtWookie Expert

Jul 17, 2007
22,202
1,791
OK, note that frequently -5v and -12v share the current between themselves; if you're pulling 150mA on -5v, then you'll only have 150mA left on -12v - which limits your entire 22v output to 150mA.

I have a little 250W Compaq ATX supply I converted to a bench supply; even it has 0.8A output shared between -5v and -12v. You must have a 200W or less supply.

Re: R3/C3 "Mulligan":
Hey, it's easy to make mistakes. We're just here to point them out and laugh.

Re: resistor computations:

OK, *I* blew it on the instructions. Sorry 'bout that.
You were actually supposed to divide 12.5 by the desired LED current (20mA, or 0.02A), which results in 625 Ohms. Nearest standard value is 620 Ohms, which results in an LED current of around 20.16mA.
To get a 5.5v Vref, use a 2.1k resistor for R2. (Calculated value was 2,108 Ohms.) You don't need to be absolutely precise on this, because you'll have R3 as your "finagle factor" for scaling the voltage reading.
You may still put your eye out.

OK, where are you planning on getting "ground" from?

This is going to sound rather odd, but bear with me.

The LM3914 has a maximum input voltage limit of 25v. Right now, it looks like you're planning on powering it from the +12v input. However, if you use the ATX ground for your LM3914 ground, you'll only be able to display lit LEDs when your adjustable supply output is over 12v; that is, relative to -12v.

You need to connect your V+ of the LM3914 to the GND of the ATX supply, and the V- of the LM3914 to -12v, along with the "ground" side of R3 and just about anything else that you now have running to GND.

Additionally, the LED supply needs to come from the -5v of the ATX supply. This will give you a net 7v on the LED supply.

You'll be running out of current really fast, though.​

13. ### doug3460 Thread Starter Active Member

Oct 19, 2008
87
0
Sarge - Thanks for refiguring the resistors. I wandered if there was a problem since italo had posted the normal Ohms way. But, hey, what do I know? LOL. Anyway I have made the corrections & reoriented the schematic to better depict how I want to mount the bargraph in relation to the Variable Voltage pot.

Yep. Its 200. And too small physically (i.e., I had room for 1 very small switch & 1 set of binder posts) to do what I wanted. Instead, I made the modifications for the external switch, load, fuses, binders, etc, external to the supply. I simply plug the supply into my sub-panel & all the magic happens there.

OT: The F4 Phantoms were built by placing the acft battery & weapons control computer on a scaffold next to each other, & then the rest of the jet was built around them. Which meant 1/2 the entire front cockpit had to be removed to get to 2 of the most critical components on board. I've developed an adversity to working upside down in some contorted yoga position trying to fiddle with wires.

Since the current was so low on the negative rails, I omitted them from the external binder post configuration. I did leave them on the fused panel that breaks out the ATX molex lines just in case I ever needed them.

Since the LED supply is now negative, should I reverse the LEDs? I would have thought automatically yes, but we also went negative on the V+. So I got lost in the circuit somewhere.

Darn.

File size:
86.2 KB
Views:
18
File size:
152.7 KB
Views:
9
14. ### SgtWookie Expert

Jul 17, 2007
22,202
1,791
OK, looks better.

One quirky thing about using the symbols in Supply1 or Supply2 on the schematic side is that it will cause the board side to create "air wires" between any points that are connected by wires in the schematic or have the same symbols, but doesn't make any provisions for a connector. Basically, the supply"n" symbols just change the signal name of the wire to what their name is, ie: "-12V" - with the added benefit of having a visual tag in the schematic.

You have the "-12V" supply symbol on the left, but no wirepad, and a wirepad on the right with a refdes(NAME) of "0V". This may confuse you if you decided to make a PCB from the schematic.

You should add wirepads on the input side, and give them NAMEs of "+12_IN", "-12_IN", "GND" so that you don't confuse them with those on the output. Wirepad NAMEs default to PADn. You can add notes in the VALUE field, but they won't show in the board side.

Not a bad way to do it. I had a small 3"x5" plate of aluminum with tabs on the bottom that were bent 90° from the face that was scrap at a former workplace. I used some double-sided PCB scraps as buss bars between binding posts on the back of the panel; I have a GND binding post for each supply post, and two posts each for +3.3v and +5v due to the current limitations of the posts themselves.

Hmm - that might've been the USAF C, D or E models which I'm not very familiar with. The F-4J (3 computer; LRU-15 thru LRU-17) and F-4S (2 computer; LRU15,LRU16) models had them under door 19 on the turtleback behind the RIO's cockpit; door 19 had a hinge on the forward edge, the remander secured by maybe 50 1/4"-hex-socket-head captured screws we backed out using a speedhandle. The J model had analog computers with servos/resolvers, while the S computers were digital. The J&S model weapons systems were both made by Westinghouse, J was AWG-10 and S was AWG-10A.

Well, if you didn't bring -12V out as 0v, you won't have access to your 1.25v-22v supply. I say 1.25v, because you can't get an LM317 to output less than it's Vref, which is nominally 1.25v.

I suppose that you could use your variable output to get from between -10.3V and +10.3V if you used the GND reference, but your stability isn't going to be very good due to how weak the -12V supply is; and that's what's providing the low-side 'anchor' for the LM317's voltage reference. Note that since the LM3914 and LED(s) are both being powered by the -5/12 supplies, and the LM317 is draining another 10.4mA(nom) their total current will subtract from your available current.

No. Keep in mind that -12v is now the "V-" reference for the LM3914. -5v is 7v more positive than -12v, so you'll still need the anodes towards the more positive voltage. Told ya it'd be confusing.

15. ### Audioguru Expert

Dec 20, 2007
10,481
1,156
Using the negative supply makes it a very confusing circuit.

16. ### SgtWookie Expert

Jul 17, 2007
22,202
1,791
Agree with you wholeheartedly on that point. With the very limited current capacity due to the miserly 300mA -12v supply and some of that used up by the LM317 regulator (10mA) and more used up by the LM3914 (depends upon how many LEDs are lit; dot mode is advised, in that case perhaps another 30mA) the output will be perhaps 250mA at best.

It may still be useful for reconditioning low-voltage tantalum/electrolytic capacitors - but in that situation, one really needs a voltage-limited constant current supply.