Learn how to upload code to the ESP32-CAM AI-Thinker board using the ESP32-CAM-MB micro USB programmer. This is the easiest way to program your ESP32-CAM board.
This micro USB programmer works like a shield that you attach to the ESP32-CAM board. The programmer comes with a USB socket that you connect directly to your computer.

The ESP32-CAM AI-Thinker module is an ESP32 development board with an OV2640 camera, microSD card support, on-board flash lamp and several GPIOs to connect peripherals. And it costs just a few bucks.
However, one of the biggest hassles when working with the ESP32-CAM Ai-Thinker module is uploading code to the board. The AI-Thinker board doesn’t have a built-in USB programmer. In previous tutorials we recommended using an FTDI programmer to connect to the board through the serial pins.
Additionally, you also needed to follow another two or three steps until successfully uploading the code. But, now you can simply use the ESP32-CAM-MB USB programmer and click the Upload button to successfully program your board. It’s that simple.
Getting the ESP32-CAM-MB USB Programmer
You can open the next link to check the available stores to get the ESP32-CAM-MB USB Programmer. The package includes the ESP32-CAM-MB Programmer and it might also include the ESP32-CAM board itself.
ESP32-CAM AI-Thinker MB Programmer
The ESP32-CAM AI-Thinker MB programmer is a shield that you attach to your ESP32-CAM board GPIOs. The following image shows the programmer and the ESP32-CAM side by side.

The programmer comes with the CH340C USB to serial chip.

This allows you to program the ESP32-CAM using the USB port on the shield.

Additionally, the shield also comes with a RESET and a BOOT (IO0) buttons. This may be useful to easily reset the ESP32-CAM or put it into flashing mode.
Program ESP32-CAM using the MB Programmer (Arduino IDE)
To program the ESP32-CAM board with Arduino IDE, you need to have Arduino IDE installed as well as the ESP32 add-on. Follow the next tutorial to install the ESP32 add-on, if you haven’t already:
Then, simply connect the MB programmer to the ESP32-CAM as shown in the following image.

Then, connect the board to your computer using a USB cable.
After that, in your Arduino-IDE, follow the next steps:
1) Go to Tools > Board and select AI-Thinker ESP32-CAM. You must have the ESP32 add-on installed. Otherwise, this board won’t show up on the Boards menu.

