Go Down

Topic: 2 leds one comparator output (Read 586 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.
"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?"
Hey, it's "bipolar transistor" or "junction transistor" - "BJT" is just stupid.

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.
https://sites.google.com/site/rgbledcubes

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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy