Home security cameras using ESP32 camera

Spread the love

The ESP32 camera module is a powerful Camera module. This article deeply discusses the ESP32 cam module and set up a video streaming server and use it as a Home Security Camera. We already know how to program ESP8266 nodemcu.

Introduction to ESP32 Camera

The camera breakout board is based on ESP32-s WI-Fi enabled microcontroller. It has a TF card Holder you can attach a memory card to take photos and video recording.

Breakout board

Specification

  • The smallest 802.11b/g/n Wi-Fi BT SoC module.
  • Low power 32-bit CPU, can also serve the application processor.
  • Up to 160MHz clock speed, summary computing power up to 600 DMIPS.
  • Built-in 520 KB SRAM, external 4MPSRAM.
  • Supports UART/SPI/I2C/PWM/ADC/DAC.
  • Support OV2640 and OV7670 cameras, built-in flash lamp.
  • Image WiFI upload.
  • TF card.
  • Supports multiple sleep modes.
  • Embedded Lwip and FreeRTOS.
  • Supports STA/AP/STA+AP operation mode.
  • Support Smart Config/AirKiss technology.
  • Support for serial port local and remote firmware upgrades (FOTA).

Pin out

The ESP32 camera has a total of 10 GPIO it works with 3.3v and 5v both. I recommend 5V for operation.

Pin out

Material Required

HardwareQuantity
ESP32-Cam module1
FTDI programmer1
Jumper wiresAPR
SoftwareLink
Arduino IDEClick Here!

Hardware setup and connection of ESP32 camera

ESP32 doesn’t have an onboard FTDI programmer. We required an FTDI programmer to program the board.

FTDIESP32-CAM
TXUDR
RXUDT
IO0GND
3.3V3.3v
GNDGND
Connection

Software Setup

We already know how to install the Arduino IDE and set up it. Here we will only focus to add ESP32 board in IDE and program it.

  • Go to file and click on Preferences.
preferences
  • Copy the following link and paste it in additional Board manager URLs. This link contain esp32 and esp8266 boards links. If you have any other board URL so put a comma(,) and then paste the link.
https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
url addition
  • Then go to Tools Board and open Board Manager. Open it to download the board and install.
board manager
  • Type in Search bar esp32 and install the first option ESP32 by Espressif Systems. In my case, it is already installed.
ESP32 camera
  • Lets Open a example code to test everything is okay. Go to File, Examples, ESP32, Camera, and CameraWebServer.
ESP32 camera
  • The Camera webserver example will open. Here we need to modify a few things. Commend the #define CAMERA_MODEL_WROVER_KIT and uncomment the #define CAMERA_MODEL_AI_THINKER. Also, change the SSID and password of your Wi-Fi network. Connect the FTDI with computer and press reset to enable the flash mode.
ESP32 camera code
  • Then again go to Tools board and search for ESP32 Wrover Module. Be careful and chose the correct board. Then upload the code. In case you got any error change upload speed to “256000“, Flash Frequency to “80Mhz“, Flash ModeQIO” and Partition SchemeHuge APP(3MB No OTA/1MB SPIFFS)) “.
ESP32 camera
  • After upload removes the jumper wire between GND and IO0 open serial monitor and presses the reset button. It will disable the flash mode and it will connect to your wi-fi and it prints the connected IP Adress.
ESP32 camera

Browser Setup for ESP32 camera

Copy the HTTP link and paste it to your browser. If you got this page your ESP cam setup is done. Insert an SD card and start recording and your wireless security cameras are ready to use. Install this to your door and CCTV security cameras are ready. You can open this page on mobile phones simply copy the same URLs and paste in a mobile browsers. Now you can access your wireless security cameras using a mobile phones.

home security cameras

Error and correction

E][camera.c:1049] camera_probe(): Detected camera not supported.
[E][camera.c:1249] esp_camera_init(): Camera probe failed with error 0x20004

If you get above error use separate 5v power supply and make sure to change the board to #define CAMERA_MODEL_AI_THINKER and make exact settings I did in the screenshot.

Add a Comment

Your email address will not be published. Required fields are marked *