# Sensor Circuit II

Okay, I looked over the circuit fairly carefully.  With one
(unimportant) exception, everything is wired as in the diagram.

However, I found what may be a small problem in the diagram.  :)

I'm going to write this down now so I don't forget, since I probably
won't be able to explain it clearly in the morning....

In the following, all voltage values that I refer to are given as
absolute voltages.

The output from the full wave rectifier is centred on 6V.  I estimate
an approximate plus/minus of 1.5V on this output value, based on how
accurate resistors usually are(n't) and on the inaccuracy of the 12V
power supply.  The full wave rectifier then feeds a voltage divider that
feeds a voltage follower that feeds the peak rectifier.

Now, the output from the full wave rectifier will range from +6V to
+12V.  This output is divided by the voltage divider into a range of
+3V and +6V, respectively.  The +3V voltage is given when no IR light
is being sensed and the +6V when maximum IR light is being sensed.
This voltage is connected through a diode to the CMOS driver chips.  There
will be a 0.7V drop over the diode.  This leaves 2.3V feeding the CMOS
for the case of no IR light being sensed.  This is ok --- the cmos
driver will output voltage low.

Consider my estimated worst case of output from the full wave
rectifier --- 6V + 1.5V = 7.5V.  Voltage divided gives 3.75V.  Loss
over the diode gives 3.75V - 0.7V = 3V.  This means that the cmos
driver is fed with 3V when no IR light is being sensed.  This is very
borderline ... I wouldn't bet on the driver chip dependably outputting
either voltage high or voltage low.

This is why the circuit would frequently output voltage high even when
no IR light was being sensed.  This does not explain the additional
noise we saw (actually it _may_ explain the noise too).  Presumably
when you tried it just now in your room, this is what was happening.
Presumably for the times it did work in the lab, there was just the
right amount of resistance in the right places to let it work.

[Where the CMOS is powered at +5V ... see below for why it worked when
you had the whole circuit on the protoboard and weren't using the
voltage regulator].

Normally the CMOS driver would have adapted to the overvoltage on the
12V supply line because it was supplied, albiet through a voltage
divider (either a voltage divider on the protoboard or from the power
supply directly, I can't remember) from the same 12V source.  The only
important plus/minus on the output from the full wave rectifier would
have been that due to imperfect resistors --- the plus/minus due to an
inaccurate 12V power supply would have been less important.  However,
once you began to power the CMOS driver chip from the voltage regulator,
the voltage regulator guaranteed that the CMOS would be powered at
+5V, no matter what the 12V supply.  Suddenly plus/minus on the 12V
supply became relevant and the circuit stopped working.

Okay, that's my theory about why the circuit is so dysfunctional,
anyways.  Keep in mind that this theory was constructed purely from
the few results we see in the lab and from studying the circuit
diagram.  I can't measure any voltages right now to either verify or
condemn this theory.

So...  assuming this is a major problem, what is the solution?

If we had noticed this while it was still on the protoboard, I would
probably suggest a different solution.  However, given that it's been
soldered-up, now, the only easy solution is to desolder one of the
resistors in the voltage divider that divides the full wave rectifier's
output and replace it with a different resistor.  I believe that
replacing the 1K resistor in the voltage divider that is between the
full-wave-rectifier output and between the voltage-divider output with
a 2K resistor will solve the problem.  This is not hard to do --- for
myself I would estimate ~10minutes to desolder and resolder two new 1K
resistors back in place (far less time than it took to diagnose the
problem or to compose this message).  Slightly longer if the old 1K
resistor needs to be reused.  Alternatively, if you have another 2K
pot lying around, that can be soldered-in instead of a 2K resistor.
Using a pot may be a superior solution, but I don't feel like going
down to Supreme to buy one if you don't have one handy.  Soldering in
a pot would take about equal time as time required to solder-in two
1K resistors --- just use wire leads to go between the pot and the
perfboard.

Since I'm already emailing you, I might as well mention the other
things I noticed.

o On the peak rectifier for the near sensor, you put a 3K resistor where
you wrote 3.6K resistor.  No big deal.  :-)

o The voltage divider following the full wave rectifier can draw up to
6mA of current.  For a high-frequency application, this is probably
a fair bit.  I'm not sure if your sensor circuit counts as a high-
frequency application or not for these opamps.

o The input line into the first amplification stage, specifically into
its op-amp, crosses ontop of the opamp's V+ line.  From the
perspective of noise generation, this is the same as crossing ontop
of its Vout line.  I estimate an <8% chance that this is causing
some of the new noise we see.  Using a longer wire should lower the
probability that this is causing problems.

o You do actually have four amplification stages in this sensor
circuit.  I'm not sure if you realized that during our earlier
conversation or not, but don't think you could bamboozle me forever.  ;-)

Now, I'm going to go buy some (pototo) chips.  My eating habits have
declined horribly this semester.  I think I've spent more at Cora's
this still-incomplete semester than in all my previous life at
Toronto.

--
Signature withheld by request of author.