Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Master Degree in Engineering in Computer Science
Dipartimento di Ingegneria Informatica Automatica e Gestionale "Antonio R...
Contents
1. Introduction to ESP8266 family
2. Adafruit Huzzah ESP8266 WiFi Board
3. Programming ESP8266
4. Example of Appl...
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...
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
• Exte...
Why Adafruit Huzzah ESP8266?
WARNING! The ESP8266 operates at 3,3 V!
Most of the first versions do not have an
onboard volt...
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:...
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 logi...
Adafruit Huzzah ESP8266
Analog Pin
• A: analog input.
Other Control Pins
• LDO: enable pin;
Easy way to cut power OFF:
whe...
Programming ESP8266
In order to make them work properly, remember to install the correct driver!
USB-to-Serial
To establis...
Programming ESP8266
Firmwares
Different options for firmware are available: each one allows to program the
chip in a differ...
Firmware: Installation
To load the firmware in the chip, it’s needed to use:
• Flashing Tool: esptool, a Python-based cross...
AT+ Commands
Maybe the quickest way to get started with the ESP8266!
It allows ESP8266 to process AT+ Commands received ov...
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 execu...
Arduino IDE
Whereas the Adafruit Huzzah Board is pre-programmed with the  NodeMCU
firmware, it’s possible to replace it wit...
Arduino IDE
The Arduino IDE will not initially recognize the ESP8266!
ESP8266 in the Arduino IDE
• Open Preferences window...
Example
Steps:
1. Build the hardware circuit on which the application is based;
2. Develop the custom firmware with the Ard...
Example: Hardware
21
Intro HuzzahESP8266 Programming Example
Example: Blynk Front-End
22
Blynk: IoT Control User Interface for ESP8266 module
Intro HuzzahESP8266 Programming Example
U...
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
• NodeMC...
ESP8266
27
Thank You !
Upcoming SlideShare
Loading in …5
×

Adafruit Huzzah Esp8266 WiFi Board

Presentation of the ESP8266 WiFi module created for the course Pervasive Systems 2016 of the Master Degree in Engineering in Computer Science (DIAG, University of Rome "La Sapienza")
Pervasive Systems 2016 Web Site: http://ichatz.me/index.php/Site/PervasiveSystems2016
LinkedIn Profile: https://www.linkedin.com/in/biagio-botticelli-444b87105?trk=hp-identity-name
GitHub Repository: https://github.com/biagiobotticelli/ESP8266

  • Login to see the comments

Adafruit Huzzah Esp8266 WiFi Board

  1. 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. 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. 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
  4. 4. ESP8266 Family Adafruit Huzzah ESP8266 4 Intro HuzzahESP8266 Programming Example
  5. 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. 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. 7. Why Adafruit Huzzah ESP8266? Small Dimension: 25x38x5 mm Very low cost board! 7 Intro HuzzahESP8266 Programming Example
  8. 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. 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. 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. 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. 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. 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. 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. 15. AT+ Commands Set 15 Intro HuzzahESP8266 Programming Example
  16. 16. AT+ Commands Set 16 Intro HuzzahESP8266 Programming Example
  17. 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. 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. 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. 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
  21. 21. Example: Hardware 21 Intro HuzzahESP8266 Programming Example
  22. 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. 23. Example: Arduino IDE 23 Intro HuzzahESP8266 Programming Example
  24. 24. Example: Arduino IDE 24 Intro HuzzahESP8266 Programming Example
  25. 25. ESP8266 25 Questions & Discussion
  26. 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
  27. 27. ESP8266 27 Thank You !

×