Motion Triggers Image Capture and Email

by psp50 in Circuits > Arduino

1517 Views, 7 Favorites, 0 Comments

Motion Triggers Image Capture and Email

61nmVriJ2BL.__AC_SX300_SY300_QL70_ML2_.jpg

We have developed a motion-triggered picture taking system that can also send an email with the image attached as an attachment.

We build on the earlier ESP32-CAM projects, and create an image-capturing system that is motion-triggered which also sends emails with images attached as an attachment. This build utilizes the ESP32-CAM board and the PIR sensor which is based off the AM312 sensor. The board is able to spend the majority of time sleeping and awakes to capture an image when the motion is detected. In Part 1 we alter the sketch that was previously created to include the motion detection feature.


Supplies

image-removebg-preview.png

The ESP32-CAM board already has camera modules, as well as a microSD card slot, which we require to upload this sketch. To complete the sketch you'll require microSD cards as well as a PIR sensor module (based on AM312 sensors) as well as general purpose NPN transistor (BC547, BC548, BC549 or 2N3904) and the microUSB breakout board with a 10K Ohm as well as a 1K Ohm resistor as well as an USB for serial conversion that allows you to upload the sketch.

ESP32 camera

PIR Sensor

CP2102 USB to TTL

BC547

Memory card 16GB

Code Upload

vlcsnap-2019-11-24-14h04m29s781_bsywBf9G2Z.jpg

The ESP32-CAM does not come with any onboard USB connector. Therefore, you have to connect another external USB to serial converter to upload your sketch. You can connect it using the wiring connections mentioned above, but ensure that your USB serial converter you are using is to the 3.3V mode.

It is suggested to make use of an external 5V source to charge the board, especially when you're using the FTDI breakout board. If you are using an external 5V source you can use a standard USB breakout board should work well. There have been some successes when connecting the board directly to an CP2102 breakout board, so you could try it out. The board also comes with an 3.3Vpower pin, should you require it.

The jumper is required in order to switch the board into the downloading mode. Once everything is connected, power on the board, then open the Serial terminal (Tools->Serial Monitor) with a speed of 200, 115, and hit on the reset switch. It should produce an output like the one in the picture and it will show that everything is functioning exactly as you expect.

The sketch can be downloaded via the link at the in the bottom of this article.


Connections

image-removebg-preview (1).png

Make the circuit with an Arduino and then test it to ensure that everything functions according to plan. I used a multimeter on the output of the final sensor to determine the state of the circuit. Once you're pleased with the results then move to step 2.

Final Words

It will send you mail when the PIR sensor detects object. Pir sensor will ditact object and send signal to the ESP32 cam at same time ESP32 cam will process and capture the photo and mail that photo to the email address. make sure change email creditional in code.


If you are using gmail then you need to read this

https://support.google.com/mail/answer/7126229?hl=en#zippy=%2Cstep-check-that-imap-is-turned-on%2Cstep-change-smtp-other-settings-in-your-email-client


you have to allow the less secure apps.