ESP32-CAM is a board with a WiFi module based on the ESP32 system and the OV2640 camera additionally. Also the camera has a resolution of 2 MPx. Moreover the module is small in size and has a low sleep mode current. As a result ESP-32 CAM module can be widely used in various IoT applications. It is suitable for smart home appliances. Furthermore Industrial wireless control and other IoT applications too.
What distinguishes this module from others is the rather unusual use of the I2S (Inter-IC Sound) interface, most often used in audio applications. As a result use of an appropriate configuration of this interface, along with the DMA (Direct Memory Access) mechanism, relieves the processor, enabling control of received and sent data at the hardware level.
The parameters of the ESP32-C module are presented below:
- ESP32 with WiFi 802.11 b / g / n, Bluetooth 4.2 LE, built-in antenna and connector for connecting an external antenna, 32 Mbit flash memory and 4 Mbit PSRAM memory,
- microSD card connector (compatible with cards up to 4 GB),
- OV2640 camera with built-in LED lighting (the connector is also compatible with OV7670),
- 16 pins with UART, SPI, I2C and hardware PWM interfaces,
dimensions 40.5x27x4.5 mm and weighs only 10 grams.
The best option for getting started with ESP32-CAM module is use simple and user friendly Arduino IDE. For this purpose built-in library help you launch this nice piece of hardware.
After that, four files will be loaded into the environment. Before upload code to ESP32 microcontroller you must set SSIS and PASSWORD for the network. For this purpose change appriopriate line of number 18 and 19 in CameraWebServer.ino file.
const char* ssid = “PUT_YOUR_SSID_HERE”;
const char* password = “PUT_YOUR_PASSWORD_HERE”;
The next step is to comment on line 10 and uncomment line number.
#include "esp_camera.h" #include <WiFi.h> // // WARNING!!! Make sure that you have either selected ESP32 Wrover Module, // or another board which has PSRAM enabled // // Select camera model //#define CAMERA_MODEL_WROVER_KIT //#define CAMERA_MODEL_ESP_EYE //#define CAMERA_MODEL_M5STACK_PSRAM //#define CAMERA_MODEL_M5STACK_WIDE #define CAMERA_MODEL_AI_THINKER
In order to send control instructions from the Arduino IDE environment to the ESP microcontroller memory, use the UART-USB adapter.
The ESP32-CAM module requires a supply voltage of 5V and a current of 180mA (brightness LED off). Furthermore sf you intend to use additional scene lighting, the built-in white high-brightness LED requires an additional 130mA of current. Then you should provide a current of about 5V @ 310 mA.
Flashing of microcontroller
In order to upload the control software to the memory of the microcontroller, the appropriate platform must be selected. For this purpose go to Tool -> Board -> ESP32 Arduino and select AI-Thinker ESP32-CAM.
The last step is selecting the appropriate COM port for the USB-UART adapter and uploading the program (Ctrl + U).
Go to Tools -> Serial Monitor (Ctrl + Shift + M) to open the serial port monitor. After the application is loaded by the ESP32 microcontroller, the data will appear in the Serial Monitor window. Afterward, the server address http://192.168.1.91 or similar will be printed. For this reason use a web browser and go to the indicated address.
Ready! A panel with setting options for the camera and image preview will be displayed.