Everything for Electronics

From the Q&A

With TJ Byers


Diode AND Logic

Question:

I have a magnetometer driveway detector. When it senses a vehicle, I route a nine-volt signal to an interface box that’s watched by a recycled PC, which randomly plays WAV files that say “We are being  invaded” or something similar. My problem is that weather-lightning drives the driveway detector crazy. I have a lightning detector that sounds a buzzer for one second from a nine-volt battery when a strike occurs and I want the PC to check the detector and not play the message if lightning is found. How can I put the two together so that when the two events coincide, the PC won’t play the message?

— Harvey Lewis
Greenwood, AR


Answer:

What you need is an AND logic circuit with two diodes and one resistor.

Your magnetometer is a logic low at rest, and a logic high when it detects a car or lightning strike. The MML101, on the other hand, is logic high until a lightning strike happens. Rather than trying to explain this in words, look at Table 1.

Lightning Logic Magnetometer Logic Output
N H Y H H
Y L Y H L
N H N L L

The way an AND gate works is that if either of the voltage sources are low, the voltage to the PC is about 0.7 volts. When both go high — the coincidence of no lightning and the presence of a car — the output goes high and sets off your PC’s WAV file.


Comments