Book Image

Internet of Things with ESP8266

By : Marco Schwartz
Book Image

Internet of Things with ESP8266

By: Marco Schwartz

Overview of this book

The Internet of Things (IoT) is the network of objects such as physical things embedded with electronics, software, sensors, and connectivity, enabling data exchange. ESP8266 is a low cost WiFi microcontroller chip that has the ability to empower IoT and helps the exchange of information among various connected objects. ESP8266 consists of networkable microcontroller modules, and with this low cost chip, IoT is booming. This book will help deepen your knowledge of the ESP8266 WiFi chip platform and get you building exciting projects. Kick-starting with an introduction to the ESP8266 chip, we will demonstrate how to build a simple LED using the ESP8266. You will then learn how to read, send, and monitor data from the cloud. Next, you’ll see how to control your devices remotely from anywhere in the world. Furthermore, you’ll get to know how to use the ESP8266 to interact with web services such as Twitter and Facebook. In order to make several ESP8266s interact and exchange data without the need for human intervention, you will be introduced to the concept of machine-to-machine communication. The latter part of the book focuses more on projects, including a door lock controlled from the cloud, building a physical Bitcoin ticker, and doing wireless gardening. You’ll learn how to build a cloud-based ESP8266 home automation system and a cloud-controlled ESP8266 robot. Finally, you’ll discover how to build your own cloud platform to control ESP8266 devices. With this book, you will be able to create and program Internet of Things projects using the ESP8266 WiFi chip.
Table of Contents (20 chapters)
Internet of Things with ESP8266
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

How to choose your ESP8266 module


We are first going to see how to choose the right ESP8266 module for your project. There are many modules available in the market and it is quite easy to get lost with all the choices available.

The first one that you have probably heard of is the small ESP8266 Serial Wireless Transceiver module:

This module is the most famous one, as it is really small and only costs $5. However, the number of accessible GPIO pins (input/output pins) is quite limited. It is also difficult to plug it into a standard breadboard.

If you choose this module, there are some projects in this book that you might not be able to do. For example, you won't be able to do the projects using analog sensors, as the analog input pin is not accessible.

You can find more information about this module at:

https://nurdspace.nl/images/e/e0/ESP8266_Specifications_English.pdf

But there are many other modules on the market that give you access to all the pins of the ESP8266. For example, I really like the ESP8266 Olimex module, which is also cheap (around $10):

This module can easily be mounted on a breadboard and you can easily access all the pins of the ESP8266. This is the one I will use for most of this book and therefore I also recommend that you use a similar module.

You can find additional details about this module at:

https://www.olimex.com/Products/IoT/MOD-WIFI-ESP8266-DEV/open-source-hardware

One other choice is to use a board based on the ESP-12, which is a version of the ESP8266 made to be integrated on PCBs. This version also gives you access to all the pins of the ESP8266. It is relatively easy to find breakout boards for this chip. For example, this is a board that I bought on Tindie:

You can find more information about this module on:

http://www.seeedstudio.com/wiki/images/7/7d/ESP-12E_brief_spec.pdf

You can also get your hands on the Adafruit ESP8266 breakout board, which also integrates the ESP-12:

http://www.adafruit.com/product/2471

Another solution is to use the NodeMCU development kit, which is similar to the Olimex board but also has an integrated USB-to-Serial converter, as well as an onboard power supply. It is easier to use, but was hard to find at the time this book was written. You can get more information on the NodeMCU website:

http://nodemcu.com/index_en.html

Note that with the NodeMCU module, you will have to translate the pins from the module to the pins defined in the ESP8266 Arduino IDE, which we are going to use. You will find the correspondence between pins here:

https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#new_gpio_map