Using an esp8266 is a cheap and easy way to add wifi connectivity to your Arduino projects. However, for smaller projects an esp8266 can replace the Arduino entirely, making the project way cheaper, much smaller and easier to program. As the esp module is lacking a serial to usb converter we'll use an Arduino to program it.
As mentioned above, we'll use the arduino IDE to program the esp8266. (Download Arduino IDE here) We first have to add the esp board. To do so, navigate to File>Preferences and add:
Next, we need to install the esp board using the boards manager (Tools>Board:"">Boards Manager...). Search for esp8266 and press install.
Ok, after selecting "generic esp8266 module" as seen in the figure below we are all set and can continue with wiring everything up!
By pulling the esp's gpio 0 pin low we can enter programming mode. It is also important that we connect the ardunio's reset pin to ground.
This sketch uses an esp8266 esp01 board. Depending on the type of esp module you want to use, check the datasheet to find out which pin is gpio 0. On some modules, the esp8266 12f for example, you also have to pull the gpio 15 pin low. Check the datasheet for more information!
We can now hit upload like we would programming an Arduino board. Once finished, disconnect the gpio 0 pin and restart the esp module.
The content published on this page (with exceptions) is published under the CC Attribution-NonCommercial 3.0 Unported License. You are free to share on commercial blogs/websites as long as you link to this page and do not sell material found on blog.hirnschall.net/* or products with said material.