SlideShare a Scribd company logo
1 of 27
Download to read offline
Master Degree in Engineering in Computer Science
Dipartimento di Ingegneria Informatica Automatica e Gestionale "Antonio Ruberti"
University of Rome - “La Sapienza”
Individual Project of Pervasive Systems
Biagio Botticelli 1212666
A.Y. 2015/16
Adafruit Huzzah ESP8266
Wi-Fi Board
Contents
1. Introduction to ESP8266 family
2. Adafruit Huzzah ESP8266 WiFi Board
3. Programming ESP8266
4. Example of Application
ESP-01
Adafruit Huzzah ESP8266
2
Introduction to ESP8266
The ESP8266 is a System-on-a-Chip (SoC) with a full 2,4 GHz WiFi front-end
and with integrated TCP/IP protocol stack with DNS support.
First version ESP-01 (begin 2014): it allows micro-controllers to connect to a
Wi-Fi network and make simple TCP/IP connections using Hayes-style
commands.
After few time…
• Multiple hardware versions;
• Official SDK (October 2014);
• Custom Firmwares;
3
Intro HuzzahESP8266 Programming Example
ESP8266 Family
Adafruit
Huzzah
ESP8266
4
Intro HuzzahESP8266 Programming Example
ESP8266: Hardware
• 32-bit CPU running at 80 MHz
• 64 KB of boot ROM
• 64 KB of instruction RAM
• 96 KB of data RAM
• External Flash Memory: 512 KB to up 4 MB
• 2,4 GHz Wi-Fi 802.11 b/g/n
• WEP, WPA/WPA2 Authentication or Open Networks
• 16 GPIO pins
• SPI, I2C
• I2S interfaces with DMA (sharing pins with GPIO)
• UART on dedicated pins + 1 transmit-only UART on GPIO2
• 1 10-bit ADC
• 3 PWM
5
Intro HuzzahESP8266 Programming Example
Why Adafruit Huzzah ESP8266?
WARNING! The ESP8266 operates at 3,3 V!
Most of the first versions do not have an
onboard voltage regulator…
Not breadboard friendly…
The Adafruit Huzzah ESP8266 is one of the
last versions of the module that make
easier to work with.
• Integrated high-current capable 500 mA /
3,3 V regulator;
• Breadboard friendly.
6
Intro HuzzahESP8266 Programming Example
Why Adafruit Huzzah ESP8266?
Small Dimension: 25x38x5 mm
Very low cost board!
7
Intro HuzzahESP8266 Programming Example
Adafruit Huzzah ESP8266
Power Pins
• V+: input/output 5V voltage;
• VBat: input voltage from Battery;
• GND: ground;
• 3V: output 3,3V voltage;
Serial Pins
• TX: output from the module (3.3 V);
• RX: input into the module (5 V);
8
Intro HuzzahESP8266 Programming Example
Adafruit Huzzah ESP8266
GPIO Pins
There are 9 GPIO pins:
#0, #2, #4, #5, #12, #13, #14, #15, #16.
GPIO pins are 3,3 V logic level in/out
and can be used for any sort of input
or output signal.
9
Many have special functionality:
• #0: used to determine when to boot into the bootloader.
If the pin is held LOW during power-up it will start boot-loading.
• #2: also used to detect boot-mode.
• #15: also used to detect boot-mode.
• #16: used to wake up from sleep mode. To awake, connect it to the RESET pin.
Intro HuzzahESP8266 Programming Example
Adafruit Huzzah ESP8266
Analog Pin
• A: analog input.
Other Control Pins
• LDO: enable pin;
Easy way to cut power OFF:
when connected to GND, it will
turn off the 3,3 V regulator.
• RST: reset pin (5 V);
When connected to GND, it will
momentarily reset the ESP8266.
• EN (CH_PD): reset pin (3,3 V only).
When connected to GND it will
momentarily reset the ESP8266.
10
Intro HuzzahESP8266 Programming Example
Programming ESP8266
In order to make them work properly, remember to install the correct driver!
USB-to-Serial
To establish a communication with Adafruit ESP8266, we need an USB to
Serial converter which will provide the connectivity between USB port of our
PC/Laptop and Serial UART interface of the board.
USB-to-TTL Cable FTDI Cable FTDI Breakout
SparkFun
FTDI Basic 5V
11
Intro HuzzahESP8266 Programming Example
Programming ESP8266
Firmwares
Different options for firmware are available: each one allows to program the
chip in a different way.
1. AT+ Command Processor (default for ESP8266)
2. Custom Firmware (using Arduino IDE to upload);
3. Node MCU Lua (default for Adafruit Huzzah ESP8266);
4. esp-open-SDK (direct programming on ESP8266);
5. Firmware by Espruino community (Javascript);
6. Firmware by MicroPython community (Python);
Only one firmware at a time could be loaded in ESP8266!
12
Intro HuzzahESP8266 Programming Example
Firmware: Installation
To load the firmware in the chip, it’s needed to use:
• Flashing Tool: esptool, a Python-based cross-platform ESP8266 flashing tool;
• Image of Firmware: any image of firmware to install.
Requirement: the programmer must be able to use esptool.
In order to make esptool working, pySerial must be present in the system.
Supposing that esptool and pySerial are correctly installed and the firmware image is
available, it’s possible to begin the installation of the firmware on the module.
The ESP8266 must be in Bootloader Mode! Otherwise, flashing process will not work!
The command for the installation of the firmware using esptool is:
sudo esptool.py --port /dev/tty.device_name write_flash 0x00000 /path_to_firmware_image
• /dev/tty.device_name: name assigned by the OS to the ESP8266 device;
• /path_to_firmware_image: location of the image of the firmware.
13
Intro HuzzahESP8266 Programming Example
AT+ Commands
Maybe the quickest way to get started with the ESP8266!
It allows ESP8266 to process AT+ Commands received over Serial UART interface.
Pros:
• useful for beginners: the user does not need not be familiar with any programming language
or framework to use it; he can simply send a series of commands to achieve his goal.
Cons:
• USB-to-Serial Connection: the module must be always connected to the computer.
• Low-Level Programming: AT+ Commands operate at very low level.
There are different ways of sending serial
messages over the computer's USB.
The most used are:
• Serial Terminal Softwares:
• PuTty for Windows;
• CoolTerm for Windows/MacOS/Unix;
• Arduino IDE's Serial Monitor.
14
Intro HuzzahESP8266 Programming Example
AT+ Commands Set
15
Intro HuzzahESP8266 Programming Example
AT+ Commands Set
16
Intro HuzzahESP8266 Programming Example
NodeMCU Lua
NodeMCU Lua is the most popular alternative firmware to AT+ Commands!
NodeMCU runs an interpreter able to execute commands in the Lua scripting language.
• Memory Storage: store the
code in flash memory and
instruct the module to run
the application every time it
restarts!
ESPlorer: NodeMCU tool
17
Pro:
• Good for developers: environment that allows to run commands for controlling
both board's WiFi interface and GPIO functionalities.
Cons:
• Lua Language: not very
spread with lack of
official documentation;
Intro HuzzahESP8266 Programming Example
Arduino IDE
Whereas the Adafruit Huzzah Board is pre-programmed with the  NodeMCU
firmware, it’s possible to replace it with a custom firmware using the Arduino IDE.
WARNING! This method erases the previous firmware from the ESP8266's flash!
(To come back to initial configuration of the board, there would be executed the steps described before)
Maybe it’s the easiest way to design a custom firmware for the ESP8266 module!
It would be the best choice for those
users which want to use the latest
versions of ESP8266 that allows to use it
as a regular micro-controller.
18
Intro HuzzahESP8266 Programming Example
Arduino IDE
The Arduino IDE will not initially recognize the ESP8266!
ESP8266 in the Arduino IDE
• Open Preferences window of the Arduino IDE;
• Enter in the Additional Boards Manager URLs field the URL:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
• Go in the Boards Manager and install the last release for esp8266 module by the
ESP8266 Web Community;
• Restart the Arduino IDE;
• After restarting the Arduino IDE, we can find a specific menu of the different
models of ESP8266 boards.
• Selecting the model of the board, the IDE will automatically set the correct
parameters in order to make feasible the USB-to-Serial communication.
If all the previous configuration steps are been made correctly, we
are now ready to write our custom firmware with the Arduino IDE.
19
Intro HuzzahESP8266 Programming Example
Example
Steps:
1. Build the hardware circuit on which the application is based;
2. Develop the custom firmware with the Arduino IDE, that makes the ESP8266
board the core of the project;
3. Use Blynk app for iOS/Android to implement the remote control;
Idea: Create an application for the remote
control of the temperature/humidity in the
room with the possibility to turn on/off the
light by using the smartphone.
20
Intro HuzzahESP8266 Programming Example
Example: Hardware
21
Intro HuzzahESP8266 Programming Example
Example: Blynk Front-End
22
Blynk: IoT Control User Interface for ESP8266 module
Intro HuzzahESP8266 Programming Example
User Interface:
• Switch for the Remote Control of
the light;
• Gauge for the representation of the
Temperature of the room;
• Gauge for the representation of the
Humidity of the room;
Example: Arduino IDE
23
Intro HuzzahESP8266 Programming Example
Example: Arduino IDE
24
Intro HuzzahESP8266 Programming Example
ESP8266
25
Questions
&
Discussion
Useful Links
Useful Links:
• ESP8266 Datasheet
• ESP8266 Community Forum
• AT+ Instruction Set
• NodeMCU Web Site
• NodeMCU Flasher
• SparkFun
26
Homepage of the course: Pervasive Systems 2016
These slides are available on Slideshare
Email Address: botticelli.1212666@studenti.uniroma1.it
GitHub: biagiobotticelli/ESP8266
LinkedIn: Biagio Botticelli
• Arduino/Genuino IDE
• Arduino Core for ESP8266
• esp-open-SDK
• esptool Flashing Tool
• Blynk
ESP8266
27
Thank You !

More Related Content

What's hot

Introduction to Internet of Things Hardware
Introduction to Internet of Things HardwareIntroduction to Internet of Things Hardware
Introduction to Internet of Things HardwareDaniel Eichhorn
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev BoardElaf A.Saeed
 
IOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationIOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationNikhil Jadav
 
M2M - Machine to Machine Technology
M2M - Machine to Machine TechnologyM2M - Machine to Machine Technology
M2M - Machine to Machine TechnologySamip jain
 
IoT Based Home Automation System over Cloud
IoT Based Home Automation System over CloudIoT Based Home Automation System over Cloud
IoT Based Home Automation System over Cloudijtsrd
 
Latest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc StudentsLatest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc StudentsArun Kumar
 
1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoTIEEE MIU SB
 
Home automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASEDHome automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASEDAshish Kumar Thakur
 

What's hot (20)

Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
 
Analytics in IOT
Analytics in IOTAnalytics in IOT
Analytics in IOT
 
6G Technology
6G Technology6G Technology
6G Technology
 
Smart Irrigation System
Smart Irrigation SystemSmart Irrigation System
Smart Irrigation System
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
Introduction to Internet of Things Hardware
Introduction to Internet of Things HardwareIntroduction to Internet of Things Hardware
Introduction to Internet of Things Hardware
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
Iot based home automation
Iot based home automationIot based home automation
Iot based home automation
 
