IoT

Connect an ESP8266 to IBM Watson IoT Platform with Arduino SDK

The ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack and microcontroller capability produced by Shanghai-based Chinese manufacturer, Espressif.

The chip first came to the attention of western makers in August 2014 with the ESP-01 module, made by a third-party manufacturer, AI-Thinker. This small module allows microcontroller to connect to a Wi-Fi network and make simple TCP/IP connections using Hayes-style commands. The very low price and the fact that there were very little external components on the module which suggests that it could eventually be very inexpensive in volume, attracted many hackers to explore the module, chip, and the software on it, as well as to translate the Chinese documentation

The ESP8266 is an Arduino compatible microcontroller.

So It is easy to use, powerful, and very very cheap. The ESP8266 has been popular for some time now but what is a little less well known is that they are Arduino compatible and can be programmed with the Arduino IDE. You can read the complete documentation here. The pin layout of the board is shown in the diagram below :

connect an ESP8266 to IBM Watson IoT Platform with Arduino SDK
ESP2866 chip layout

Some of the pins are for power and ground for sensors. The pins labeled D0 through D10 are general purpose I/O  pins and are used for either input or output.  Sensor devices use the pins to send input and the pins can also be used to control devices.

In order to use the Arduino SDK for ESP8266 you have to install the Arduino IDE and to add the ESP8266 support.

With the Arduino IDE installed use the Board Manager function to add support for the ESP8266 setting this URL in Additional Boards Manager URL field:

connect an ESP8266 to IBM Watson IoT Platform with Arduino SDK
Arduino IDE with ESP8266 board manager

After installed the new board you can try to connect an ESP8266 to IBM Watson IoT Platform with Arduino SDK. It’s very simple to prepare a sketch, you can use the WiFiClient library to connect your microcontroller to wi-fi network and by MQTT and PubSubClient library the 8266 is able to use the mqtt protocol and publish the data. You can follow this recipe that contains the simple sketch.

Of course you need to register the device on IBM Watson IoT Platform :

connect an ESP8266 to IBM Watson IoT Platform with Arduino SDK
IBM Watson IoT Platform overview

This is just an introduction about my new toy 🙂 more info will come soon, please stay tuned !

 

Tags
Show More

Mario Noioso

IBMer, engineer, technology enthusiast, inventor, coder, gamer, Linux lover, bassist wannabe, TBD. Nerd since 80s.

Related Articles

2 Comments

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

HTML Snippets Powered By : XYZScripts.com
Close