Welcome to our mini-series of blogs about the ESP32 Optoisolated Programmer – Schematic Description. Enjoy!
During our work, we often use ESP32 modules due to their low price and fantastic wireless communication capabilities via WIFI. However, program uploading and debugging must be done wired. When our prototypes are powered from 230V mains, development work is fraught with risk. An inattentive software developer could be shocked or his computer could be damaged if some anomaly occurs in the prototype.
To avoid such risks, we designed a custom programmer for ESP microcontrollers with opto-isolation. We decided to make this design available for free and describe how and why it was designed the way it was. In this article, we will analyze the schematic. In the second part, we will analyze the PCB design.
All of our PCB designs are located on our GitLab. This allows us to trace the entire history of the project, starting from a blank schematic to subsequent versions of the product.
We use two versioning systems. Each prototype that has been produced or is in the plans has an individual HV number, which stands for Hardware Version. If a prototype has been produced and then something is changed in the design, then we raise the HV number.
In addition to this, there are also subversion numbers, stored in the six-digit YYMMDD format, corresponding to the date when the change was made.
To keep things well organized, all files are labeled with an HV number and a version number. This allows people who don’t use Git to accurately identify each file, especially factories and other subcontractors who only get finished production files without being able to access the entire project.
The diagram is divided into several functional blocks. We will analyze each of them.
The USB input is protected by a matrix of surge diodes. This solution protects both the computer and the programmer from high voltage spikes that could be induced in the long USB cable.
The next step is to isolate the USB signals. For this purpose, we have used an advanced optoisolator ADUM3160 made by Analog Devices. The circuit is very simple to use and does not require any complicated configuration.
The programmer takes power from the computer’s USB port and allows the prototype to be powered when it is not connected to the 230V mains supply. For this purpose, it was necessary to provide galvanic separation using a DC/DC converter separating the power source. This transfers power from VUSB to VCC. Both of these voltages are 5V but have different grounds.
You can buy USB optoisolators on online auctions that are made in a similar way but have a weaker 1W inverter. In our experience, this is not enough. Often when switching on the WIFI in the ESP32 the USB port in the computer was disconnected due to exceeding the allowable load. Therefore, we used a 2W inverter along with a large capacitor pack.
The ESP32 and other chips in this family are programmed using the Tx and Rx lines of the UART interface. For this, you can use one of the many popular USB/UART adapters working as a virtual COM port. We have chosen the FT232 for its easy availability and low price.
To upload the program we also use the RTS and DTR signals which reset the microcontroller (EN signal) and enter the programming mode (Boot signal).
To be continued.
Stay tuned for the next updates about the ESP32 Optoisolated Programmer – Schematic Description!