![]() |
4V - 5V signal on Digital Input
We have an input signal that is at 4V when it is low, and at 5V when it is high. How could we bring the voltage down so that we can read it in as a digital input?
And no, analog inputs are not an option :D |
Re: 4V - 5V signal on Digital Input
The first thing that comes to mind is a simple level triggering opamp circuit? For example LM339s or LM139s? Set up a resistor divider so that 4.1v is Vref, apply your 4v-5v to Vin, Vout should be ~0v if Vin is less than 4.1v and ~5v is greater than 4.1v...
See National Semi AN-74.pdf application note for more info. |
Re: 4V - 5V signal on Digital Input
Quote:
If you need to use a digital input, the suggestion of using an LM339 (4 comparators in a package) or an LM393 (2 comparators in a package) is a good approach. Data sheets can be found online: |
Re: 4V - 5V signal on Digital Input
Thanks guys, I'll look into those options. The only reason we don't want to use analogs is because we're really just looking for on vs. off, and the additional sampling required for using an analog input is overkill.
|
Re: 4V - 5V signal on Digital Input
Quote:
An analog comparison will only take a couple lines of code. Code:
{ |
Re: 4V - 5V signal on Digital Input
Quote:
on-off state is overkill. We ran out off digital inputs this year and needed one more. We wired the switch to a pullup resistor and an analog input, coded to set a variable to 0 when the voltage was below 2.5 volts and to 1 when the voltage was above. It worked just fine. Eugene |
| All times are GMT -5. The time now is 10:43. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi