LM3914 (BAR LED Driver) with LOGIC output

Thread Starter

alan1975

Joined Jan 1, 2012
42
Hello my Friends, it's my first post.

I would like to add some logic circuit (AND and INVERTER) to output of LM3914 driver.

I'm beginner so please don't be mad if i done something wrong.

Here is my project:




Few facts)
LM is configured to BAR mode.
Lowest LED (output 1) light when voltage is 10.5V.

I would like, to use that low led as logic output, i added a transistor (i'm not sure if i do this in right way).

After that transistor i hope to have 5V or 0V for logic control.

Than i have simple AND gate (74LS09) with 2 inputs.
First input is from that transistor above (when LM3914 detect above 10.5V)
Second come from push-switch AND through diode from output of LOGIC gate (when it have 5V at output).

I hope, this will work:
When i push the switch and have 5V in first input.
Logic gate output 5V on output.
That output come back to input of logic gate.
And I will have gate at "truth" until LM3914 stop sending signal to output 1.
Then AND gate will have 0 on first input and 5 on output, what will cause (AND) not truth, and shut down gate.
When LM3914 send signal, logic gate will be close, because of missing second input (user will have push button).

Logic 5v, from AND gate go to INVERTER (74HC04) what will revers 1 to 0 and 0 to 1.
I hope it mean: when logic gate will have 5V on output after inverter i will have 0V, what's mean transistor will not allow LED to flash what's mean everything is OK.

When at GATE output it will be 0, at output of inverter will be 5v, what's mean transistor should allow current flow to diode what will signalize to user: "no power at output"

Gate output will also send signal to another transistor, what will controll 12V relay.
For relay output will be connected device what consume large amout of power (few A).
This device will start work after user push button, and voltage is above 10.5V.
When it will drop under that voltage, device will be disconnected.
If voltage (after disconnecting load will rise) relay won't switch... it will wait for user "reset".


Is this might work ?
If i made something wrong please correct me.

regards
 
Last edited by a moderator:

SgtWookie

Joined Jul 17, 2007
22,230
I see that you have tried to link to an image that was hosted on AllAboutCircuits, but for some reason it did not "take".

Try clicking the "edit" button on your original post, then click the "Go Advanced" button near the bottom, and on the next screen, click "Manage Attachments".
You should get a pop-up dialog that provides a menu for selecting files from your local drive(s), and uploading them to the board. Note that since it is a pop-up dialog, you must enable popups in your web browser for this website, or you will not be able to upload images.

.png images are preferred, as they are compact and not "lossy" like .jpg files, nor require extra software like .pdf and .doc files.
 

bertus

Joined Apr 5, 2008
22,270
Hello,

There seems to be something wrong with the attachment the OP made.
There is an error mesage when you try to look at the image.

It needs to be uploaded again.

Bertus
 

Thread Starter

alan1975

Joined Jan 1, 2012
42
Hello,

Sorry for no reply, but i just came from work.
I'm not sure why it happend, i can see my attachment in post.

I post it again in PNG, maybe this will help (previous was jpg).

I can't edit my post, so i attach it here.
Maybe moderator could help with that.

Regards
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
Your AND gate has no part number (TTL? Cmos?) and there is no resistor to ground to create a logic low,
the relay coil does not have a diode across it to suppress the hundreds of volts spike created by its inductance when it turns off which will destroy Q1,
and the LED is shown connected upside down.
 

crutschow

Joined Mar 14, 2008
34,280
Q3 is configured as an emitter-follower so the voltage applied to the relay will be no more than about 4.7V To apply 12V to the relay it needs to be in series with the collector of Q3. You then would need to add a resistor in series with the base of Q3 to control the base current.
 

Audioguru

Joined Dec 20, 2007
11,248
The diode D1 is shown connected backwards and since the output high voltage of the old TTL gate in not much then it might not be high enough to create a logic high at the gate's input, but since both inputs of the old TTL gate do not have resistors to ground then they float to a logic high.

The circuit has many things wrong with it.
 

SgtWookie

Joined Jul 17, 2007
22,230
There is no resistor on the base of Q1. This will prevent the bottom LED on the bar from lighting, as the LM3814 will not be able to pull the base of Q1 lower than about 0.9v, which is less than any LED Vf.
 

Thread Starter

alan1975

Joined Jan 1, 2012
42
Hello,
I just come back, another hard day.

Thank all of You for replies!

I'm trying to read them carefully, and update my project.


There is no resistor on the base of Q1. This will prevent the bottom LED on the bar from lighting, as the LM3814 will not be able to pull the base of Q1 lower than about 0.9v, which is less than any LED Vf.

If i good understand, LM3814 have to low current at output.

I added resistor R2 (but i don't actually know how i should get value!).
I will be gratefully if You, or any of members this forum can teach me, explain how to get it, i believe it can be read from datasheet and calculated but i don't know what look for. I would like understand it, and do it myself not just get correct value, then i won't ask again.


For example i would like use:
BC327

Here i found datasheet
http://www.datasheetcatalog.com/datasheets_pdf/B/C/3/2/BC327.shtml


So when You tell me that LM3814 have not much current, i think way out, and disconnect that led, and connect it after transistor.
I add resistor R5 to 5V output of transistor Q1.
I find value doing:
5V-2V=3V
3V/0,02A=150ohm

Is this good idea?


Your AND gate has no part number (TTL? Cmos?) and there is no resistor to ground to create a logic low,
the relay coil does not have a diode across it to suppress the hundreds of volts spike created by its inductance when it turns off which will destroy Q1,
and the LED is shown connected upside down.
I added part numbers of AND and NOT gate to circuit.
I added diode to input of coil of relay. Please look and tell me is this now correct? What kind of diode i should use? What current, what voltage ?

About logic ground, where it should be, and how count value of that resistor for logic flow, can You tell me?


Q3 is configured as an emitter-follower so the voltage applied to the relay will be no more than about 4.7V To apply 12V to the relay it needs to be in series with the collector of Q3. You then would need to add a resistor in series with the base of Q3 to control the base current.
I found this transistor it can handle 1,5A, so i think it can be suficiente for relay:

NPN
BD137-16 transistor
http://www.datasheetcatalog.com/datasheets_pdf/B/D/1/3/BD137-16.shtml
here is datasheet.

I have same question as above, how should i count resistor value?.



The diode D1 is shown connected backwards and since the output high voltage of the old TTL gate in not much then it might not be high enough to create a logic high at the gate's input, but since both inputs of the old TTL gate do not have resistors to ground then they float to a logic high.

The circuit has many things wrong with it.
I add this backward, because i would like return "logic true" from output of gate, to input of gate. I add diode, because i i was afraid when user will send "true" using button, this is connected to logic output of AND gate, and it will make relay run (Q3).

I read datasheet of this gate: 74LS09
http://www.datasheetcatalog.com/datasheets_pdf/7/4/L/S/74LS09.shtml
and it says "Hi output 5.5V" and minimum "Hi input 2V".

If i will have use transistor, it can be BC637 NPN ?
http://www.datasheetcatalog.com/datasheets_pdf/B/C/6/3/BC637.shtml



Regards
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
If i good understand, LM3814 have to low current at output.

I added resistor R2 (but i don't actually know how i should get value!).
I will be gratefully if You, or any of members this forum can teach me, explain how to get it, i believe it can be read from datasheet and calculated but i don't know what look for. I would like understand it, and do it myself not just get correct value, then i won't ask again.


For example i would like use:
BC327

Here i found datasheet
http://www.datasheetcatalog.com/datasheets_pdf/B/C/3/2/BC327.shtml

So when You tell me that LM3814 have not much current, i think way out, and disconnect that led, and connect it after transistor.
I add resistor R5 to 5V output of transistor Q1.
I find value doing:
5V-2V=3V
3V/0,02A=150ohm

Is this good idea?
Actually - you did add R2, which is good. However, it is a bit too high in value. Decrease it to about 3k Ohms.

Disconnect R5 from just the LED. Re-connect the LED the way it was before; right side to 12v, left side to output 1.

We're going to change the function of R5. The collector of Q1 needs a pull-down resistor for when Q1 is not conducting. Change R5 to 470 Ohms, and connect the side of it that is away from Q1's collector to ground.
 

Audioguru

Joined Dec 20, 2007
11,248
R2 is the base current resistor for Q2 when it is turned on. Use Ohm's Law to calculate the current of R2 which is simply 1/10th the collector current of Q2 because the base current of a saturated transistor should be 1/10th its collector current as shown on almost all transistor datasheets.
The collector current of Q2 is about (5V - 1.8V)/150= 21.3mA so the base current should be about 2.1mA. Then the value of R2 is (5V - 0.7V/2.1mA= 2048 ohms. Use 2k or 2.2k ohms.
 

Thread Starter

alan1975

Joined Jan 1, 2012
42
Hello,

Thank You for reply.


Actually - you did add R2, which is good. However, it is a bit too high in value. Decrease it to about 3k Ohms.

Disconnect R5 from just the LED. Re-connect the LED the way it was before; right side to 12v, left side to output 1.

We're going to change the function of R5. The collector of Q1 needs a pull-down resistor for when Q1 is not conducting. Change R5 to 470 Ohms, and connect the side of it that is away from Q1's collector to ground.
I revert, changes with LED connection.
I also change R2 to 3Kohm

About pull-down resistor im not sure if i understand it good.
- It should be as close as possible to logic gate? (please look at updated circuit diagram).
If i understand it should drain "low current" from logic transistor, to prevent accidental opening logic gate ?


R2 is the base current resistor for Q2 when it is turned on. Use Ohm's Law to calculate the current of R2 which is simply 1/10th the collector current of Q2 because the base current of a saturated transistor should be 1/10th its collector current as shown on almost all transistor datasheets.
The collector current of Q2 is about (5V - 1.8V)/150= 21.3mA so the base current should be about 2.1mA. Then the value of R2 is (5V - 0.7V/2.1mA= 2048 ohms. Use 2k or 2.2k ohms.

That's clever. I didn't realize it's working in that way. I was thinking when i will connect 5V without any resistors it will be full open.
I look at datasheet and find:
Collector current - 1A
Base current - 100mA

If i understand this correct, that's two most important values when counting resistor.

If i put 100mA at base, i will have 1A allowed to flow?
When i put 10mA at base, i will have 100mA allowed to flow?
Finally i put 1mA at base, i will have 10mA allowed to flow?

Is this the idea of 1/10 ?

The collector current of Q2 is about (5V - 1.8V)/150= 21.3mA so the base current should be about 2.1mA. Then the value of R2 is (5V - 0.7V/2.1mA= 2048 ohms. Use 2k or 2.2k ohms.
I think i almost understand it:

5v is power source
-
1,8v is voltage drop on LED (?)
divided by resistor 150 ohm

Is this correct?

What about second part?
Counting R2

(5V - 0.7V/2.1mA= 2048 ohms.

How did You get 0,7V value?
Is this voltage drop on transistor?
Is this constant value ?



Inside attachment updated project.
Regards
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
If i put 100mA at base, i will have 1A allowed to flow?
When i put 10mA at base, i will have 100mA allowed to flow?
Finally i put 1mA at base, i will have 10mA allowed to flow?

Is this the idea of 1/10 ?
Yes, whan a trasnsistor is used as a saturated switch. A linear amplifier transistor uses the hFE beta number for its current gain (collector current/base current).

I think i almost understand it:

5v is power source
-
1,8v is voltage drop on LED (?)
divided by resistor 150 ohm

Is this correct?
No.
The voltage across the resistor is 5V minus the 1.8V LED voltage. Then Ohm's Law calculates the current in the resistor and LED as (5V - 1.8V)/150 ohms= 21.3mA.
Your LED is still shown upside down.

What about second part?
Counting R2

(5V - 0.7V/2.1mA= 2048 ohms.

How did You get 0,7V value?
Is this voltage drop on transistor?
Is this constant value ?
The base-emitter voltage of a silicon transistor is about 0.7V. It is 0.6V with a very low base current and is 0.8V with a very high base current. It can be as high as 1.8V for a power transistor with 1A of base current.

Inside attachment updated project.
Your transistor Q3 is used as an emitter-follower and is driven by old TTL logic so the transistor will have a very low output high voltage. Resistor R4 will reduce the output voltage more (an emitter-follower does not use a series base resistor). The voltage to the relay coil will be only about 0.5V.
Q3 and Q4 should be common-emitter switches instead where their load is between the collector and the positive supply.
 

Thread Starter

alan1975

Joined Jan 1, 2012
42
Yes, whan a trasnsistor is used as a saturated switch. A linear amplifier transistor uses the hFE beta number for its current gain (collector current/base current).


No.
The voltage across the resistor is 5V minus the 1.8V LED voltage. Then Ohm's Law calculates the current in the resistor and LED as (5V - 1.8V)/150 ohms= 21.3mA.
Your LED is still shown upside down.


The base-emitter voltage of a silicon transistor is about 0.7V. It is 0.6V with a very low base current and is 0.8V with a very high base current. It can be as high as 1.8V for a power transistor with 1A of base current.


Your transistor Q3 is used as an emitter-follower and is driven by old TTL logic so the transistor will have a very low output high voltage. Resistor R4 will reduce the output voltage more (an emitter-follower does not use a series base resistor). The voltage to the relay coil will be only about 0.5V.
Q3 and Q4 should be common-emitter switches instead where their load is between the collector and the positive supply.
Hello,

Thank You for replay.

I fix that LED polarity.


If i understand problem with that OLD TTL AND gate, is that it send low current at output, to low to flow enaught current by transistor.
If i look corect at datasheet is 5.5V and 0.25mA

To solve that we have connect 2 transistors to gain (allow flow bigger from collector to emiter) current.

For simulation i add transistor: 2N2219
It looks it allow to flow current 100 times bigger than base current (?).
I was try to look at datasheet, there is something like that:
hFE DC current gain IC = 10 mA; VCE = 10 V 75
But how, convert this to something what can be calculated...
For example i would like get 20mA at output. How many current i have add to base.

(on simulation it act
1mA - 101mA
10mA - 1010mA
) It looks like 1 to 100

Next i add also BD139, i look at datasheet and it allow to flow bigger current (1,5A).

On simulation when i add 800 ohm resistor and 5V 25mA, at output i have 500mA (500 mA, should be enaught for relay).
When i put 1mA on output i got 121,56mA
When i put 10mA on outpit i got 862.96mA
That's not 1 to 100.

I have no idea from where this values came.

I attach updated project.
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
Thank You for replay.
No.
I made a reply. A recording makes a replay when it is played over and over.

we have connect 2 transistors to gain (allow flow bigger from collector to emiter) current.
But your transistors are emitter-followers that have voltage loss, not voltage gain. Then you added series base resistors that also have voltage loss and are NEVER used with emitter-followers. So your relay gets only 0.1V if you are lucky.
The transistor that drives the relay should be a saturated switch, not an emitter-follower. The transistor that drives the saturated switch can be an emitter-follower (but a big old 2N2219 is not needed for the 57mA to drive the saturated switch). Both transistors together can be a darlington transistor.

For simulation i add transistor: 2N2219
It looks it allow to flow current 100 times bigger than base current (?).
I was try to look at datasheet, there is something like that:
hFE DC current gain IC = 10 mA; VCE = 10V.
Its hFE is about 100 when it is an amplifier with plenty of collector to emitter voltage (10V) but in your circuit its collector to emitter voltage when it is turned on is only about 0.8V so it needs a much higher base current.

You need to learn about how transistors work.
 

Attachments

Thread Starter

alan1975

Joined Jan 1, 2012
42
Hello,

Thank you for replying.

No.
I made a reply. A recording makes a replay when it is played over and over.
Sorry, my bad.


But your transistors are emitter-followers that have voltage loss, not voltage gain. Then you added series base resistors that also have voltage loss and are NEVER used with emitter-followers. So your relay gets only 0.1V if you are lucky.
The transistor that drives the relay should be a saturated switch, not an emitter-follower. The transistor that drives the saturated switch can be an emitter-follower (but a big old 2N2219 is not needed for the 57mA to drive the saturated switch). Both transistors together can be a darlington transistor.


Its hFE is about 100 when it is an amplifier with plenty of collector to emitter voltage (10V) but in your circuit its collector to emitter voltage when it is turned on is only about 0.8V so it needs a much higher base current.
I change it, like You show on image.
I dig internet to learn something about configuration from picture, and i found this website:
http://www.softwareforeducation.com/wikileki/index.php?title=MOSFET_Switch

I'm wondering maybe i could use this IRF630 :
Maybe we could change it to one mosfeet component?


You need to learn about how transistors work.
Yes i know, that's why i would like do this myself, not buy ready device.
Weekend project, get some practices. Really i was thinking it will be lot easier... I spend almost week thinking how this should work.


But maybe, i wrong decide to use this Gate.
It was my first think, I'm programmer so this tiny nice IC with many legs look's interesting for me. I just look at datasheet, look at 5v IN 5V out, and i was thinking it will work. But now i see how many things i was not understanding.

Maybe i will change that gates, to transistors?


Not gate





And gate


Maybe then we won't have problems with low current, low volt's etc. ?

If this a good idea, just tell me i will try redesign it.
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
Another new problem #1: The base of the new Q3 needs a series base resistor so its base-emitter pluss the base emitter voltage of Q4 do not clamp the output high of the gate to only +1.4V.

Another new problem #2: A lousy old 74LS09 has open collector outputs so its output needs a pullup resistor to go to a logic high voltage.

Instead of using a low output current lousy old LS TTL gate, use a modern 74HC08 AND gate that has plenty of output high current.

The gate-source voltage of most Mosfets including an IRF630 needs to be 10V so it will not work in your circuit. A "logic-level" Mosfet will work.
 
Top