3. Building the Laser Detector on a Solderless Breadboard

(article continued from previous page)

We first learned how a comparator detects a laser aimed at a sensor by the drop in voltage. Then, we learned how a 7474 flip-flop chip can remember which sensor was triggered last. Finally, here is the combined circuit laid out on a breadboard.

Laser-pointer remote control on a solderless breadboard.

Laser-pointer remote control on a solderless breadboard.

I use multiturn trimpots for R12 and R22 rather than single turn trimpots. It probably isn’t necessary, although I prefer the ultra fine-tuning that multiturns allow.

If you have any problems with the circuit, it is helpful to try measuring the voltages at each of the pins of the comparator (the smaller 8-pin chip). From pin 1 (lower left) to pin 8, you should see:

  1. Lower-sensor comparison result: 0V-1V laser detected, 1V-4V LEDs using too much power, or 4V-5V laser not detected.
  2. Lower potentiometer: <0.25V trip point too low, 0.25-1V good trip point, or >1V trip point too high.
  3. Lower-sensor voltage: <1V laser aimed at lower sensor or finger on upper sensor. >1V dark room or laser aimed at upper sensor.
  4. Ground: 0V good. >0.05V something wrong with power supply or voltmeter hookup.
  5. Upper potentiometer: <4V trip point too low, 4V-4.75V good trip point, or >4.75V trip point too high.
  6. Upper-sensor voltage: <4V dark room or laser aimed at lower sensor. >4V laser aimed at upper sensor or finger on lower sensor.
  7. Upper-sensor comparison result: 0V-1V laser detected, 1V-4V LEDs using too much power, or 4V-5V laser not detected.
  8. Vcc: <4.75V something wrong with power supply, 4.75V-5.25V good, or >5.25V something wrong with power supply.

In addition, if you happen to measure the total circuit consumption when the LEDs are off, it should be less than 5 mA. Mine is approximately 1.7 mA -- almost all of it consumed by the photoresistors (R1 and R2).

Beyond Outputting to an LED

As presented, the final output is to turn on a large blue LED. However, this could easily be modified to connect to an existing pushbutton to act as though the user pushed it. Most pushbuttons generate a 0V output when pressed. Simply connect IC2 (74AC74) pin 6 to the output pin on the pushbutton.

To actually power an entire circuit, rather than a single LED, the output pin 5 could be wired to an NPN power bipolar junction or N-channel power MOSFET transistor. The controlled circuit’s ground would connect to the top of the transistor. The bottom of the transistor and the controlled circuit’s power supply ground would connect to the ground of the laser sensor circuit.

When the laser hits the on sensor, the transistor would turn on and provide the ground connection for the controlled circuit. When the laser hits the off sensor, the transistor would turn off and the controlled circuit would be disconnected from one end of the power supply, shutting it off just like a power switch.

We have a lot of flexibility because the 7474 chip provides both a normal output (pin 5) and an opposite output (pin 6). So, if a controlled circuit wants a low voltage to turn it on, connect it to pin 6. Otherwise, connect it to pin 5.

(For safety reasons, this article won’t discuss the topic of controlling an AC device like a lamp. However, generally you’d use a properly rated relay.)

Microcontroller Superiority

A single microcontroller ($1.40 when purchased one at a time) could replace the two multiturn potentiometers ($0.86 x 2), the TLV3702 ($2.25), and the 74AC74 ($0.40) in the circuit.

At the “laser-pointer command board factory”, a freshly-built board would be placed into a room that pulses through a range of lighting conditions (bright to dark). The microcontroller would measure and save the individual sensor calibration information into its EEPROM. Then, each sensor would be passed in front of a laser for measuring the actual trip point, to eliminate the need for any trip-point potentiometers.

A microcontroller could easily measure many more target sensors to control many more outputs. Certainly a comparator-latch-logic chip board could be designed to provide the same functionality, but it would take up more room and it wouldn’t be as easy to alter as software.

During operation, a microcontroller circuit would use about the same amount of power as this comparator-latch circuit.

I chose not to build this circuit using a microcontroller, simply because most people have an easier time understanding the fundamental electrical operations with off-the-shelf parts.