We have already published about the WiFi module for Arduino another time, but this time it's about the module ESP32-CAM, an ESP32 WiFi module with a small built-in video camera. This allows new functions, such as surveillance or remote espionage, capturing everything that happens when you are not there and sending it to any device for recording or to be able to see on-site.
Almost everything said for the WiFi module that we already discussed, would be valid for this one, only that it has some small peculiarities in addition to the integrated camera. But everything you need to know we are going to show you in this guide ...
Table of Contents
What is ESP32-CAM?
El ESP32-CAM It is a module that you can use with a multitude of projects, and with Arduino. It is a complete module with an integrated microcontroller, which can make it work independently. In addition to WiFi + Bluetooth connectivity, this module also has an integrated video camera, and a microSD slot for storage.
This module is not expensive at all, and you can have multitude of applications. From some simple IoT, to other more advanced ones for monitoring and image recognition using AI, and even as a surveillance system to check what happens in a place remotely wherever you are ...
The ESP32-CAM module is not expensive at all, as I said, for a few euros you can have one. And you can easily find it in some specialized stores or on Amazon. For example, here are some recommendations at a good price:
- ESP32-CAM module
- Two ESP32-CAM units to mount a multipoint surveillance device.
- ESP32-CAM with antenna 8 dBi dual band and cable for greater coverage range.
- If you already have an ESP32 module and want just the camera, you can buy it separately.
- And if you prefer it more complete to work with USB: ESP32-CAM + FTDI module.
As you can see, it is not expensive ...
Technical characteristics of ESP32-CAM (datasheet)
The ESP32-CAM module has some technical characteristics very interesting that you can see in the datasheet manufacturer. Here I summarize the most important ones:
- Connectivity: WiFi 802.11b / g / n + Bluetooth 4.2 with BLE. Supports image upload via WiFi.
- Connections: UART, SPI, I2Cand PWM. It has 9 GPIO pins.
- Clock frequency: up to 160Mhz.
- Microcontroller computing power: up to 600 DMIPS.
- Memory: 520KB of SRAM + 4MB of PSRAM + SD card slot
- EXTRAS: has multiple sleep modes, firmware upgradeable by OTA, and LEDs for use of built-in flash memory.
- Camera: Supports OV2640 cameras that can come in the pack or be purchased independently. These types of cameras have:
- 2 MP on your sensor
- 1622 × 1200 px UXGA array size
- Output format YUV422, YUV420, RGB565, RGB555 and 8-bit data compression.
- You can transfer image between 15 and 60 FPS.
El Pinout of the ESP32-CAM is very simple, as you can see in the previous diagram. And the camera is connected to the connector that is enabled for it. Later, with the example of Arduino, you will better understand how it is connected and what each one is for, although you can already get an idea.By the way, although it does not appear in the image, they also usually have a round connector on the PCB that is used to connect external antenna cables in some cases. It is usually next to the sheet metal of the SD socket.
You can use a FTDI external adapter to connect this module and make it easier for you to control it. This allows the use of a miniUSB type port instead of the ESP32-CAM wiring. To use one of these modules, you can connect it like this:
- Configure the FTDI module to work at 3.3v.
- Jumper the GPIO pin 0 and GND of the ESP32-CAM module.
- The 3v3 pin of the module must be connected to Vcc of the FTDI.
- The GPIO 3 (UOR) of the module will go to the TX of the FTDI.
- GPIO 1 (U0T) of the module goes to RX of the FTDI.
- And the other GND of the ESP32-CAM with GND of the FTDI module.
Now you have one USB type interface, which can facilitate the connection of your project ...
Integration with Arduino IDE
To integrate with FTDI, the connection is very simple. You just have to do the following:
- Connect the 5v connection of the ESP32-CAM module to the Vcc of the FTDI module.
- Connect GND of the ESP32-CAM module to GND of the FTDI module.
- TX0 from the FTDI board goes to GPIO 3 (U0RXD).
- RXI from the FTDI board goes to GPIO 1 (U0TXD).
- And bypasses GPI0 and GND of ESP32-CAM board.
Now you can connect it to the computer using a USB cable through the FTDI module. Another option is connect it to arduino directly, without using the FTDI module. But let's see the case with the FTDI which is better for most of the cases ...
The steps to follow to configure and schedule everything to work:
- In order to upload code to the board, you have to connect USB to your PC.
- The next step is to install the ESP32 library to be able to take advantage of this one. For that, from the Arduino IDE go to File> Preferences> There, in the field to add URL, add: https://dl.espressif.com/dl/package_esp32_index.json and click OK. Now go to Tools> Board> Board Manager> search for ESP32 and press install "ESP32 by Espressif Systems".
- Then open Arduino IDE > Tools> Boards> select AI-Thinker ESP32-CAM (you must have the ESP32 addon installed for this option to appear in the menu). Then go to Tools> Port and select COM, where your board is connected.
- Now you can upload a sketch on the board, to keep it simple, use one of the examples see File> Example> ESP32> Camera> CameraWebServer. Once done, when the message that it was loaded successfully appears, remove the cable from the GPIO pin 0 of GND and press the Reset button on the board.
- Finally, you can use and start see the results in the web interface ... When you run it, it will give you on the monitor a URL with an IP that you must insert in your web browser to access. From it you can adjust parameters and see what is seen from the camera sensor.
Obviously, you can do much more taking advantage of the WiFi and Bluetooth capabilities of this module. Remember that the limit is your imagination. Here I simply show you a simple introduction ...
More information - Free Arduino course