
I have designed numerous home automation PCBs based on the ESP32 chip. To reduce costs, I did not include a programming circuit on these boards. Therefore, to flash the program into the ESP32 chip, an external programming circuit is required, or alternatively, an ESP32 development board can be used.
To simplify this process, I designed an ESP Programmer module. This module allows you to program any ESP chip or module effortlessly, not just the ESP32 chip.
The ESP Programmer module is based on the CP2102N USB-to-UART bridge controller and features a Type-C connector. This enables direct connection to a computer for easy programming of ESP chips and modules. The module is also very compact, measuring only 20mm by 35mm.
In this article, I will explain all these details in depth. I will cover the schematic of this module, the features and specifications of the CP2102N USB-to-UART chip, and demonstrate how to flash code onto popular ESP chips and modules, including the ESP CAM Module, ESP32 chip, ESP-01 Module, and ESP8266 chip.
The CP2102N is a highly integrated USB-to-UART bridge controller, providing a simple solution for updating RS-232 designs to USB with minimal components and PCB space.
The ESP Programmer Schematic outlines the design of an ESP programmer using the CP2102N USB-to-UART bridge. Let’s break down the key components and their functions:
USB to UART Converter (CP2102N – U5)
Indicators
Additional Components
1. Power Supply:
2. USB to UART Communication:
3.Control and Programming:
4. Status Indicators:
This schematic allows for programming an ESP chip via a USB connection, using the CP2102N to handle the serial communication. The various headers and components ensure stable power delivery, proper signal levels, and status indication for successful programming.
After finalizing the schematic, I designed a custom PCB for it. I then placed an order with JLCPCB for PCB manufacturing.
select the quantity and color masking, and then click on “save to cart” to complete your order.
After five days, I received my PCB in very good packaging. As usual, the quality of the PCB was premium, and it looked very professional. The red color PCB looked particularly beautiful.
Now let’s try to upload the code to ESP boards using this ESP Programmer module. First, I will upload the code to the ESP32 CAM Module. Follow the connection diagram to connect the ESP Programmer module to the ESP32 CAM Module, and make sure to connect the GPIO 0 pin to GND (pull down the GPIO 0). Then, connect the ESP Programmer module to your computer via a Type-C cable.
Open Arduino IDE and go to Tools > Boards. Navigate to and select the AI-thinker ESP32 CAM. Then, go to Tools again and select the right port, which will be shown as SLAB USB TO UART. If it does not show up, you need to install the CP2102N driver on your computer. The driver link for both iOS and Windows is available in the description. Just download and install it.
Here, I will upload a simple blink sketch in which the built-in LED will blink every second. In the ESP32 CAM Module, the built-in LED is connected to pin number 4, so change the built-in LED to GPIO 4. Now, hit the upload button.
After clicking the upload button, press the reset button on the ESP32 CAM Module. Let’s see if the code uploads correctly.
Once uploaded, remove the wires and press the reset button once. You should see the onboard LED blinking every second, indicating that our ESP Programmer module is working fine.
Next, let’s try to flash code to another ESP board. I will upload the code to the ESP32 chip, which is a very popular ESP chip. Although I don’t have a separate ESP32 chip, I do have a home-automation PCB with an ESP32 chip on it. Here is the connection diagram for connecting the ESP Programmer module to the ESP32 chip.
Connect your ESP32 chip to the ESP Programmer module according to this diagram. One important note: if you are using an external power supply or your ESP board is connected to another power supply, upload the code without connecting VCC wires to the ESP Programmer module. Otherwise, connect the wires to enable VCC.
Open Arduino IDE, go to Tools, and select the right board, which is the ESP32 dev board. Also, select the right communication port. I will upload the blink sketch again, but the LED is connected to pin number 12. There are actually two LEDs on the PCB, so I will modify the blink code for both LEDs. The second LED is connected to GPIO 13. Make the necessary changes in the loop section and hit the upload button.
Both LEDs are blinking, indicating that we successfully uploaded the code to the ESP32 chip using the ESP Programmer module.
Now, I will upload the code to the generic ESP8266 module,Connect the ESP8266 Module as per the connection diagram.
Go to Tools and select the board as the Generic ESP8266 module. Also, select the right port. In Tools, set the built-in LED to pin number 1. Click the upload button to upload the code.
The code is uploaded successfully, and the built-in LED of the ESP8266 module is blinking. This means our ESP Programmer module is working fine, and we can easily upload code to any ESP board or module.
If you want to upload code to the ESP12-E module, the connection is almost the same as for the ESP32. You just need to connect two 10k resistors to pull down the GPIO 15 and EN pins. The rest is the same as for the ESP32.
That’s it for this article. I hope you learned something new.
If you want to purchase this ESP Programmer module, you can get it from my website: technolabelectronics.com.
Thank you for reading!