ohmio

Circuits / Sensors

Arduino UNO: PIR motion detector

A PIR's OUT is a plain digital level: the program watches for its rising edge and prints the time of each new motion with millis(). A real module needs about a minute to warm up and may fire falsely meanwhile (the recipe starts already warm); its shortest delay is about 2.5 s

Arduino UNO: PIR motion detector, 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 know that someone moved in front of a PIR sensor?

The PIR module does the hard part. It senses the heat of a moving body and sets OUT high, 3.3 V in this model, for the delay you choose, 5 s here. D2 reads that as an ordinary HIGH: an UNO on 5 V accepts anything above 3.0 V (0.6 × VCC), and at rest D2 sits at 0 V. The program does not watch the level but the change. It remembers the last reading and prints only when D2 goes from LOW to HIGH, with millis(), the milliseconds since power-up. In the model, motion at 1 s prints MOTION at 1020 ms, and a person who keeps moving holds OUT high and prints once. In a real build, the 0.3 V margin over the 3.0 V is small but normal for these modules, and the module needs about a minute to warm up: ignore the MOTION lines it prints meanwhile.

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