Intelligent IoT Projects In 7 Days
Intelligent IoT Projects In 7 Days Intelligent IoT Projects In 7 Days
Intelligent IoT Projects In 7 Days
 
IOT gateways.pptx
IOT gateways.pptxIOT gateways.pptx
IOT gateways.pptx
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev Board
 
IOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationIOT: Home Automation using Android Application
IOT: Home Automation using Android Application
 
M2M - Machine to Machine Technology
M2M - Machine to Machine TechnologyM2M - Machine to Machine Technology
M2M - Machine to Machine Technology
 
IoT Based Home Automation System over Cloud
IoT Based Home Automation System over CloudIoT Based Home Automation System over Cloud
IoT Based Home Automation System over Cloud
 
IoT and m2m
IoT and m2mIoT and m2m
IoT and m2m
 
Latest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc StudentsLatest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc Students
 
1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT
 
Home automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASEDHome automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASED
 
Arduino
ArduinoArduino
Arduino
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 

Similar to Adafruit Huzzah Esp8266 WiFi Board

Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)Suraj Kumar Jana
 
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-ioHome automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-ioTran Minh Nhut
 
Electronics ESP processors
Electronics ESP processorsElectronics ESP processors
Electronics ESP processorsLeopoldo Armesto
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1Andy Gelme
 
Esp8266 - Intro for dummies
Esp8266 - Intro for dummiesEsp8266 - Intro for dummies
Esp8266 - Intro for dummiesPavlos Isaris
 
Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)Parshwadeep Lahane
 
Embedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerEmbedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerArun Kumar
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266Elaf A.Saeed
 
wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3hari prasad
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitSulamita Garcia
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019Jong-Hyun Kim
 
[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2Công Hoàng Văn
 

Similar to Adafruit Huzzah Esp8266 WiFi Board (20)

Remote tanklevelmonitor
Remote tanklevelmonitorRemote tanklevelmonitor
Remote tanklevelmonitor
 
Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)Practical Introduction to Internet of Things (IoT)
Practical Introduction to Internet of Things (IoT)
 
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-ioHome automation-in-the-cloud-with-the-esp8266-and-adafruit-io
Home automation-in-the-cloud-with-the-esp8266-and-adafruit-io
 
Electronics ESP processors
Electronics ESP processorsElectronics ESP processors
Electronics ESP processors
 
Esp8266 Workshop
Esp8266 WorkshopEsp8266 Workshop
Esp8266 Workshop
 
ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1
 
Esp8266 - Intro for dummies
Esp8266 - Intro for dummiesEsp8266 - Intro for dummies
Esp8266 - Intro for dummies
 
Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)Remote temperature monitor (DHT11)
Remote temperature monitor (DHT11)
 
Embedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerEmbedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontroller
 
Esp8266 v12
Esp8266 v12Esp8266 v12
Esp8266 v12
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266
 
wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
 
WiFi SoC ESP8266
WiFi SoC ESP8266WiFi SoC ESP8266
WiFi SoC ESP8266
 
