Electronics > Beginners

How do I make an LED light up using a comparator?

<< < (7/7)

Audioguru again:

--- Quote from: alsetalokin4017 on October 22, 2019, 12:40:47 am ---When the output goes HIGH.
--- End quote ---
No, the output of this comparator never goes high, instead it floats disconnected or it goes low. The LED does not light when its cathode is disconnected from ground.

alsetalokin4017:

--- Quote from: renzoms on October 22, 2019, 01:02:17 am ---Got it to work although the timing is not accurate. Not looking into it rn.

If my + voltage is higher than my reference voltage at - then output at Pin 1 should be High, so for this n channel open drain output, that means ?????
--- End quote ---
It means Pin 1 is floating when HIGH, that is, not connected to anything inside the chip. (you could connect it externally to bias it to some other level but for your application it is just disconnected.)
--- Quote ---
When the reference voltage, -, is higher than the voltage at the + terminal, the output at Pin 1 should be Low, so for this n channel open drain that means???

--- End quote ---
It means Pin 1 is connected to Ground inside the chip. Look at the "internal schematic" of the chip in the data sheet. When Pin 1 is LOW it is really low: grounded.


--- Quote from: Audioguru again on October 22, 2019, 01:35:17 am ---
--- Quote from: alsetalokin4017 on October 22, 2019, 12:40:47 am ---When the output goes HIGH.
--- End quote ---
No, the output of this comparator never goes high, instead it floats disconnected or it goes low. The LED does not light when its cathode is disconnected from ground.

--- End quote ---
Yes, that is right. Although the two states of a digital output are called High and Low, in this case High means "not connected internally", while Low means "grounded". Sorry for my confusion, I wasn't looking at the right data sheet.

I have the circuit working on my bench using 1/4 of a LM339 quad comparator with open collector output, otherwise with same values as the schematic in the OP.

Since the capacitor is being charged through a 22 k resistor, it takes a finite time to charge fully. So the length of time the output LED is ON varies a bit, depending on how fully charged the cap was when you took your finger off the button.

alsetalokin4017:

--- Quote from: renzoms on October 22, 2019, 01:21:37 am ---The timing is about over 4 seconds but it is calculated at 3.7s....

--- End quote ---

Component tolerances, capacitor charge level. The actual value of a capacitor can be different from the nominal value. Ditto resistors.

alsetalokin4017:
If you need some more exact timing... and even just for fun and learning ... you could substitute a 50k potentiometer for the fixed voltage divider made of the 10k and 47k resistors.
 :-+

renzoms:

--- Quote from: Audioguru again on October 22, 2019, 01:35:17 am ---
--- Quote from: alsetalokin4017 on October 22, 2019, 12:40:47 am ---When the output goes HIGH.
--- End quote ---
No, the output of this comparator never goes high, instead it floats disconnected or it goes low. The LED does not light when its cathode is disconnected from ground.

--- End quote ---
Thanks, easy to understand!


--- Quote from: alsetalokin4017 on October 22, 2019, 01:45:39 am ---It means Pin 1 is connected to Ground inside the chip. Look at the "internal schematic" of the chip in the data sheet. When Pin 1 is LOW it is really low: grounded.

--- End quote ---
Lol.


--- Quote from: alsetalokin4017 on October 22, 2019, 01:50:16 am ---
--- Quote from: renzoms on October 22, 2019, 01:21:37 am ---The timing is about over 4 seconds but it is calculated at 3.7s....

--- End quote ---

Component tolerances, capacitor charge level. The actual value of a capacitor can be different from the nominal value. Ditto resistors.

--- End quote ---
Thanks that is comforting!


--- Quote from: alsetalokin4017 on October 22, 2019, 01:53:19 am ---If you need some more exact timing... and even just for fun and learning ... you could substitute a 50k potentiometer for the fixed voltage divider made of the 10k and 47k resistors.
 :-+

--- End quote ---

Will do tomorrow! Good idea! Sounds fun.

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod