• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 Cam PIR sensor, what if the sensor is active low?

Q&A Forum › Category: ESP32 › ESP32 Cam PIR sensor, what if the sensor is active low?
0 Vote Up Vote Down
Peerajak Witoonchart asked 5 years ago

PIR sensor in the example 
https://randomnerdtutorials.com/esp32-cam-pir-motion-detector-photo-capture/
are active high. Meaning that it will normally stay low, until detection occurred, and switch to high.
 
However, I got another type of sensor whose narmally stay high, until detection occured and switch to low. How can I change my circuit for that?

Question Tags: ESP32-Cam, PIR sensor
6 Answers
0 Vote Up Vote Down
Peerajak Witoonchart answered 5 years ago

I​ just​ put 10K resistor​ between​ pin, and​ sensor​ output and​ it​ works.​ Don’t​ know​ if​ other​ method​ is​ better

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
Alternatively, in your code, you can use:

esp_sleep_enable_ext0_wakeup(GPIO_NUM_13, 1);

instead of

esp_sleep_enable_ext0_wakeup(GPIO_NUM_13, 0);

Regards,
Sara

0 Vote Up Vote Down
Peerajak Witoonchart answered 5 years ago

Hi Thank you Sara. This is a much better alternative so that the same circuit can serve two different type of sensors.

I have a question.  Why does the GPIO num 13 has default HIGH ?
I try to find the code where it says GPIO num 13 default to HIGH.
If I want default LOW, how can I do?


 

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
It is default HIGH, because it is how the ESP32-CAM is internally connected.
Take a look at the ESP32-CAM schematic diagram here: https://github.com/SeeedDocument/forum_doc/blob/master/reg/ESP32_CAM_V1.6.pdf
Regards,
Sara

0 Vote Up Vote Down
Peerajak Witoonchart answered 5 years ago

Hi, Thank you for your fast reply.
Please see if I understand the schematic correctly.
Those with label HS2_data3 are electrically connected. Since GPIO13 is electrically connected to a 47K ohm resister and 3.3V, it is pulled high.
Am I correct?

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Yes, that’s right.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.