Wednesday, 30 May 2018

Using the CH340 USB dongle as ESP-01S Programmer

Note the add-on push-button switch

Some time ago I bought a cheap (RM6.50) CH340-based USB to serial 3V3 TTL dongle with a socket for the ESP-01S. It was described as a development board, and I assumed it will also program the ESP-01.


That assumption turned out to be quite unwise, as 'programming' was not mentioned:


It most certainly would not program an ESP-01S. What is needed was a switch to pull GPIO0 low when the ESP-01S is powered up or reset. AndyS19 has a nice writeup on this.

ESP-01S pinout

I happened to have a cheap (RM0.80) small push-button switch very popular here for use in car, autogate or garage remotes. The distance between the leads (ie pitch) almost exactly fits the pins GPIO0 and GND of the CH340 ESP-01S USB dongle, on the solder-side of the PCB.





Push-button switch for remotes


Solder-side of the CH340 ESP-01S adapter

I simply glued the switch to the PCB and soldered the leads onto the GND and GPIO0 header pins, and presto, I have an ESP-01S programmer.



To program, hold down the button as you insert the dongle in your laptop. Release the button and fire up your Arduino sketch. Use the 'ESP8266 Generic' setting. Some ESP-01S I bought would only work with 9600 baud, others are fine with 115200.

It will be especially handy to have an ESP8266 board to run my code on those train rides on my daily commute.

Life is good. Happy Trails.












No comments:

Post a Comment