loading

ESP8266 packs a lot of punch. It is not just a WiFi module, it also has a decent micro-controller in built. Now the best part is the community has made programming this inbuilt micro-controller extremely easy by adding Arduino support. In this small tutorial, I will show you how easy it is to add Arduino Support and run a sample code.

Note that we will be using the inbuilt microcontroller inside ESP8266 in this example. We will be adding arduino support for ESP8266 itself. We do not need an external arduino.

Step 1: Components Required

  1. ESP8266 board
  2. USB to Serial Converter
  3. Jumper wires and Connectors

You may wish to purchase these boards from ExploreEmbedded.com this will help us support in making awesome tutorials for you.

Step 2: Open the Arduino IDE and Go to Preferences As Shown.

Before doing this step, download Arduino IDE from Arduino.cc ( 1.6.4 or greater). Then browse to File->Preferences as shown

Step 3: Add the URL

With the new version, arduino allows third party hardware to be added with a simple URL. Add the URL below to in the space provided. If you already have something there, put a comma and add then add the URL.

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Step 4: Go to the Board Manager

Navigate to board Manager as shown in the Image.

Step 5: Wait for Arduino to Load the Package and Install It

You'll notice that the IDE will start downloading the package specified in the previous step. Wait for the download to complete. It will download all the required dependencies including the compiler, the libraries and various boards from different manufactures. Now is the time to Thank the ESP8266 community for doing all the hard work. Once it gives an option to install, hit it, sit back for a couple minutes and relax.

Step 6: Select the Board

All the popular ESP8266 boards will appear auto-magically. No need to restart the IDE or anything. It just works. Select the board that you've from the list shown.

Step 7: Set Up the Hardware

Depending on the board you've it might vary. I will describe the way you set up for Explore ESP8266 with a USB to serial Converter. Here are some points to remember:

  • ESP8266 works on 3.3v. If you're board does not have an in built regulator, ensure that you supply 3.3v and do not fry it.
  • Make the following connection from ESP to USB to Serial board
    • Rx -- Tx
    • Tx -- Rx
    • gnd -- gnd
  • Reset Circuitry: Explore ESP8266 has single switch reset. Pressing and holding the reset button while the code is uploading ensures that the board goes into the boot-loader mode. Check the board you've on how to put it in boot loader mode.

Step 8: Sample Test Code


Note: I have removed the attached code, please download it from the link below:

https://gist.github.com/Xplorer001/1539ae257d7e4e1...

The attached piece of code is already there in the examples. What it basically does is, it powers up the ESP and scans for the nearby WiFi networks. This will ensure that it is working!

Open the terminal and you should see the available networks as shown in the image above.

What will you connect to internet next?

Let us know in the comments and we will be glad to answer any questions that you may have! Happy Hacking!


The code rendering on instructables in broken, it needs to be fixed.
Also if there was some kind syntax highlighting, it would have been nice. Isn't it?

<p>Thank you. This is very useful.</p>
<p>getting this error:</p><p>esp8266_test.ino: In function 'void loop()':<br>esp8266_test:47: error: expected '}' at end of input<br>expected '}' at end of input</p><p>Also the code is overlapping the comment box in step 8 making it impossible to comment</p>
<p>I think it was not copied correctly. Please try downloading it from the gist below and try:</p><p><a href="https://gist.github.com/Xplorer001/1539ae257d7e4e16e32c">https://gist.github.com/Xplorer001/1539ae257d7e4e1...</a></p>
<p>it just needed a } put in at the end</p>

About This Instructable

1,675views

30favorites

License:

Bio: We make Embedded Design tools, boards, sensors, peripherals, DIY kits and awesome tutorials. We also help companies and individuals prototype embedded electronics.
More by ExploreEmbedded:Power and Temperature Data Logger With ESP32 and AWS IOT Secure IOT With AWS and Hornbill ESP32 Using Arduino. ESP32 Bluetooth Ambience Light Controller With WS2812 LED Strips. 
Add instructable to: