The objective of this post is to explain how to upload an Arduino program to the WROOM module.
The objective of this post is to explain how to upload an Arduino program to the WROOM module
We will cover in more detail the hardware configuration needed to upload a program to the module.
Please note that this is an ESP32 module suitable for integration in electronic designs and not a development board for testing/development. Thus, the pin spacing is very small and it requires some special manual soldering skills to be able to use it. Naturally, this kind of spacing is adequate for non-manual soldering procedures.
In order to be able to upload programs to this module, we need a Serial-USB converter, so we can communicate with it. I’ve used the one shown here, which allows us to change between 3.3V and 5V operating voltage.
Important: The ESP32 is a 3.3V device and the WROOM module doesn’t do any voltage level conversion. So, the Serial-USB converter to be used must operate at 3.3V. Otherwise, the ESP32 may get damaged.
One thing that we need to take in consideration is that in order to be able to program the ESP32, the GPIO0 must be kept low . Also, for the device to work, the EN pin (chip enable pin) must be connected to VCC, since it operates in an active-high configuration .
So, taking the previous points in consideration, figure 1 shows the minimal configuration needed to be able to program the ESP-WROOM-32 module. The other pins of the devices are not shown for simplicity. Also note that I’m assuming that the Serial-USB converter power is being supplied by the USB connection, which is the typical use case.
Figure 1 – Minimum hardware configuration needed to program the ESP-WROOM-32.
Please take in consideration that for the sake of simplicity I’m not following the best practices here, such as including power supply bypass capacitors and other important aspects needed to keep the device working with the best reliability. So please don’t use this hardware configuration in a final design, since it is only suitable for a quick interaction with the module.
Although in the figure we have the IO0 connected to GND, this configuration is only adequate for uploading the program. After that, you need to disconnect it from GND, so the program uploaded runs.
The code for this tutorial will be very simple and consists in a simple “Hello World” message being printed periodically to the serial port. So, we start by opening a serial connection in the setup function, with a baud rate of 115200. You can check more on initiating a serial connection here.
Next, on the main loop function, we will print a simple “Hello World” message. To do so we can call the println method on the Serial object. After that, we do a short delay by calling the Arduino delay function, which receives as input the number of milliseconds to wait.
check below the full source code for this simple program.