

The ESP32-CAM-MB is a compact development board that combines the powerful ESP32 chip with integrated Wi-Fi and Bluetooth capabilities, along with a camera module. This board is specifically designed for IoT applications, making it ideal for projects that require image capture, video streaming, or remote monitoring. Its small form factor and versatile features make it a popular choice for smart home devices, security systems, and AI-powered image recognition projects.








The ESP32-CAM-MB has a total of 16 pins. Below is the pinout and description:
| Pin | Name | Description |
|---|---|---|
| 1 | GND | Ground connection |
| 2 | 5V | Power input (5V) |
| 3 | 3.3V | Power output (3.3V) |
| 4 | GPIO0 | General-purpose I/O, used for boot mode selection |
| 5 | GPIO1 (TX) | UART TX pin, used for serial communication |
| 6 | GPIO3 (RX) | UART RX pin, used for serial communication |
| 7 | GPIO12 | General-purpose I/O, often used for LED flash control |
| 8 | GPIO13 | General-purpose I/O, often used for camera module communication |
| 9 | GPIO14 | General-purpose I/O |
| 10 | GPIO15 | General-purpose I/O |
| 11 | GPIO16 | General-purpose I/O |
| 12 | GPIO17 | General-purpose I/O |
| 13 | GPIO33 | General-purpose I/O, often used for camera module communication |
| 14 | GPIO34 | General-purpose I/O, input only |
| 15 | GPIO35 | General-purpose I/O, input only |
| 16 | RESET | Reset pin, used to restart the board |
Powering the Board:
Programming the Board:
Connecting Peripherals:
Boot Mode Selection:
Below is an example of how to use the ESP32-CAM-MB to stream video over Wi-Fi:
#include <WiFi.h>
#include <esp_camera.h>
// Replace with your network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";
// Camera configuration
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 21
#define Y4_GPIO_NUM 19
#define Y3_GPIO_NUM 18
#define Y2_GPIO_NUM 5
#define VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22
void startCameraServer();
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
// Wait for Wi-Fi connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nWi-Fi connected");
// Initialize the camera
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.pixel_format = PIXFORMAT_JPEG;
if (!esp_camera_init(&config)) {
Serial.println("Camera initialized successfully");
} else {
Serial.println("Camera initialization failed");
return;
}
startCameraServer();
Serial.println("Camera server started");
}
void loop() {
// Main loop does nothing; camera server handles requests
}
Issue: The ESP32-CAM-MB does not connect to Wi-Fi.
Solution: Double-check the SSID and password in your code. Ensure the router is within range and supports 2.4GHz Wi-Fi.
Issue: The board keeps resetting during operation.
Solution: Use a stable 5V power supply with sufficient current (at least 500mA). Avoid powering the board through weak USB ports.
Issue: The camera module is not detected.
Solution: Ensure the camera ribbon cable is securely connected. Check the camera initialization code for correct pin assignments.
Issue: The video stream is slow or laggy.
Solution: Reduce the resolution or frame rate in the code. Ensure a strong Wi-Fi signal.
Can I use the ESP32-CAM-MB without the camera module?
Yes, the board can function as a standard ESP32 development board for other IoT applications.
What is the maximum resolution of the camera?
The OV2640 camera module supports a maximum resolution of 1600x1200 pixels.
Can I power the board with a battery?
Yes, you can use a 3.7V LiPo battery with a suitable voltage regulator to provide 5V input.