2) Go to Tools > Port and select the COM port the ESP32-CAM is connected to.
Note: if the board doesn’t show up, it means that you probably don’t have the CH340C drivers installed in your computer. Go to Google and search “CH340C drivers” followed by your operating system and install the drivers.
3) For demonstration purposes, you can copy the following blink sketch:
/*********
Rui Santos
Complete instructions at https://RandomNerdTutorials.com/esp32-cam-projects-ebook/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/
// ledPin refers to ESP32-CAM GPIO 4 (flashlight)
const int ledPin = 4;
void setup() {
// initialize digital pin ledPin as an output
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(2000);
digitalWrite(ledPin, LOW);
delay(2000);
}
This sketch, simply blinks the on-board flash LED.
4) Then, click the Upload button in your Arduino IDE.

And that’s it!
You should get a message saying the code was successfully uploaded and your board should be blinking the LED flash.

Wrapping Up
Using the ESP32-CAM AI-Thinker MB Programmer is the easiest way to program the ESP32-CAM board. You no longer have to use an FTDI programmer and experience timeout issues.
We hope you have found this article useful. You can try our projects with the ESP32-CAM:
- Video Streaming, Face Detection and Face Recognition
- ESP32 IP CAM – Video Streaming (Home Assistant and Node-RED)
- Take Photo and Save to MicroSD Card
- PIR Motion Detector with Photo Capture
- Take Photo, Save to SPIFFS and Display in Web Server
- ESP32-CAM Web Server with OpenCV.js: Color Detection and Tracking
- Build ESP32-CAM Projects (eBook)
- Read all our ESP32-CAM Projects, Tutorials and Guides
Thanks for reading.
hola espero pueda ayudar yo uso el USB ESP32-CAM-MB + ESP 32CAM cargo el código de prueba que enciende el led de la cámara y todo ok
pero si cargo este proyecto Transmisión de video ESP32-CAM y reconocimiento facial con Arduino IDE el código sube bien pero el resultado es este
ya probé todo y no hay manera de que funcione lo que no tengo claro es que mi ESP32CAM el modelo no creo que sea al-thinker en placa de mi esp 32 cam hay lo siguiente DM ESP32-S algún consejo ya no se que mas probar gracias
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
[E][camera.c:1049] camera_probe(): Detected camera not supported.
[E][camera.c:1249] esp_camera_init(): Camera probe failed with error 0x20004
Hi.
Have you taken a look at our troubleshooting guide:https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/?
Regards,
Sara
Tengo exactamente el mismo problema. ¿Podrías encontrar una solución?
Salute
Michael
This looks like a cool thing to have. The ESP32 cam is really good, compared to all the others that cost more. Ordered one from the eBay link.
That’s great!
With this programmer it’s very easy to upload code.
Regards,
Sara
Pues yo no soy capaz de cargar el código como verás más arriba el error
E][camera.c:1049] camera_probe(): Detected camera not supported.
[E][camera.c:1249] esp_camera_init(): Camera probe failed with error 0x20004
A very handy thing if you want to have something compact and/or do not like soldering.
Digging a bit deeper in the maze of AliExpress, there also appears to be an ESP32 camera with integrated CH340 USB connection. If you need only 1 or 2 ESP32 cams that is certainly an attractive option
Hi.
Yes, that’s a great option.
I have to search for it.
There are also other ESP32-CAM modules that also have USB connector: https://makeradvisor.com/esp32-camera-cam-boards-review-comparison/
Regards,
Sara
Good evening. So this project is precisely timed. At the beginning of January I ordered these boards, at the end of the month it came and it is waiting to be implemented. So thanks a lot. I’m just remodeling the measurement with ESP and BM680 powered by LiPo and recharged solar. But once the next project with RPi and ePaper is complete, it will be another “night service” right away. But right now, it’s just for sitting at home. The test was negative again, which I wish you both (it’s about Covid). Lots of health and good mood.
Hmmmm… I tested the board out today. The kit comes with an ESP32 camera board. I was able to upload a sketch to it using the MB board interface. Sketch worked as expected.
I was NOT able to upload a sketch to a AI Thinker Cam board using this MB board. I was able to upload the sketch to this AI Thinker Cam board using the trusty FTDI board.
I wonder if it’s possible that only THEIR included ESP32 cams work with this MB board. I’ve contacted the seller through eBay to get their guidance.
Specifically, I received the failure to connect error message:
Connecting ….. ….. …… …….
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
when I attempt to upload using the MB board to another ESP32 cam board.
Hi.
That’s weird.
Can you press the BOOT button when the dots show up?
Regards,
Sara
Pressed reset button on esp32 cam board and on the MB interface board, no success.
Hi.
Today I tried it with another ESP32-CAM board, and it didn’t upload on the first try.
I found out that you need to hold the programmer IO0 button and then press the ESP32-CAM on-board RST button when you start seeing the dots on the debugging window.
It worked for me.
Can you try it?
If it works for you too, I’ll add a troubleshooting section to this article.
Regards,
Sara
Hi Sara, thank you. I’ll attempt these button presses when I have time this weekend!
Thanks 🙂
I had success uploading a cam sketch to one of my other ESP32 cams. However, I found that after the sketch loaded, it wouldn’t run while still connected to the installer board. I tested it successfully while attached to my computer via FTDI cable. Pressing/holding IO0 and then pressing RST on the cam board was the way to go.
The board didn’t cost very much, and I got another ESP32 cam out of it. I don’t know if it will replace my FTDI process, though.
Thank you
Don
Hi Sara,
I tried out two boards I received today with the MB, but I’m not getting my two older Cam boards loades neither. The boards are a litte bit different on the side where the flash LED is locaded. It looks like that there are two more resistors installed and there is also a 3V3 print???
I trieded that out with the IO0 button, no luck.
Willem
Hi Kurt.
Try holding the IO0 button on the programmer when you start seeing the dots on the debugging window and then press and release the ESP32-CAM on-board RESET button (not the programmer RST button).
This worked for me.
Regards,
Sara
Hey Sara,
It works for me as well. I did’nt had that reset button on my radar. :-}
Willem