Comments on: ESP32 with PIR Motion Sensor using Interrupts and Timers (Arduino IDE) https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Tue, 16 Dec 2025 07:45:55 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: surya https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-1138432 Tue, 16 Dec 2025 07:45:55 +0000 http://randomnerdtutorials.com/?p=68479#comment-1138432 In reply to Shunt1.

Can you share the solution for that. I’m also facing issues wifi with PIR sensor. PIR is always high

]]>
By: Marcio https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-1127811 Wed, 26 Nov 2025 23:44:46 +0000 http://randomnerdtutorials.com/?p=68479#comment-1127811 Question: If the voltage specification for the AM312 Mini PIR Presence Sensor is 2.7-12VDC, why did you connect it to 3.3 volts? Could you use other voltages?

]]>
By: Sofien https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-1111486 Sun, 19 Oct 2025 19:38:15 +0000 http://randomnerdtutorials.com/?p=68479#comment-1111486 Hi Sara;
There’s something I don’t understand: why put a pin at the input with a pull-up to detect a rising state? The sensor gives a high signal when it’s detected, we know that, but what if, on the contrary, the sensor has an open drain when it’s idle?
(excuse my english)

// PIR Motion Sensor mode INPUT_PULLUP
pinMode(motionSensor, INPUT_PULLUP);
// Set motionSensor pin as interrupt, assign interrupt function and set RISING mode
attachInterrupt(digitalPinToInterrupt(motionSensor), detectsMovement, RISING);

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-1101464 Wed, 24 Sep 2025 19:28:27 +0000 http://randomnerdtutorials.com/?p=68479#comment-1101464 In reply to Joe.

That’s great.
Thank you so much for supporting our work.
We really appreciate it.

regards,
Sara

]]>
By: Joe https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-1100365 Sun, 21 Sep 2025 14:11:43 +0000 http://randomnerdtutorials.com/?p=68479#comment-1100365 Dear Sara & Rui,
I thank you fine folks for sharing your knowledge with us.
I have followed you for several years and have bought all of your books. Amazing.
Well written and easy to follow along.
Thank you.
Best regards,
Joe

]]>
By: Lily https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-1000223 Thu, 16 Jan 2025 03:10:30 +0000 http://randomnerdtutorials.com/?p=68479#comment-1000223 Hi sarah, we would like to do an IoT project exactly like the one you mentioned, but we want to add buzzer and use blynk for notifications, do you might know how to do it ?
Best regards,
Lily

]]>
By: Hans https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-997031 Sat, 04 Jan 2025 09:36:12 +0000 http://randomnerdtutorials.com/?p=68479#comment-997031 In reply to Sara Santos.

Hi Sara,
Thx, I’ll give it go..
grtz Hans

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-996821 Fri, 03 Jan 2025 16:56:49 +0000 http://randomnerdtutorials.com/?p=68479#comment-996821 In reply to Hans.

Hi.
Take a look at this web server with sensor readings. Instead of the sensor readings, you’ll display the counter variable: https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/
However, this kind of web server is a bit advanced for just displaying the counter.
Regards,
Sara

]]>
By: Hans https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-996811 Fri, 03 Jan 2025 15:30:28 +0000 http://randomnerdtutorials.com/?p=68479#comment-996811 Hi Sara,
First Happy Newyear!!
Currently I’m working on a birdhouse with webcamera for my little son.
I want to use the PIR code for bird detection in a “counter” ( instead of your LED). Just to detect if there is any activity in the birdhouse.
I want to run your PIR code together with the “ESP32-CAM Video Streaming Web Server” and have the “counter” value represented in the camera webserver-website…
Main headache for now is how to handover the “counter” value to the camera webserver. Any idea how to accomplish this?
THX for your reply.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-pir-motion-sensor-interrupts-timers/#comment-899966 Thu, 21 Mar 2024 10:46:34 +0000 http://randomnerdtutorials.com/?p=68479#comment-899966 In reply to sudhanshu.

Hi.
We’re using GPIO 27. But, you can use any other suitable GPIO.
Check the ESP32 pinout: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
Regards,
Sara

]]>