[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2[MakerHN] [IoT] [01] Intro 2
[MakerHN] [IoT] [01] Intro 2
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
 

More from Biagio Botticelli

IoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random WalksIoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random WalksBiagio Botticelli
 
Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...Biagio Botticelli
 
System and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration TestingSystem and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration TestingBiagio Botticelli
 
Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1Biagio Botticelli
 
IoT Honeypots: State of the Art
IoT Honeypots: State of the ArtIoT Honeypots: State of the Art
IoT Honeypots: State of the ArtBiagio Botticelli
 
State of the Art: IoT Honeypots
State of the Art: IoT HoneypotsState of the Art: IoT Honeypots
State of the Art: IoT HoneypotsBiagio Botticelli
 
Anonymity in the web based on routing protocols
Anonymity in the web based on routing protocolsAnonymity in the web based on routing protocols
Anonymity in the web based on routing protocolsBiagio Botticelli
 
Anonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing ProtocolsAnonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing ProtocolsBiagio Botticelli
 
Blockchain for IoT - Smart Home
Blockchain for IoT - Smart HomeBlockchain for IoT - Smart Home
Blockchain for IoT - Smart HomeBiagio Botticelli
 
Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking Biagio Botticelli
 

More from Biagio Botticelli (10)

IoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random WalksIoT Malware Detection through Threshold Random Walks
IoT Malware Detection through Threshold Random Walks
 
Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...Control of Communication and Energy Networks Final Project - Service Function...
Control of Communication and Energy Networks Final Project - Service Function...
 
System and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration TestingSystem and Enterprise Security Project - Penetration Testing
System and Enterprise Security Project - Penetration Testing
 
Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1Web Information Retrieval - Homework 1
Web Information Retrieval - Homework 1
 
IoT Honeypots: State of the Art
IoT Honeypots: State of the ArtIoT Honeypots: State of the Art
IoT Honeypots: State of the Art
 
State of the Art: IoT Honeypots
State of the Art: IoT HoneypotsState of the Art: IoT Honeypots
State of the Art: IoT Honeypots
 
Anonymity in the web based on routing protocols
Anonymity in the web based on routing protocolsAnonymity in the web based on routing protocols
Anonymity in the web based on routing protocols
 
Anonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing ProtocolsAnonymity in the Web based on Routing Protocols
Anonymity in the Web based on Routing Protocols
 
Blockchain for IoT - Smart Home
Blockchain for IoT - Smart HomeBlockchain for IoT - Smart Home
Blockchain for IoT - Smart Home
 
Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking Smart Team Tracking Project: Group Tracking
Smart Team Tracking Project: Group Tracking
 

Recently uploaded

Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 

Recently uploaded (20)

Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 

Adafruit Huzzah Esp8266 WiFi Board

  • 1. Master Degree in Engineering in Computer Science Dipartimento di Ingegneria Informatica Automatica e Gestionale "Antonio Ruberti" University of Rome - “La Sapienza” Individual Project of Pervasive Systems Biagio Botticelli 1212666 A.Y. 2015/16 Adafruit Huzzah ESP8266 Wi-Fi Board
  • 2. Contents 1. Introduction to ESP8266 family 2. Adafruit Huzzah ESP8266 WiFi Board 3. Programming ESP8266 4. Example of Application ESP-01 Adafruit Huzzah ESP8266 2
  • 3. Introduction to ESP8266 The ESP8266 is a System-on-a-Chip (SoC) with a full 2,4 GHz WiFi front-end and with integrated TCP/IP protocol stack with DNS support. First version ESP-01 (begin 2014): it allows micro-controllers to connect to a Wi-Fi network and make simple TCP/IP connections using Hayes-style commands. After few time… • Multiple hardware versions; • Official SDK (October 2014); • Custom Firmwares; 3 Intro HuzzahESP8266 Programming Example
  • 5. ESP8266: Hardware • 32-bit CPU running at 80 MHz • 64 KB of boot ROM • 64 KB of instruction RAM • 96 KB of data RAM • External Flash Memory: 512 KB to up 4 MB • 2,4 GHz Wi-Fi 802.11 b/g/n • WEP, WPA/WPA2 Authentication or Open Networks • 16 GPIO pins • SPI, I2C • I2S interfaces with DMA (sharing pins with GPIO) • UART on dedicated pins + 1 transmit-only UART on GPIO2 • 1 10-bit ADC • 3 PWM 5 Intro HuzzahESP8266 Programming Example
  • 6. Why Adafruit Huzzah ESP8266? WARNING! The ESP8266 operates at 3,3 V! Most of the first versions do not have an onboard voltage regulator… Not breadboard friendly… The Adafruit Huzzah ESP8266 is one of the last versions of the module that make easier to work with. • Integrated high-current capable 500 mA / 3,3 V regulator; • Breadboard friendly. 6 Intro HuzzahESP8266 Programming Example
  • 7. Why Adafruit Huzzah ESP8266? Small Dimension: 25x38x5 mm Very low cost board! 7 Intro HuzzahESP8266 Programming Example
  • 8. Adafruit Huzzah ESP8266 Power Pins • V+: input/output 5V voltage; • VBat: input voltage from Battery; • GND: ground; • 3V: output 3,3V voltage; Serial Pins • TX: output from the module (3.3 V); • RX: input into the module (5 V); 8 Intro HuzzahESP8266 Programming Example
  • 9. Adafruit Huzzah ESP8266 GPIO Pins There are 9 GPIO pins: #0, #2, #4, #5, #12, #13, #14, #15, #16. GPIO pins are 3,3 V logic level in/out and can be used for any sort of input or output signal. 9 Many have special functionality: • #0: used to determine when to boot into the bootloader. If the pin is held LOW during power-up it will start boot-loading. • #2: also used to detect boot-mode. • #15: also used to detect boot-mode. • #16: used to wake up from sleep mode. To awake, connect it to the RESET pin. Intro HuzzahESP8266 Programming Example
  • 10. Adafruit Huzzah ESP8266 Analog Pin • A: analog input. Other Control Pins • LDO: enable pin; Easy way to cut power OFF: when connected to GND, it will turn off the 3,3 V regulator. • RST: reset pin (5 V); When connected to GND, it will momentarily reset the ESP8266. • EN (CH_PD): reset pin (3,3 V only). When connected to GND it will momentarily reset the ESP8266. 10 Intro HuzzahESP8266 Programming Example
  • 11. Programming ESP8266 In order to make them work properly, remember to install the correct driver! USB-to-Serial To establish a communication with Adafruit ESP8266, we need an USB to Serial converter which will provide the connectivity between USB port of our PC/Laptop and Serial UART interface of the board. USB-to-TTL Cable FTDI Cable FTDI Breakout SparkFun FTDI Basic 5V 11 Intro HuzzahESP8266 Programming Example
  • 12. Programming ESP8266 Firmwares Different options for firmware are available: each one allows to program the chip in a different way. 1. AT+ Command Processor (default for ESP8266) 2. Custom Firmware (using Arduino IDE to upload); 3. Node MCU Lua (default for Adafruit Huzzah ESP8266); 4. esp-open-SDK (direct programming on ESP8266); 5. Firmware by Espruino community (Javascript); 6. Firmware by MicroPython community (Python); Only one firmware at a time could be loaded in ESP8266! 12 Intro HuzzahESP8266 Programming Example
  • 13. Firmware: Installation To load the firmware in the chip, it’s needed to use: • Flashing Tool: esptool, a Python-based cross-platform ESP8266 flashing tool; • Image of Firmware: any image of firmware to install. Requirement: the programmer must be able to use esptool. In order to make esptool working, pySerial must be present in the system. Supposing that esptool and pySerial are correctly installed and the firmware image is available, it’s possible to begin the installation of the firmware on the module. The ESP8266 must be in Bootloader Mode! Otherwise, flashing process will not work! The command for the installation of the firmware using esptool is: sudo esptool.py --port /dev/tty.device_name write_flash 0x00000 /path_to_firmware_image • /dev/tty.device_name: name assigned by the OS to the ESP8266 device; • /path_to_firmware_image: location of the image of the firmware. 13 Intro HuzzahESP8266 Programming Example
  • 14. AT+ Commands Maybe the quickest way to get started with the ESP8266! It allows ESP8266 to process AT+ Commands received over Serial UART interface. Pros: • useful for beginners: the user does not need not be familiar with any programming language or framework to use it; he can simply send a series of commands to achieve his goal. Cons: • USB-to-Serial Connection: the module must be always connected to the computer. • Low-Level Programming: AT+ Commands operate at very low level. There are different ways of sending serial messages over the computer's USB. The most used are: • Serial Terminal Softwares: • PuTty for Windows; • CoolTerm for Windows/MacOS/Unix; • Arduino IDE's Serial Monitor. 14 Intro HuzzahESP8266 Programming Example
  • 15. AT+ Commands Set 15 Intro HuzzahESP8266 Programming Example
  • 16. AT+ Commands Set 16 Intro HuzzahESP8266 Programming Example
  • 17. NodeMCU Lua NodeMCU Lua is the most popular alternative firmware to AT+ Commands! NodeMCU runs an interpreter able to execute commands in the Lua scripting language. • Memory Storage: store the code in flash memory and instruct the module to run the application every time it restarts! ESPlorer: NodeMCU tool 17 Pro: • Good for developers: environment that allows to run commands for controlling both board's WiFi interface and GPIO functionalities. Cons: • Lua Language: not very spread with lack of official documentation; Intro HuzzahESP8266 Programming Example
  • 18. Arduino IDE Whereas the Adafruit Huzzah Board is pre-programmed with the  NodeMCU firmware, it’s possible to replace it with a custom firmware using the Arduino IDE. WARNING! This method erases the previous firmware from the ESP8266's flash! (To come back to initial configuration of the board, there would be executed the steps described before) Maybe it’s the easiest way to design a custom firmware for the ESP8266 module! It would be the best choice for those users which want to use the latest versions of ESP8266 that allows to use it as a regular micro-controller. 18 Intro HuzzahESP8266 Programming Example
  • 19. Arduino IDE The Arduino IDE will not initially recognize the ESP8266! ESP8266 in the Arduino IDE • Open Preferences window of the Arduino IDE; • Enter in the Additional Boards Manager URLs field the URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json • Go in the Boards Manager and install the last release for esp8266 module by the ESP8266 Web Community; • Restart the Arduino IDE; • After restarting the Arduino IDE, we can find a specific menu of the different models of ESP8266 boards. • Selecting the model of the board, the IDE will automatically set the correct parameters in order to make feasible the USB-to-Serial communication. If all the previous configuration steps are been made correctly, we are now ready to write our custom firmware with the Arduino IDE. 19 Intro HuzzahESP8266 Programming Example
  • 20. Example Steps: 1. Build the hardware circuit on which the application is based; 2. Develop the custom firmware with the Arduino IDE, that makes the ESP8266 board the core of the project; 3. Use Blynk app for iOS/Android to implement the remote control; Idea: Create an application for the remote control of the temperature/humidity in the room with the possibility to turn on/off the light by using the smartphone. 20 Intro HuzzahESP8266 Programming Example
  • 22. Example: Blynk Front-End 22 Blynk: IoT Control User Interface for ESP8266 module Intro HuzzahESP8266 Programming Example User Interface: • Switch for the Remote Control of the light; • Gauge for the representation of the Temperature of the room; • Gauge for the representation of the Humidity of the room;
  • 23. Example: Arduino IDE 23 Intro HuzzahESP8266 Programming Example
  • 24. Example: Arduino IDE 24 Intro HuzzahESP8266 Programming Example
  • 26. Useful Links Useful Links: • ESP8266 Datasheet • ESP8266 Community Forum • AT+ Instruction Set • NodeMCU Web Site • NodeMCU Flasher • SparkFun 26 Homepage of the course: Pervasive Systems 2016 These slides are available on Slideshare Email Address: botticelli.1212666@studenti.uniroma1.it GitHub: biagiobotticelli/ESP8266 LinkedIn: Biagio Botticelli • Arduino/Genuino IDE • Arduino Core for ESP8266 • esp-open-SDK • esptool Flashing Tool • Blynk

Editor's Notes

  1. My presentation will follow four basic steps: The first step is an introduction to the ESP module family; The second one is a description of the features of the Adafruit Huzzah, that is a particular version of the module that Ioannis give it to me to work with; The third is an introduction on how it’s possible to program the chip ESP12 of the board with the different firmwares that are been introduced; The last step is the description of one of the possible application that could be developed by using this module. As example, I decided to develop an application using the software Blynk (that will be presented in one of the next lectures by my colleague Davide Meacci) that allows the remote control of a room by my iPhone checking the temperature and humidity, and giving me the possibility to turn on off the light.
  2. The ESP8266 System-on-a-Chip produced by Espressif is an 80 MHz chip with a full WiFi front-end (both as client and access point) and with an integrated TCP/IP protocol stack with DNS support. The first version of the module, the ESP-01 was introduced in early 2014: this small chip allows micro-controllers (such as Arduino) to connect to Wi-Fi and make simple TCP/IP connections using Hayes-style commands. We will see in the next slides some examples of AT+ Commands… Now, multiple versions of the module are being made available because after few time, the extremely low price and the potentialities of the chip had attracted many developers to built more usable hardware versions together with a more advanced software environment. In late October 2014, Espressif has released a Software Development Kit (SDK). This innovation allows the module to be programmed without the use of an additional micro-controller.
  3. In this slide we can see a summary table of the ESP family. As we can see, many versions are being introduced (from the initial ESP01 to the last ESP-14)… For this project, I worked with an Adafruit Huzzah ESP8266 Development Board that has an ESP-12 version of the chip. Let’s see some hardware features of the module…
  4. ESP8266 employs a 32-bit CPU running at 80 MHz. It has 64 KB boot ROM, 64 KB instruction RAM and 96 KB data RAM. External flash memory can be accessed through SPI. It’s a system-on-a-chip with 2.4 GHz Wi-Fi (supporting WPA/WPA2). It has 16 General-Purpose Input/Output (GPIO): Serial Peripheral Interface(SPI), Inter-Integrated Circuit (I²C), Integrated Interchip Sound (I²S) Analog-to-Digital Conversion (10-bit ADC), UART (on dedicated pins, plus a transmit-only UART can be enabled on GPIO2), Pulse-Width Modulation (PWM).
  5. The ESP8266 operates at 3,3 V and may require up to 170 mA of current. Thus, we would need a 3,3 V regulator, since the micro-controller pins typically have 5 volt logic and most of the first versions of the ESPs don’t have an onboard regulator. If we would use ESP with 5V… We could seriously damage it! Thus, in order to make them work, we would need to create an additional Voltage Regulator or to buy an additional adapter. The Adafruit Huzzah ESP8266 is one of the newer versions of the module. For the power supply it has an integrated high-current capable 500 mA / 3,3 V regulator on the board; so we have not to buy a regulator and it’s is also breadboard friendly. This is very useful if we want to use it in a dedicated circuit… Then…
  6. As you can see… It’s very small, so it does need much space to place it in a circuit! And it’s very cheap with respect to other WiFi micro controllers such as the Arduino Wifi Shield. Now, let me introduce how the board really works…
  7. The board has 24 Pins in total: 7 Power Pins, 4 Serial, 9 GPIO, 1 Analog and 3 Control Pins. For Power Pins, there are 3 inputs for the regulator: 2 V+ and 1 VBat. The V+ pin is on the FTDI/Serial header and in the left side of the board. The Ground pins are 3: 2 are on left and right side of the board (1 per side) and 1 is on the FTDI/Serial header. There's also a 3.3 V output from the regulator available on the 3V pin. There are 4 Serial Pins: 2 RX and 2 TX that are the serial control and bootloading pins. They are the means for communicating with the ESP module. The TX pin is the output from the module and is 3.3 V logic. The RX pin is the input into the module and is 5V compliant. The pins are available in 2 places: one set is on the right side of the board and the other one is on the FTDI/Serial header.
  8. GPIO Pins There are 9 GPIO pins: #0, #2, #4, #5, #12, #13, #14, #15, #16. All GPIO are 3,3 V logic level in and out, and are not 5 V compatible. These pins can be used for any sort of input or output. Many have special functionality: GPIO #0: this pin is used by the ESP8266 to determine when to boot into the bootloader. If the pin is held low during power-up it will start bootloading. It is also connected to the red LED so it could be used to blink it. GPIO #2: it is another way to detect boot-mode. It is also connected to the blue LED. GPIO #15: it is another way to detect boot-mode. It’s always possible to use it as an output. GPIO #16: it can be used to wake up from sleep mode of the board. To awake, connect it to the RESET pin.
  9. Analog Pin There is a single analog input pin called A. This pin has a 1,0 V maximum voltage, so if you have an analog voltage to read that is higher, it will have to be divided down to 0 - 1.0V range. Other Control Pins We have a few other pins for controlling the board. LDO: This is the enable pin for the regulator. By default its pulled high. When connected to GND it will turn off the 3,3 V regulator and is an easy way to cut power off to the whole setup. RST: This is a 5 V compliant reset pin. By default it’s pulled high. When connected to GND it will reset the ESP8266 system. EN (CH_PD): This is a 3,3 V logic only reset pin. By default it’s pulled high. When connected to GND it will reset the ESP8266 system.
  10. To establish a communication with Adafruit ESP8266 board, we need an USB to Serial converter which will provide the connectivity between USB port of our PC and the Serial UART interface of the ESP8266 module. There are different options of cables and adaptors that could be choose offering connectivity at 5 or 3,3 V with various connector interfaces. There are many option between USB-to-TTL Cables, FTDI Cables, FTDI modules and so on… In my case, I used a SparkFun FTDI Basic 5V module. In order to make them work, remember to install the correct driver!
  11. Firmwares Different options for firmware are available: each one allows to program the chip in a different way. 1. AT+ Command Processor, the default for first versions like ESP01; 2. Node MCU Lua, the default for Adafruit Huzzah ESP8266; 3. Custom Firmware, created using the Arduino IDE; 4. esp-open-SDK, that allows the direct programming on ESP8266; 5. Firmware by Espruino community (Javascript Interpret); 6. Firmware by MicroPython community (Python Interpret); These last two, are very good interpreters but in early stage of development (published in December 2015) with not all functionalities made been available yet. Remember that in the ESP8266 module, it’s possible to load one firmware at a time. So before starting to programming the ESP, the developer has to make the choice of the firmware to use. It’s not possible to change it during development or share properties of different firmwares.
  12. The Huzzah ESP8266 board is pre-programmed with a NodeMCU Lua interpreter. But, if the we want to use a different firmware, it’s possible to use the tools developed by ESP8266 Community for loading a firmware image on the chip. To load the firmware in the chip, we will need: a Flashing Tool: I choose esptool, a Python-based cross-platform flashing tool. an Image of Firmware: any image of firmware to install. For the installation of the image on the module, we must be able to use esptool. In order to make esptool working, we must install pySerial on our system. Now, supposing that esptool and pySerial are correctly installed and the firmware image is available, it’s possible to begin the installation of the firmware on the module. The ESP8266 must be in Bootloader Mode! Otherwise, flashing process will not work! The command for the installation of the firmware using esptool is: sudo esptool.py --port /dev/tty.device_name write_flash 0x00000 /path_to_firmware_image where: /dev/tty.device_name is the name assigned by the OS to the ESP8266 device; /path_to_firmware_image is the location of the image of the firmware. We can now focus on some of the most common firmwares for ESP…
  13. Maybe the quickest way to get started with the ESP8266! It allows ESP8266 to process AT+ Commands received over Serial UART interface. The Advantages that it’s useful for a beginner user since he will not need not be familiar with any specific programming language or framework to use the ESP8266; he can simply send a series of commands to achieve his goal. Disadvantages are that the module must be always connected to the computer. and that it operates at very low level. So it’s not so intuitive in a regular use. How can we send AT commands to the module? There are different ways of sending serial messages over the computer's USB. The most used are: Serial Terminal Softwares as PuTty or CoolTerm for Windows/MacOS/Unix; Arduino IDE's Serial Monitor. Let we see a list of the AT Commands
  14. AT to see if the board is connected; AT+CWLAP to have a list of the available access points; AT+CWJAP to connect with an access point (with relative ssid and password) AT+CWJAP to disconnect from an access point; AT+CIFSR to get the IP Address; AT+CWMODE to set the mode in which the module will operate (Station, Access Point or both)
  15. AT+CWLIF to check IPs of connected devices in access point mode; AT+CIPSERVER to set up in server mode with a specific port; and so on… Then we have another option for firmware that is quite more advanced…
  16. At the moment NodeMCU is the most popular alternative firmware to AT+ Commands! NodeMCU runs a Lua interpreter onboard the ESP8266, which is able to execute commands written in the Lua scripting language. The commands are sent to the via the Serial UART interface. NodeMCU is a good starting point for developers as it provides an environment that allows running commands not only for controlling the ESP8266's wireless interface, but also its GPIO and hardware functionality. In addition, we have access to Lua programming language for writing our applications. Finally, we can save our applications in the ESP8266's flash memory and instruct it to run the application code every time it restarts! To write our application we could use ESPplorer IDE tool. Lua Language Pros: • Portable: builds on any platform with an ANSI C compiler. • Lua is comparably as easy as Python in terms of learning how to write code. • Embedded and extensible language that provides a straightforward interface to/from C/C++/Objective-C. It has a very clean C API. • Sufficiently fast: performs well comparing to other languages and has a JIT compiler that noticeably improves performance on many tasks. • Well documented: reference manual, book, wiki, 6-page short reference and more. • Friendly and enthusiastic community. • Clean and simple syntax suitable for beginners and accessible to non-programmers. • Integrated interpreter: just run lua from the command line. • Native support for coroutines to implement iterators and non-preemptive multi-threading. • Incremental garbage collector that has low latency, no additional memory cost, little - implementation complexity, and support for weak tables. • Simple yet powerful debug library. • Free Cons: • Lua does not focus on 100% backward compatibility. Many newer releases of Lua break programs written in previous versions. • Limited error handling support. • Global scoping by default. • No Unicode support. • Lua supports only a few data structures, including arrays, lists and hash tables. • Limited pattern-matching support. • No POSIX functions built-in.. • No class/object finalizers. • Packaging on Windows. It requires a fair amount of experience with Windows application packaging to produce an installer that provides everything your end user needs in a way that makes your use of Lua as the core language irrelevant to them.
  17. Maybe it’s the easiest way to design a custom firmware for the ESP8266 module! Whereas the Adafruit Huzzah Board is pre-programmed with the latest version of the NodeMCU firmware, we can easily replace it using the Arduino IDE. This allows us to run our own firmware on the ESP8266, which executes every time the module is powered. WARNING! This method erases the previous firmware from the ESP8266's flash! (To come back to initial configuration of the board, there would be executed the steps described before in the slide 13) It would be the best choice for those users which want to use the latest versions of ESP8266 that allows to use it as a regular micro-controller (as the ATmega328 in Arduino/Genuino UNO).
  18. The Arduino IDE will not initially recognize the ESP8266 since it does not have it installed by default in the devices menu! So we need to install it in the IDE if we want to program the module with it! The installation is quite simple: Open Preferences window of the Arduino IDE; Enter in the Additional Boards Manager URLs field the URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json Go in the Boards Manager and install the last release for esp8266 module by the ESP8266 Web Community; Restart the Arduino IDE; After restarting the Arduino IDE, we can find a specific menu of the different models of ESP8266 boards. Selecting the model of the board, the IDE will automatically set the correct parameters in order to make feasible the USB-to-Serial communication. If all the previous configuration steps are been made correctly, we are now ready to write our custom firmware with the Arduino IDE.
  19. My Idea was to create an application for the remote control of the temperature/humidity in the room with the possibility to turn on/off the light by using the smartphone. The first step was to create a dedicated hardware circuit with the DHT sensor and the Relay module that will be connected to the ESP; Then I created the application code using the Arduino IDE that implement the function that I need; To create the communication between my iPhone and the ESP, I used “Blynk”, an app that was presented by Ioannis during the Projects Presentation and that will be presented in one of the next lectures by my colleague Davide Meacci. I choose it because it has very useful features and because it gives it to me an easy way to communicate with my Wifi module.
  20. This is the scheme of the circuit that I built. There are the ESP and 2 extra components: a light bulb controlled by a relay module and a DHT Temperature Humidity Sensor. A Relay is a switch operated by a relatively small electric current that can turn on or off a larger electric current. It uses an electromagnet to mechanically operate the switch. Relays are used because many electronic sensors are incredibly sensitive to current and they produce only small electric currents. In my case, I need a relay to drive the light that use bigger current (220 against 5V). The relay acts as a bridge making it possible for small current to activate larger one. It could be seen as one circuit to switch on a second circuit. When power flows through the first circuit, it activates the electromagnet that attracts a contact and activates the second circuit. When the power is switched off, a spring pulls the contact back up to its original position, switching the second circuit off again. It has two different behaviours: Normally open and Normally closed. NO: the contacts in the second circuit are not connected by default and switch on only when a current flows through the magnet. NC: the contacts are connected so a current flows through them by default and switch off only when the magnet is activated, pulling or pushing the contacts apart. The relay module in normally open configuration is powered by the GND-V+ pins and controlled by GPIO 12 pins of ESP. The DHT11 is a 4-pin sensor that operates from 3.5 to 5.5V. It takes Temperature/Humidity of the room and send it to the ESP by the GPIO 14 pin. It can measure temperature from 0-50 °C with an accuracy of ±2°C and relative humidity ranging from 20-95% with an accuracy of  ±5%. Let now see the code of my application.
  21. Presentation of the main features of the ESP8266 WiFi module created for the course "Pervasive Systems"University of Rome "La Sapienza"