ohmio

Circuits / Sensors

Arduino UNO: a laser and a light sensor

A pin switches the laser through a transistor (the module takes about 28 mA and a UNO pin is recommended up to 20 mA, 40 mA at most); its light adds to the room's at the photoresistor, so the reading on A0 rises while it is on and falls back when it is off

Arduino UNO: a laser and a light sensor, simulated on a breadboard

Tap a part to see its voltages and currents. It is a model, not a measurement.

What do you need?

The AliExpress links are affiliate links: if you buy through them ohmio.dev gets a commission, at no extra cost to you. Affiliate links

This page is a guide: the numbers come from a simulation, and real parts vary. Check your parts before you power the circuit. Safety and responsibility

How does an Arduino switch a laser on and read its light?

The UNO blinks a KY-008 laser at 1 Hz and reads a photoresistor on A0. The laser draws 27 mA in this model, more than the 20 mA recommended for one UNO pin, so D7 does not power it. D7 sends 4.1 mA through R2 (1 kΩ) into the base of a 2N3904, and the transistor carries the laser's current from the 5 V pin. The GL5528 photoresistor and a 10 kΩ resistor form a divider, and analogRead turns A0 into a number from 0 to 1023. In a 50 lx room the monitor prints off A0=689; with the laser lighting the sensor it prints on A0=1009. Cut the beam and both lines read 689. The model lights the sensor with no aiming; a real beam is a small dot and must hit the photoresistor. Never point the laser at eyes or at mirrors.

Values from the Protoboard ISO simulation: a model, not a bench measurement.