From: Robert Baer
X-Mailer: Mozilla 4.75 [en] (Win98; U)
Subject: Re: I/O logic problem
Date: Fri, 06 Dec 2002 08:29:35 GMT
NNTP-Posting-Date: Fri, 06 Dec 2002 00:29:35 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
> According to my knowlegde, normally, we input 4V or above for 5V system, it
> is High. 0.5V or below, it is Low.
> I use a MCU, according to the datasheet, Input High is 0.8VDD minimum, Input
> Low is 0.2VDD maximum. I use a IR sensor series with a resister. When IR
> applied on the sensor,
> current flow through the sensor and resister. So, by detecting the voltage
> drop at the resister, we can detected IR.
> VDD-----R----------IR detector----GND
> However, my problem is that: IR source which I want to detect is too small
> compared working environment. IR in the working enviroment cause the IR
> decter "semi-on", so, the voltage Vg is about 4V (off my IR source).
> When i turn on my IR source, it is 3.5V.
> It seems that both Voltage is undetermined for High or Low.
> If I use smaller resister, Voltage drop across the R is smaller, Vg is
> higher. However, my
> IR source is difficult to detected, because the voltage drop across the R
> due to my IR source is very small.
> If I use larger resister, the Vg is about 3V if i do not apply my IR
> When i apply my IR resource, the voltage Vg is about 0.7V.
> However, it is also not a good solution because 3V is not a logic high
> Unfortunately, I cannot increase the power of my IR source and I must
> concern the effect of background IR in working environment.
> Any idea to solve this problme? Thank a lot.
Use an optimum value for R without any regard to the MCU; if you can,
make a second identical circuit that "stares" off in space in a way that
it cannot "see" your on/of source.
This makes for a bridge - the second circuit is the reference.
If you cannot do that, then tweak a voltage divider to the nominal
"center" of the worst case extremes.
If that is not possible, then make a second identical circuit that
"stares" the same way as the first, only interchange the order of
components - thereby increasing the differential voltage.
Whatever scheme you use, the differential voltage goes to a
comparitor, and the output of the comparitor drives the MCU.