Laser Pointer Triggered On/Off Switch

Remote control is commonly performed with either modulated infrared emitters or radio-frequency wireless transmitters. During a boring presentation, it occurred to me that the presenter could control a slide show by aiming their laser pointer at a list of commands with bullet-point targets. Alternatively, someone lying in bed could set the clock alarm/snooze (across the room) or turn off lights by simply aiming the laser dot at the correct spot on the desired object. This would eliminate the need to have special remotes for each manufacturer.

Left: Controlling a presentation with a laser pointer. Right: Turning on/off an alarm clock or lamp from bed.


This article demonstrates a simple circuit with two off-the-shelf logic chips to allow a laser to turn on and off an LED. Obviously, the electronics would need to be expanded to control an appliance or support additional sensors. However, this example project is perfectly functional for controlling a low-voltage DC device, such as starting a robot.

Video of Laser Pointer Control Circuit

Before diving into the schematic, it might be best to demonstrate the circuit in action with a video. Don’t worry if you don’t understand exactly how it works based on the audio commentary.

(By the way, I simplified a few of the concepts to make the video shorter. The photographs and explanations that follow are more technically accurate.)

Schematic of the Laser Pointer Sensor

The full circuit is divided into two parts for learning purposes:

  1. Detecting a laser aimed at either the “on” or “off” sensors.
  2. Setting the correct output state, and keeping that state even after the laser pointer is turned off.

Here is the first wiring diagram that handles laser detection:

A schematic showing two sensors, two trimpots, and a TI TLV3702 comparator chip.


IC1 is a comparator chip that compares the voltage across R2 (a light sensor) to the voltage across R22 (a potentiometer). When the laser hits R2, the sensor’s resistance drops, which causes the voltage across it to drop. When the laser is not targeting R2, the sensor’s resistance increases (to normal) and the voltage follows.

If the voltage of R2 is lower than R22, then the comparator chip pin 1 outputs low (0 V). If the voltage of R2 is higher than R22, then the comparator chip pin 1 outputs high (5 V). Incidentally, if you wanted the opposite result, you could just swap the inputs to pins 2 and 3.

Independently of that, IC1 also performs this voltage comparison task for the other light sensor (R1) and the other potentiometer (R12). As you can imagine, a larger comparator chip would allow more sensors to be monitored.

The potentiometers (R12 and R22) are adjustable to set the detection trip level. If ambient room lighting seems to be setting off a sensor errantly, then the voltage trip level can be lowered by rotating the screw or dial on the associated potentiometer. Conversely, if the light from a well-aimed laser isn’t being detected by the target sensor, then the voltage trip level can be raised by rotating the screw or dial in the opposite direction. Having two potentiometers allows a custom trip point for each sensor.

Both outputs of the comparator chip flow into the next circuit (which we'll discuss later in the article).

For debugging purposes, LED1 and LED2 are connected to the outputs to turn on when the laser hits the associated sensor. Unfortunately, the TLV3702 comparator chip is not designed to deliver enough output current to control an LED directly. To compensate, I’ve selected a pair of high-efficiency, ultra-bright LEDs and fairly high resistor values (2200 ohms).

If you choose poor-quality LEDs, then you won’t see them light up. If you install standard LED resistors (330 ohms), then the outputs won’t be able to successfully communicate with the next circuit.

Sneaky Series Sensors Split Svoltage

This circuit includes an auto-brightness feature. As you can see in the schematic, R1 and R2 are connected together (ignore R3 for the moment). This forces them to constantly divide the 5 V between them.

When the room is dark, assume R1=100000 ohm and R2=100000 ohm. Since they are equal, they both get 2.5 V (equally split 5 V). When the room is light, assume R1=500 ohm and R2=500 ohm. Again, since they are equal, the both get 2.5 V (equally split 5 V). In the example cases, the voltage is always 2.5. The room brightness does not affect the voltage readings!

Compare that situation to when sensors are connected to their own voltage sources (putting them in parallel). When the room is dark, they will both have high resistances and receive most of their 5V source, say 4.9V. When the room is bright, they will both have low resistances and receive little of their 5V source, say 0.1V. Because they aren’t sharing/splitting/dividing the voltage between them, their voltage changes from 0.1V to 4.9V based on the room lighting, instead of a steady 2.5V.

Forcing the sensors to share the same voltage source (putting them in series) means the only time their voltages differ is when one receives a different amount of light than the other. This occurs when one sensor is targeted by the bright laser. Pitting the sensors against each other changes the circuit from an absolute light measurement to a relative light measurement.

What about R3?

R3 is a fixed resistor that prevents too much current from passing through the sensors in the event the room is very well lit or some jerk aims a powerful laser at both sensors. For example, if both R1 and R2 were only 10 ohms, then 250 mA would pass through the sensors.

5V / (10Ω + 10Ω) = 0.250 A

In this type of configuration, the resistor is called a “current limiter”. Think of R3 as an emergency brake.

Furthermore, R3 saves power because it lowers the idle current to less than 5 mA. This isn’t a perfect solution though, as R3 also competes with the sensors for voltage, meaning it will cause detection errors under very bright conditions.

Why a Texas Instruments TLV3702 Comparator?

This circuit won’t work with old-fashioned comparators for two reasons.

Reason #1: Needs Full Input Range

Sensor R1, potentiometer R12, and the comparator are all connected to 5V. Therefore, the comparator needs to be able to measure voltages up to 5V. Sadly, older comparators could not make comparisons in the top 1.5V of their supply voltage (which would limit the inputs to 5V - 1.5V = 3.5V in that case).

Newer comparators that overcome this limitation are said to have “rail to rail” inputs. That is, they can do comparisons on voltages from the low rail (0V) to the high rail (5V or whatever the comparator supply is).

Reason #2: Needs to Output Both Low and High

Another characteristic of older comparators was an open collector output. This meant that they could only produce either 0V or disconnected on their output. You were required to include a pull-up resistor to convert the disconnected state into the desired voltage for a “high” state. Believe it or not, this was an intentional feature that allowed a comparator with 16V power supply (or whatever) to connect to logic-level voltages (such as 3.3V or 5V).

Newer comparators are available with either open collectors (needs a resistor) or push-pull (no resistor needed). The TLV3702 has push-pull outputs, eliminating the need for additional resistors in this circuit.

Although not relevant to the laser circuit, the TLV3702 has many other fine features. Such as:

These features come at a cost. The TLV3702 costs $2.25, whereas the classic old LM393 (used in Sandwich) costs $0.39.

Now that we know how to detect when a laser hits a sensor, let’s see how we remember that state when the laser is turned off or aimed away.