![]() ![]() Now you have a barebones ESP-01 programming adapter ready to work with Arduino IDE. This is mainly because the onboard blue LED is connected to GPIO1 (TXD) by default (later moved to GPIO2 in some newer models) hence, you may need to wire one current-limited external LED to drive through an uncommitted GPIO and change the code lines accordingly to get a positive result. The onboard blue LED is connected to GPIO0 (TXD) of the ESP-01 moduleĭigitalWrite(LED_BUILTIN, LOW) // Turn the LED on (gpio on)ĭigitalWrite(LED_BUILTIN, HIGH) // Turn the LED off on (gpio high= off)įollowing is an image of my Arduino IDE window, and the programmed ESP-01 mounted on breadboard.įrankly, using a bare module like the ESP-01 is a hassle (even for a more experienced user), and you may face problems with the same old “Blink” sketches. PinMode(LED_BUILTIN, OUTPUT) // Initialize the LED_BUILTIN pin as an output Simple test code to blink the onboard LED Because this happens in an infinite loop, the LED keeps blinking. After successful uploading of the code, the execution of the code makes the LED blink on and off with a small delay in between. Let’s upload the simple sketch (included below) to test the setup with the onboard blue LED of ESP-01. Remember to select the right “COM” port, and select “Board” through the “Tools” menu. To test the upload, just power up the finished hardware, insert the USB-to-serial adapter into your computer’s USB port, and open Arduino IDE. To begin, you must install the ESP8266 board files on the Arduino IDE and the relevant USB-to-serial drivers on your computer (if not done already). The breadboard solution introduced here takes a little more cook-up time but is easier to play with and a bit more flexible.Īrduino is a widely used platform to flash/program the ESP-01. The slide switch (S1) allows easy switching between program and normal modes, while the tactile switch (S2) can be used to reset the ESP-01 (after each mode selection, the reset button can be pressed to enter that state). The hardware presented here will allow the ESP-01 to boot up in program mode and normal mode. Another keystone of the project is the common MB-102 breadboard (and its 5-V/3.3-V switchable power supply module). Just don’t forget to always use 3.3 V (not 5 V) to power up the ESP-01. The proposed hardware setup procedure and the flash process is described below. It has 5-V, TX, RX, GND, and 3.3-V connections, which makes it suitable for programming ESP-01 modules. This USB-to-serial adapter has a simple design and is very easy to use. I prefer two widely available parts (again, eBay-special) to make the proposed hardware: The first one is a cheap USB-to-serial adapter, and the second one is a small breakout board (breadboard adapter) for the Wi-Fi module. Sometimes it is better to use something that is already available rather than try to reinvent the wheel. Also note that there are two versions of the ESP-01 now available - the new 1-MB Flash version and the old 512-KB Flash version. For breadboarding, you should build a breadboard adapter or use female-to-male DuPont wires to link the module to the breadboard. Let’s look at the pin assignments of ESP-01:ĮSP-01 is probably one of the most popular Wi-Fi modules however, it is not the most convenient one because it’s very hard to plug it directly into a breadboard for prototyping. In short, to flash an ESP-01 module, it should be connected to a USB-UART interface and GPIO0 needs to be connected directly to ground (0 V) at the time. During the normal (usual) mode, the status of GPIO0 and GPIO2 will be high, and grounding GPIO0 sets the chip to programming (bootloader) mode. While booting up, the status of GPIO0 and GPIO2 is used to check which mode that the ESP8266 needs to enter. The latter refers to uploading any software (or firmware) to the chip’s internal flash memory. ![]() Have a fun DIY evening!Īt the heart of the ESP-01 module is the ESP8266 chip with at least two boot modes - the normal mode and the programming/flash mode. I hope that this write-up will save someone the trouble that I went through. Although it’s very easy for me, I wanted to deviate and rig up my own low-cost yet easy-to-use ESP-01 USB-to-serial programming adapter. Unfortunately, there’s nothing in the adapter to properly configure the flash (program) mode, and it’s possible only with a slight hack. Because I’ve done a couple of Wi-Fi projects, rather than fiddle with pin headers and jumper wires while programming, I decided to get one of those generic eBay-special ESP-01 USB-to-serial adapters. I’m a big fan of the ESP-01 Wi-Fi modules. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |