> From: James Newton, webhost[SMTP:jamesnewton@PICLIST.COM] > Sent: Tuesday, November 25, 2003 5:48 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [EE:] Optical NAND design challenge > source= http://www.piclist.com/piclist/2003/11/24/174650a.txt? > Bob Ammerman defined it better with:
> fmax = maximum output frequency > loop forever: > f1 = get frequency of first input > if (f1 > fmax) then f1 = fmax > f2 = get frequency of second input > if (f2 > fmax) then f2 = fmax > fout = fmax - min(f1,f2) > end loop >
> IF I wanted to use a PIC for this, this is about what I would have written. > However, I find it hard to believe that the cost of the photo detectors, > LED, PIC, crystal or resonator, etc... is going to be less than the cost of > photo transistors, LED, a few caps, diodes and resistors and I can't believe > at all that this can't be done in a purely analog circuit. It violates KISS > to use a PIC, for this doesn't it? Yes, I know there is KISS for design and > KISS for production and I could have had it designed, prototyped, debugged, > and off to the board house long ago if I did a KISS design using a PIC, > etc... > But I want to make some number of these and enable non-PIC people to cobble > them together from Radio Shack parts, so I'm really hoping for an analog > design. > The AND part is easy... the photo transistors just get hooked in series. And > the invert is easy... the LED is just powered from the difference between a > cap and Vcc so when the cap is charged, the LED doesn't light. The cap is > charged through a diode by the pulses from the photo transistors and > discharged via a large value resistor. > What I don't know is how to bias the phototransistors so that they only > conduct when the light level /changes/ i.e. they need to constantly re-bias > themselves so that changes in the light level produce a brief burst of > current flow. So how does one bias a phototransistor? There is no darn base! One way would be to shine an LED on the phototransistor from the side, and adjust its intensity to keep the output at a certain level. If the circuit driving the LED is slowed by an RC time constant, an increase in light would temporarily raise the output before the circuit readjusted itself. The same effect can be accomplished by subtracting a constant voltage from the phototransistor output with a difference amplifier. If the difference output is fed back to the "reference" input through an RC filter, the circuit would respond the short changes but not to long ones. You might want to try XORing the two phototransistor outputs together and using that signal to inhibit (by ANDing) the LED drive. John Power -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body