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?
I just put 10K resistor between pin, and sensor output and it works. Don’t know if other method is better
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
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?
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
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?