Pages: [1]   Go Down
Author Topic: 2 leds one comparator output  (Read 399 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 56
Posts: 2184
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, if the comparator has an open collector output 1.

> > >  1 Like an LM339, for example.
« Last Edit: January 27, 2013, 11:22:40 am by Runaway Pancake » Logged

"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?"

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31369
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: