Capture Photos With Esp32-cam, SD Card With Motion Detection

by CarlosVoltT in Circuits > Microcontrollers

326 Views, 1 Favorites, 0 Comments

Capture Photos With Esp32-cam, SD Card With Motion Detection

IMG_20231022_165641122-820x615.jpg

In this exciting tutorial, we'll show you how to build your own security camera using an ESP32-CAM and an AM312 PIR sensor to detect motion.

more info and updates in https://rogerbit.com/wprb/2023/10/captura-con-esp32/

In this exciting tutorial, we'll show you how to build your own security camera using an ESP32-CAM and an AM312 PIR sensor to detect motion. Best of all, the photos will be saved directly to an SD card!

Throughout this video, we will guide you through the following steps:

  • Hardware Connection: We will show you how to connect the ESP32-CAM and the AM312 PIR sensor to your breadboard, ensuring proper power supply.
  • Arduino IDE Setup: You will learn how to set up the development environment in Arduino IDE to work with the ESP32-CAM and select the appropriate board.
  • Programming: We will provide you with the code needed to configure the ESP32-CAM and program it to capture images when motion is detected. We will also show you how to store the images on an SD card.
  • Real-Life Test: You will see our motion detection system in action. We will test it in a real-life environment so you can see how it works.
  • Tips & Customization: We'll share some helpful tips and show you how to customize and extend this project to your needs.

This project is perfect for creating an affordable and functional security camera for your home, office, or anywhere you want to monitor.

Electronic components

Usb serial adapter

Description

FTDI Basic Program Downloader USB to TTL FT232RL 3.3V 5V DTR

This is a basic breakout board for the FTDI FT232RL USB to Serial IC. The pinout of this board matches the FTDI cable to work with official Arduino boards and cloned 5V Arduino boards. It can also be used for general serial applications. The main difference with this board is that it brings out the DTR pin instead of the RTS pin on the FTDI cable. The DTR pin allows an Arduino target to automatically reset when a new Sketch is downloaded. This is a really nice feature and allows a sketch to be downloaded without having to press the reset button. This board will automatically reset any Arduino board that has the reset pin on a 6 pin connector.This board has TX and RX LEDs which make it a bit nicer to use over the FTDI cable. You can actually see the serial traffic on the LEDs to check if the board is working.This board was designed to decrease the cost of Arduino development and increase ease of use (the auto reset feature is great!). Our Arduino Pro boards and LilyPads use this type of connector.One of the nice features of this board is a jumper on the back of the board that allows the board to be configured to either 3.3V or 5V (both power output and I/O level). This board ships at 5V by default, but you can cut off the default trace and add a solder jumper if you need to switch to 3.3V.

CHARACTERISTICS

  • Standard interface design, compatible with a variety of Arduinos such as the Pro Mini
  • Original FTDI FT232 chip, stable performance
  • With power indicator, sending, receiving, working status LED indicators
  • With 3.3V and 5V TTL level supply options
  • USB to Serial TTL Module, Download STC SCM
  • Mini USB port connection
  • Standard interface, compliant with Arduino official controller; With power, sending, reversing indicator, With 3.3V / 5V power supply; Can be used as ordinary USB to serial TTL module, download STC singlechip

Hardware introduction

  • Adopt FTDI company's FT232RL chip
  • Lead out FT232RL chip all signal port, TTL / CMOS level
  • RXD/TXD send-receive communication indicator
  • USB power supply, can choose 5V or 3.3V interface level (if you need other level, can provide target voltage in VCC and GND pin)

Dupont cables

Esp32Cam


Description

Esp32 Cam Camera Module Wifi Bt Arduino Ov2640 2mp Esp 32

ESP32 CAM WiFi Module with Bluetooth and OV2640 2MP Camera is a development board that integrates a small camera that can work independently.The OV2640 2MP camera integrates a 1/4-inch UXGA (1632*1232) CMOS image sensor. The small sensor size and low operating voltage provide all the features of a single UXGA camera and image processor. Through SCCB bus control, it can output 8/10-bit image data of various resolutions such as full frame, subsampling, zoom, and windowing.The UXGA image of this camera can reach up to 15 frames per second (up to 30 frames for SVGA and 60 frames for CIF). Users have complete control over image quality, data format, and transmission.All image processing functions including gamma curve, white balance, contrast, chroma, etc. can be programmed through the SCCB interface.Omni Vision image sensors use unique sensor technology to improve image quality and deliver sharp, stable color images by reducing or eliminating optical or electronic artifacts such as fixed pattern noise, smearing and floating.

Main Features:• Model: ESP32-CAM + OV2640 Camera• ESP 32 CAM power supply voltage: 5V• Wi-Fi BT 802.11b/g/n module• Camera type: OV2640 2MP• ESP 32CAM module has low-power dual-core 32-bit CPU• Main frequency up to 240MHz• Computing power up to 600 DMIPS• Clock speed up to 160MHz• Built-in 520Kb SRAM, 4MPSRAM external• ESP-32 CAM module supports interfaces: UART / SPI / I2C / PWM / ADC / DAC• ESP-32-CAM module supports OV2640 and OV7670 cameras, Built-in Flash• ESP 32-CAM module supports micro SD TF cards (Maximum 4GB)• ESP-32CAM module Supports WiFi image upload• Compatible with STA / AP / STA+AP operation modes• With PCB antenna• The ESP32CAM module integrates u.FL and FPC connectors

Features:– Ultra-small 802.11b/g/n Wi-Fi + BT/BLE SoC module– Low-power dual-core 32-bit CPU for application processors– Up to 240MHz, up to 600 DMIPS– Built-in 520 KB SRAM, external 4M PSRAM– Supports interfaces such as UART/SPI/I2C/PWM/ADC/DAC– Support OV2640 and OV7670 cameras with built-in flash– Support for images WiFI upload-Support TF card– Support multiple sleep modes– Embedded Lwip and FreeRTOS– Support STA/AP/STA+AP working mode– Support Smart Config/AirKiss One-click distribution network– Support for serial local upgrade and remote firmware upgrade (FOTA)– Support secondary development

Product Specifications:Module model: ESP32-CAMPackage: DIP-16Size: 27*40.5*4.5(±0.2)mmSPI Flash: default 32MbitRAM: internal520KB+external 4M PSRAMbluetooth: bluetooth4.2BR/EDR and BLE standardsWi-Fi: 802.11 b/g/n/e/iSupport interface: UART, SPI, I2C, PWMSupport TF card: Maximum support 4GIO port: 9Serial port rate: default 115200 bpsImage output format: JPEG (only supported by OV2640), BMP, GRAYSCALESpectrum range: 2412 ~ 2484MHzAntenna form: onboard PCB antenna, gain 2dBiTransmit power: 802.11b: 17±2 dBm (@11Mbps)802.11g: 14±2 dBm (@54Mbps)802.11n: 13±2 dBm (@MCS7)Receiving sensitivity: CCK, 1 Mbps : -90dBmCCK, 11 Mbps: -85dBm6 Mbps (1/2 BPSK): -88dBm54 Mbps (3/4 64-QAM): -70dBmMCS7 (65 Mbps, 72.2 Mbps): -67dBmPower consumption Turn off the flash: 180mA@5VTurn on the flash and adjust the brightness to the maximum: 310mA@5VDeep-sleep: The lowest power consumption can reach 6mA@5VModerm-sleep: up to 20mA@5VLight-sleep: up to 6.7mA@5VSecurity WPA/WPA2/WPA2-Enterprise/WPSPower supply range: 5VOperating Temperature: -20 °C ~ 85 °CStorage environment: -40 °C ~ 90 °C, < 90%RH

A Jumper

Female Pines


Male pins


AM312 Mini PIR Motion Sensor 12V DC


  • Type: Mini PIR Sensor
  • Model: AM312
  • Input voltage: 2.7V to 12V DC
  • Static power consumption: < 0.1mA
  • Output voltage VOUT: 3.3V (Enabled) / 0V (Not enabled)
  • Detection range: ≤100 degree cone angle
  • Detection distance: 3 to 5 meters approx.
  • Delay/Lockout Time: 2 seconds
  • Shooting Mode: Repeatable
  • Dimensions: 10.5mm x 8.2mm
  • Lens Size: 11.8mm (Diameter)
  • Weight: 2g

Pins:

  • VCC: Power supply (+) terminal
  • GND: Power supply (-) terminal
  • VOUT: Digital Output

A 10K resistor


PCB


Circuit