Circuits / Sensors
PIR motion sensor lights a lamp
A PIR module holds OUT high for its delay after motion and then rests; OUT is too weak for a lamp, so it drives a transistor that carries the LED's current

Tap a part to see its voltages and currents. It is a model, not a measurement.
What do you need?
- PIR motion sensor HC-SR501AliExpress Amazon
- Resistor 4.7 kΩAliExpress Amazon
- Bipolar transistor 2N2222AAliExpress Amazon
- Resistor 330 ΩAliExpress Amazon
- Yellow LEDAliExpress Amazon
- Jumper wires × 7AliExpress Amazon
- BreadboardAliExpress Amazon
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 a PIR sensor turn on a lamp?
A PIR module senses the heat of a moving body. When it sees motion it raises its OUT pin to 3.3 V and keeps it there for a set delay, 5 s after the last movement here, then lets go. At rest OUT is at 0 V and the module draws only about 65 µA in this model. OUT is a weak output, about 500 Ω behind 3.3 V in this model, so it cannot feed a lamp. Instead it drives the base of a 2N2222A through R1 (4.7 kΩ): about 0.5 mA, with OUT sagging to 3.05 V. The transistor saturates, with 0.04 V across it, and carries the lamp: 9.1 mA through R2 (330 Ω) and the yellow LED. When the delay ends, the lamp goes out. A real module needs about a minute after power-up to settle and may fire falsely meanwhile; this model starts already warm.
Values from the Protoboard ISO simulation: a model, not a bench measurement.
Hear about the next circuit
One email when a new circuit is out, about twice a month. Nothing else.