GeoProc.com
GeoProc.com

Loading sketches from Arduino IDE to ESP-01S through UNO

Introduction

ESP-01S is a WiFi device based on a programmable ESP8266 microcontroller. One way to program the ESP8266 is with Arduino IDE using standard Arduino code and libraries written for that chip.

To communicate between a PC and the ESP-01S the common route is to use a serial-to-USB board, for example see here and here. Instead, in this post the ESP-01S is connected to the PC through a UNO with a standard USB cable.

Prerequisite

Interfacing Computer to UNO to ISP-1S

Connect ESP-01S with UNO as shown in the following fritzing diagram.

connection diagram

Notes

And that's it!

Connect UNO to PC with the standard USB cable and ESP8266 is ready to be programmed.

Example

Select "Generic ESP8266 Module" as the board to use, see following figure.

select ESP8266 module

Then select the port UNO is connected to. Here it is COM5:

select com port

Then open the blink example:

select blink example

/*
ESP8266 Blink by Simon Peter
Blink the blue LED on the ESP-01 module
This example code is in the public domain

The blue LED on the ESP-01 module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)

Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/

void setup() {
    pinMode(LED_BUILTIN, OUTPUT); //  Initialize the LED_BUILTIN pin as an output
}

//  the loop function runs over and over again forever
void loop() {
    digitalWrite(LED_BUILTIN, LOW); // Turn  the LED on (Note that LOW is the voltage level
    //  but actually the LED is on; this is because
    //  it is active low on the ESP-01)
    delay(1000); // Wait for a second
    digitalWrite(LED_BUILTIN, HIGH); // Turn  the LED off by making the voltage HIGH
    delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}

(this is a copy/paste of the blink program)

Then compile compile button and finally load load button the sketch into the ESP8266 as you would load a sketch into the UNO.

To run the program: first disconnect the USB cable and then disconnect ESP-01S GPIO0 pin. Reconnect USB cable to power ESP-01S and watch the blue LED blink!

You are now ready to experiment with your own sketches.

Troubleshooting

I found the setup described above to be somewhat inconsistent. Many times there is trouble loading sketches: the load process errors out. The best solution is patience!

Try loading the sketch again and again, disconnecting USB cable and reconnecting it straight after will help. See also here for some more advice.

Final notes

 

Published date: 02 Mar 2021.