ESP-WROOM-32 - Uploading A Program With Arduino IDE - Techtutorialsx
ESP-WROOM-32 - Uploading A Program With Arduino IDE - Techtutorialsx
ESP-WROOM-32 - Uploading A Program With Arduino IDE - Techtutorialsx
Advertisements
Report this ad
techtutorialsx
A site about programming, IoT and
technology. Find tutorials for many
di erent projects.
The objective of this post is to explain how to upload an Arduino program to the ESP-WROOM-32 module.
Introduction
The objective of this post is to explain how to upload an Arduino program to the ESP-WROOM-32 module,
from DFRobot.
We will cover in more detail the hardware con guration needed to upload a program to the module. You can
check in more detail how to enable the support for the ESP32 in the Arduino IDE on this previous post.
Please note that this is a 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, these kind of spacing is adequate for non-manual soldering
procedures.
The hardware
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 [1]. Also, for the device to work, the EN pin (chip enable pin) must be connected to VCC, since
it operates in an active-high con guration [2].
So, taking the previous points in consideration, gure 1 shows the minimal con guration 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.
https://techtutorialsx.com/2017/06/05/esp-wroom-32-uploading-a-program-with-arduino-ide/ 1/6
21/8/2018 ESP-WROOM-32: Uploading a program with Arduino IDE | techtutorialsx
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 con guration in a nal design, since it is only suitable for
a quick interaction with the module.
Although in the gure we have the IO0 connected to GND, this con guration is only adequate for uploading the
program. After that, you need to disconnect it from GND, so the program uploaded runs.
The code
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 bellow the full source code for this simple program.
1 void setup() {
2 Serial.begin(115200);
3 }
4
5 void loop() {
6 Serial.println("Hello from DFRobot ESP-WROOM-32");
7 delay(1000);
8 }
https://techtutorialsx.com/2017/06/05/esp-wroom-32-uploading-a-program-with-arduino-ide/ 2/6
21/8/2018 ESP-WROOM-32: Uploading a program with Arduino IDE | techtutorialsx
After selecting this board and selecting the correct COM port assigned to the Serial-USB converter, just hit the
upload button. The code should now be compiled and uploaded. After a correct upload, you should get an
output similar to gure 3 on the IDE console.
After this, power o the module, disconnect the IO0 pin from GND and power the device on again. Then, open
the serial monitor of the Arduino IDE. You should get an output similar to gure 4, where our de ned “Hello
World” message is being printed each second.
https://techtutorialsx.com/2017/06/05/esp-wroom-32-uploading-a-program-with-arduino-ide/ 3/6
21/8/2018 ESP-WROOM-32: Uploading a program with Arduino IDE | techtutorialsx
Additional notes
You can con rm if your soldering was correctly done before trying to upload your program. If you power on the
module, connected to the Serial-USB converter and with IO0 disconnected from GND, a pre-loaded program
should be running and printing the detected WiFi networks to the serial console, as shown in gure 5.
Also, if you power on the module with the IO0 connected to GND and the Arduino IDE serial monitor previously
open, you should get an output similar to gure 6, which indicates that the ESP32 is ready for getting a new
program.
https://techtutorialsx.com/2017/06/05/esp-wroom-32-uploading-a-program-with-arduino-ide/ 4/6
21/8/2018 ESP-WROOM-32: Uploading a program with Arduino IDE | techtutorialsx
Special thanks
I would like to leave a special thank you note to my friend Pedro Marques, who helped me soldering this
module, since my skills aren’t the best for this kind of pin spacing.
References
[1] https://github.com/espressif/arduino-esp32
[2] https://www.espressif.com/sites/default/ les/documentation/esp_wroom_32_datasheet_en.pdf
Advertisements
$ 13999 $ 8,00000
Share this:
Like
One blogger likes this.
This entry was posted in ESP32 and tagged Arduino, DFRobot, ESP-WROOM-32, ESP32. Bookmark the permalink.
techtutorialsx
Blog at WordPress.com.
https://techtutorialsx.com/2017/06/05/esp-wroom-32-uploading-a-program-with-arduino-ide/ 5/6
21/8/2018 ESP-WROOM-32: Uploading a program with Arduino IDE | techtutorialsx
https://techtutorialsx.com/2017/06/05/esp-wroom-32-uploading-a-program-with-arduino-ide/ 6/6