Go Down

Topic: 2 leds one comparator output (Read 513 times) previous topic - next topic

Voidugu

I would like to know if it is possible to control two leds separately using a single comparator output. ie above a certain voltage a  green led is on and a red is off, below a certain voltage, the green led is off and the red is on.

Thank you in advance

Runaway Pancake

#1
Jan 27, 2013, 05:14 pm Last Edit: Jan 27, 2013, 05:22 pm by Runaway Pancake Reason: 1
Yes, if the comparator has an open collector output 1.

> > >  1 Like an LM339, for example.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Hippynerd

I am totally unfamiliar with a comparator, but i am familir with charlieplexing, you could charlieplex 2 LEDs, and reverse polarity to switch LEDs.

Grumpy_Mike


I would like to know if it is possible to control two leds separately using a single comparator output. ie above a certain voltage a  green led is on and a red is off, below a certain voltage, the green led is off and the red is on.

Where is this variable voltage coming from?
If it is the analogWrite command be aware that this does not output a variable voltage but a pulse width modulated signal. You need a filter to make that an analogue voltage.
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Go Up