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

Hardware requirements


Let's now take a look at the things we need to make the ESP8266 chip work. It is usually, but incorrectly, assumed that you just need this little chip and nothing else to make it work, but we are going to see that it is not true.

First, you will need some way to program the ESP8266. You can use an Arduino board for that, but for me the really great thing about the ESP8266 is that it can function completely autonomously, using the onboard processor.

So to program the chip, I will use a USB FTDI programmer.

Note

Note that it has to be compatible with the logic level of the ESP8266 chip, so 3.3V.

I have used a module that can be switched between 3.3V and 5V:

You will also need a dedicated power supply to power the chip. This is a point that is often forgotten and leads to a lot of issues. If you are, for example, trying to power the ESP8266 chip from the 3.3V coming from the FTDI board or from an Arduino board, it simply won't work correctly.

Therefore, for most ESP8266 modules, you need a dedicated power supply that can deliver at least 300 mA to be safe. Some boards have an integrated micro-USB port and a voltage regulator that can provide the required current to the ESP8266, but that's not the case with the board we will use in this first chapter. I used a breadboard power supply that can deliver up to 500 mA at 3.3V:

This is a list of all the components that you will need to use the ESP8266 chip:

  • ESP8266 Olimex module (https://www.olimex.com/Products/IoT/MOD-WIFI-ESP8266-DEV/open-source-hardware)

  • Breadboard 3.3V power supply (https://www.sparkfun.com/products/13032)

  • 3.3V FTDI USB module (https://www.sparkfun.com/products/9873)

  • Breadboard (https://www.sparkfun.com/products/12002)

  • Jumper wires (https://www.sparkfun.com/products/12795)

Hardware configuration

We are now going to take a look at the way to configure the hardware for the first use of your ESP8266 board. This is how we connect the different components:

Depending on the board you are using, the pins can have different names. Therefore, I created pictures to help you out with each module. These are the pins you will need on the small ESP board:

This is the same for the ESP-12 board mounted on a breadboard adapter:

Finally, this is the picture for the Olimex board:

This is what the Olimex board will look like at the end:

Make sure that you connect everything according to the schematics or you won't be able to continue.

Note

Also, make sure that all the switches of your components (FTDI module and power supply) are set to 3.3V, or it will damage your chip.

Also, connect one wire to the GPIO 0 pin of the ESP8266. Don't connect it to anything else for now, but you will need it later to put the chip in programming mode.