You are on page 1of 20

Building an Internet of Things Device

Introduction
This is a presentation on building an
Internet of Things device using the Arduino
Development Platform for an ESP8266 chip.
This presentation is open to all, but will
benefit those who have some experience
with Arduino
Lot to IoT
There is a lot to the Internet of Things
Security
Networking
Data Collection
We will touch a bit of everything today, but
the focus will be using the Arduino IDE to
program an ESP8266 to send and receive
data on the Internet.
IoT Devices
There are several ways to get a “Thing” on
the Internet.
Arduino Uno
Raspberry Pi
Other SoC Linux devices
ESP8266
T h isismore ofach ip
th anadevice.
ESP8266
Itisused inalotof
IoT devices.

C h eap

Easy to get

T h ose famil
iarwith
A rduino wil lfind it
easy to transition
from anU no to an
ESP8 2 6 6
ESP8266 Devices
ESP8 2 6 6 comesina
variety ofpackages.

ESP- 0 1

N odeM C U v2

W emosD1 M ini

V ariousdevel
opment
boards.
Adding ESP8266 Support
In preferences add the following to the
Additional Boards Manager

https://github.com/esp8266/Arduino/releas
es/download/2.1.0/package_esp8266com_i
ndex.json
Arduino Preferences
Boards Manager
Click Tools – Board – Boards Manager
Scroll Down to ESP8266
Download 2.1.0
Select2 . 1 . 0
A nd Instal l
SoftwareSerial Library
The Arduino hardware has built-in support for serial communication on
pins 0 and 1 (which also goes to the computer via the USB connection).
The native serial support happens via a piece of hardware (built into the
chip) called a UART.

The SoftwareSerial library has been developed to allow serial


communication on other digital pins of the Arduino, using software to
replicate the functionality

It is possible to have multiple software serial ports with speeds up to


115200 bps.
Now, try some AT commands and see the result on your
Serial monitor:

* AT =====> ESP8266 returns OK


* AT+RST =====> ESP8266 restart and returns OK
* AT+GMR =====> ESP8266 returns AT Version; SDK
version; id; OK
* AT+CWMODE? => ESP8266 returns mode type
* AT+CWLAP ===> ESP8266 returs close access points
* AT+CIFSR ===> ESP8266 returs designided IP
AT
AT+RST
AT+CWMODE=1
AT+CWJAP="SSID", "PWD"
AT+CIPMUX=1
AT+CIFSR
AT+CIPSTART=0,"TCP","api.thingspeak.com",80
AT+CIPSEND=0,44
>"GET
/update?api_key=ZXAFFBAVN4WE36XT&field1=1

You might also like