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
Automatic room temperature controlled fan using arduino uno microcontrollerMohammod Al Emran
This paper presents the designs and the simulation of a DC fan control system based on room temperature using pulse width modulation technique, humidity and temperature sensor namely DHT11 with Arduino Uno Microcontroller. The fan will be used to reduce temperature of a room at certain level. To build the fan, we will use DTH11 Humidity Sensor. The sensor will measure the temperature continuously. When the temperature gets higher from a specific temperature, the fan will be on “On” mode. The speed of the fan will be determined by pwm using pulse-width modulation. The temperature along with the speed of the fan will be displayed through LCD monitor.
This project proposes automatic detection of human and energy saving room architecture to reduce standby power consumption and to make the temperature of the room easily controllable with an IR sensor and Lm35 temperature sensor using air conditioner . The proposed auto-detection of human done using the IR sensor to indicate the entering or exit ofthe persons. Microcontroller continuously monitors the infrared receiver. When any object pass throughthe IR receiver then the IR rays falling on the receiver are obstructed, this obstruction is sensed by the microcontroller ATMEGA16.When the temperature of the room is varied then the lm35 temperature sensor converts this temperature change into voltage which is then sensed by the microcontroller ATMEGA16 .
In such cases our project is aimed at starting one ac among both depending upon the temperature value at a particular room .If the temperature on the particular room is above certain range then the AC in that room will start up and during this time the AC in the other room will remain switched off. When the temperature goes below 25 degree in the room where AC is already on will be switched off automatically. Then if the temperature on the other room during the time is above 30degree then the AC in that room will start up and vice versa .The second feature of our project is aimed at switching of the AC automatically when there is absence of human beings in a particular room .The entire scheme is designed using number of ATMEGA16 microcontrollers , temperature sensors , digital counter ,IR sensors , relay etc.
This project will solve the day-to-day problem where AC’s do not start up due to low voltage generally in rural areas .This will start the AC depending upon the temperature label in a room by sharing the load .Also this project can be extended for controlling the temperature in more rooms in an apartment.
A PRESENTATION ON Simulation Home automation System using Proteus and Arduino...Ekansh Agarwal
A PRESENTATION ON Simulation Home automation System using Proteus and Arduino by Ekansh Agarwal
Table of contents
Introduction
Design and Block diagram
Arduino Mega
DHT 11
Other Sensors
Need for this system
Final Simulation
Code
References
Automatic room temperature controlled fan using arduino uno microcontrollerMohammod Al Emran
This paper presents the designs and the simulation of a DC fan control system based on room temperature using pulse width modulation technique, humidity and temperature sensor namely DHT11 with Arduino Uno Microcontroller. The fan will be used to reduce temperature of a room at certain level. To build the fan, we will use DTH11 Humidity Sensor. The sensor will measure the temperature continuously. When the temperature gets higher from a specific temperature, the fan will be on “On” mode. The speed of the fan will be determined by pwm using pulse-width modulation. The temperature along with the speed of the fan will be displayed through LCD monitor.
This project proposes automatic detection of human and energy saving room architecture to reduce standby power consumption and to make the temperature of the room easily controllable with an IR sensor and Lm35 temperature sensor using air conditioner . The proposed auto-detection of human done using the IR sensor to indicate the entering or exit ofthe persons. Microcontroller continuously monitors the infrared receiver. When any object pass throughthe IR receiver then the IR rays falling on the receiver are obstructed, this obstruction is sensed by the microcontroller ATMEGA16.When the temperature of the room is varied then the lm35 temperature sensor converts this temperature change into voltage which is then sensed by the microcontroller ATMEGA16 .
In such cases our project is aimed at starting one ac among both depending upon the temperature value at a particular room .If the temperature on the particular room is above certain range then the AC in that room will start up and during this time the AC in the other room will remain switched off. When the temperature goes below 25 degree in the room where AC is already on will be switched off automatically. Then if the temperature on the other room during the time is above 30degree then the AC in that room will start up and vice versa .The second feature of our project is aimed at switching of the AC automatically when there is absence of human beings in a particular room .The entire scheme is designed using number of ATMEGA16 microcontrollers , temperature sensors , digital counter ,IR sensors , relay etc.
This project will solve the day-to-day problem where AC’s do not start up due to low voltage generally in rural areas .This will start the AC depending upon the temperature label in a room by sharing the load .Also this project can be extended for controlling the temperature in more rooms in an apartment.
A PRESENTATION ON Simulation Home automation System using Proteus and Arduino...Ekansh Agarwal
A PRESENTATION ON Simulation Home automation System using Proteus and Arduino by Ekansh Agarwal
Table of contents
Introduction
Design and Block diagram
Arduino Mega
DHT 11
Other Sensors
Need for this system
Final Simulation
Code
References
Automatic Light Control using LDR and PIR SensorZiauddin Ridoy
The main purpose of designing this project is to prevent loss of current unnecessarily during day time.
During night the bulb will automatically glow .
COMPONENTS REQUIRED :
RELAY
LIGHT EMITTING DIODE (LED)
LIGHT DEPENDENT RESISTOR (LDR)
PASSIVE INFRARED SENSOR (PIR)
RESISTOR (1k ohm)
DIODE
TRANSISTOR (BC547)
BATTERY (POWER SOURCE)
My slide at the Milan Codemotion 2015, a session called "An Adventure with ESP8266 and IOT" about using the esp8266 with NodeMCU, mosquitto, nodejs and an accelerometer. All the sourcecode will be available at http://pestohacks.blogspot.com soon
Patient Health Monitoring System Using Arduino & ESP8266Rishav Pandey
Sometimes it happens when patients struggles to find hospital beds but due to high number of covid patients they are forced to stay at home and aren't monitored by any doctor. This Health Monitoring System designed with the help of Arduino UNO board and ESP8266 wifi microchip helps the doctor to monitor the patient remotely (connected via an IoT based platform ThingSpeak). ESP8266 wi-fi microchip is used to provide internet connectivity to our project (or we can connect our project to any wifi using same). The system consists of a pulse sensor and and an LM35 temperature sensor which measures the patient's heart beats per minute and body temperature respectively. The Arduino reads the sensor data, converts them into string, passes them to the IoT platform (ThingSpeak) and also displays the BPM and body temperature on LCD display.
In this way a doctor can remotely monitor the patients and take appropriate actions when required.
DHT11 Digital Temperature and Humidity SensorRaghav Shetty
The DHT11 Temperature & Humidity Sensor features a temperature & humidity sensor complex with calibrated digital signal output. By using the exclusive digital-signal-acquisition technique and temperature & humidity sensing technology, it ensures high reliability and excellent long term stability.
This sensor include a resistive type humidity measurement component and a NTC temperature measurement component, and connect to a high performance 8-bit microcontroller, offering excellent quality, fast response, anti-interface ability and cost effectiveness.
It’s of small size, low power consumption and up-to 20 meter signal transmission makes it a best choice for various applications.
The project titled ’IoT Home Automation System’ is designed and implemented using Arduino, PHP and MySQL. The project aims provide user with an automated means to control the devices in their homes using a web application from anywhere on the planet.
Arduino based automatic temperature controlled fan speed regulatorEdgefxkits & Solutions
Using an analog temperature LM35 interfaced to the built in ADC of a programmed Arduino to develop varying duty cycle of PWM output for a driver IC to run a DC motor automatically according to the sensed temperature at different speed based on the temperature sensed.
Temperature Based Fan Controller can be used for reducing the power consumption & also to assist people who are disabled and are unable to control the speed of fan.It may also be used for monitoring changes in environment.
This is the first presentation of my Final Year project done(doing 2015-16) as part of fulfilling my B-Tech degree in CSE from Govt. Engineering College Sreekrishnapuram, Palakkad, Kerala, India.
The project uses ultrasonic sensor and ESP8266 to monitor tank water level at any point of time.
The monitoring aspect has 2 objectives:
To check water level at any given point (achieved with the help of cloud connectivity through Thingspeak)
To send an alert message when tank is filled or empty (achieved with the help of Notify My Android app)
Automatic Light Control using LDR and PIR SensorZiauddin Ridoy
The main purpose of designing this project is to prevent loss of current unnecessarily during day time.
During night the bulb will automatically glow .
COMPONENTS REQUIRED :
RELAY
LIGHT EMITTING DIODE (LED)
LIGHT DEPENDENT RESISTOR (LDR)
PASSIVE INFRARED SENSOR (PIR)
RESISTOR (1k ohm)
DIODE
TRANSISTOR (BC547)
BATTERY (POWER SOURCE)
My slide at the Milan Codemotion 2015, a session called "An Adventure with ESP8266 and IOT" about using the esp8266 with NodeMCU, mosquitto, nodejs and an accelerometer. All the sourcecode will be available at http://pestohacks.blogspot.com soon
Patient Health Monitoring System Using Arduino & ESP8266Rishav Pandey
Sometimes it happens when patients struggles to find hospital beds but due to high number of covid patients they are forced to stay at home and aren't monitored by any doctor. This Health Monitoring System designed with the help of Arduino UNO board and ESP8266 wifi microchip helps the doctor to monitor the patient remotely (connected via an IoT based platform ThingSpeak). ESP8266 wi-fi microchip is used to provide internet connectivity to our project (or we can connect our project to any wifi using same). The system consists of a pulse sensor and and an LM35 temperature sensor which measures the patient's heart beats per minute and body temperature respectively. The Arduino reads the sensor data, converts them into string, passes them to the IoT platform (ThingSpeak) and also displays the BPM and body temperature on LCD display.
In this way a doctor can remotely monitor the patients and take appropriate actions when required.
DHT11 Digital Temperature and Humidity SensorRaghav Shetty
The DHT11 Temperature & Humidity Sensor features a temperature & humidity sensor complex with calibrated digital signal output. By using the exclusive digital-signal-acquisition technique and temperature & humidity sensing technology, it ensures high reliability and excellent long term stability.
This sensor include a resistive type humidity measurement component and a NTC temperature measurement component, and connect to a high performance 8-bit microcontroller, offering excellent quality, fast response, anti-interface ability and cost effectiveness.
It’s of small size, low power consumption and up-to 20 meter signal transmission makes it a best choice for various applications.
The project titled ’IoT Home Automation System’ is designed and implemented using Arduino, PHP and MySQL. The project aims provide user with an automated means to control the devices in their homes using a web application from anywhere on the planet.
Arduino based automatic temperature controlled fan speed regulatorEdgefxkits & Solutions
Using an analog temperature LM35 interfaced to the built in ADC of a programmed Arduino to develop varying duty cycle of PWM output for a driver IC to run a DC motor automatically according to the sensed temperature at different speed based on the temperature sensed.
Temperature Based Fan Controller can be used for reducing the power consumption & also to assist people who are disabled and are unable to control the speed of fan.It may also be used for monitoring changes in environment.
This is the first presentation of my Final Year project done(doing 2015-16) as part of fulfilling my B-Tech degree in CSE from Govt. Engineering College Sreekrishnapuram, Palakkad, Kerala, India.
The project uses ultrasonic sensor and ESP8266 to monitor tank water level at any point of time.
The monitoring aspect has 2 objectives:
To check water level at any given point (achieved with the help of cloud connectivity through Thingspeak)
To send an alert message when tank is filled or empty (achieved with the help of Notify My Android app)
DHT11 based remote temparature Monitor. Uses ESP8266 and DHT11 to monitor temperature remotely using a WiFi connection and Thingspeak and NMA application.
lesson1 - Getting Started with ESP8266Elaf A.Saeed
lesson1 - Getting Started with ESP8266
1- What is NodeMCU.
2- NodeMCU Instillation in Arduino IDE.
3- Simple Projects with NodeMCU (Sensors & Actuators)
4- NodeMCU with Communication protocols.
5- Connection NodeMCU with Wi-Fi.
6- Use NodeMCU as Clients & Server.
7- Different Platform uses with IOT application.
Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online.
IoT Malware Detection through Threshold Random WalksBiagio Botticelli
Presentation of my Master Thesis Project in Engineering in Computer Science of University of Rome "La Sapienza".
The thesis applies the Threshold Random Walk probabilistic algorithm to make an online detection of IoT Malware Families.
Control of Communication and Energy Networks Final Project - Service Function...Biagio Botticelli
Final Project of the Control of Communication and Energy Networks course of the Master Degree in Engineering in Computer Science at University of Rome "La Sapienza".
The technical report introduce the concepts of Service Function Chaining (SFC) and Network Function Virtualization (NFV) analyzing an approach to merge the two technologies.
System and Enterprise Security Project - Penetration TestingBiagio Botticelli
Final Project of the System and Enterprise Security course of the Master Degree in Engineering in Computer Science at University of Rome "La Sapienza".
The report explain which are the goals of Penetration Testing introducing three different attacks (Brute Force, SQL Injection and Command Injection), how to set up a virtualized lab using the Damn Vulnerable Web Application (DVWA) VM.
Contribution for the first homework of the Web Information Retrieval course of the Master Degree in Engineering in Computer Science at University of Rome "La Sapienza".
In the report are introduced the concepts of: Inverted Index, Stemmer, Ranking and Scorer and Evaluation Metrics (Relevance, Precision and Recall)
Presentation of "State of the Art of IoT Honeypots" technical report developed for the Seminar in Advanced Topics in Computer Science course of the Master Degree in Engineering in Computer Science curriculum in Cyber Security at University of Rome "La Sapienza".
Link: https://www.slideshare.net/secret/EfL8YbinRZjDPS
Technical report representing the State of the Art of IoT Honeypots developed for the Seminar in Advanced Topics in Computer Science course of the Master Degree in Engineering in Computer Science curriculum in Cyber Security at University of Rome "La Sapienza".
The paper presents which are the current technologies for honeypots systems together with an introduction to IoT Malware and Botnets & Distributed Denial of Service (DDoS) attacks.
Presentation of "Anonymity in the web based on routing protocols" technical report developed for the Web Security course of the Master Degree in Engineering in Computer Science curriculum in Cyber Security at University of Rome "La Sapienza".
Link: https://www.slideshare.net/BiagioBotticelli/anonymity-in-the-web-based-on-routing-protocols
Technical report developed for the Web Security course of the Master Degree in Engineering in Computer Science curriculum in Cyber Security at University of Rome "La Sapienza".
The paper presents the techniques which allow the user to gain anonymity in the Internet by using Tor and I2P routing protocols.
There is also an introduction to Dark Web and Tor Hidden Services.
Seminar of the Web Security and Privacy course of the Master Degree in Engineering in Computer Science (Cyber Security) of the University of Rome "La Sapienza".
The presentation is about a research project called "Smart Home" in which the Block Chain method is applied in a Smart Home environment to assure Privacy and Security in an IoT context.
Presentation of "Group Tracking", an Android application develop for the Pervasive Systems course of the Master Engineering in Computer Science of University of Rome "La Sapienza".
The target of the app is to track the position of friends obtained by Facebook inside a certain range. This position is obtained by Beacons inside buildings and by GPS outside.
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfFlorence Consulting
Quattordicesimo Meetup di Milano, tenutosi a Milano il 23 Maggio 2024 dalle ore 17:00 alle ore 18:30 in presenza e da remoto.
Abbiamo parlato di come Axpo Italia S.p.A. ha ridotto il technical debt migrando le proprie APIs da Mule 3.9 a Mule 4.4 passando anche da on-premises a CloudHub 1.0.
Italy Agriculture Equipment Market Outlook to 2027harveenkaur52
Agriculture and Animal Care
Ken Research has an expertise in Agriculture and Animal Care sector and offer vast collection of information related to all major aspects such as Agriculture equipment, Crop Protection, Seed, Agriculture Chemical, Fertilizers, Protected Cultivators, Palm Oil, Hybrid Seed, Animal Feed additives and many more.
Our continuous study and findings in agriculture sector provide better insights to companies dealing with related product and services, government and agriculture associations, researchers and students to well understand the present and expected scenario.
Our Animal care category provides solutions on Animal Healthcare and related products and services, including, animal feed additives, vaccination
2.Cellular Networks_The final stage of connectivity is achieved by segmenting...JeyaPerumal1
A cellular network, frequently referred to as a mobile network, is a type of communication system that enables wireless communication between mobile devices. The final stage of connectivity is achieved by segmenting the comprehensive service area into several compact zones, each called a cell.
Understanding User Behavior with Google Analytics.pdfSEO Article Boost
Unlocking the full potential of Google Analytics is crucial for understanding and optimizing your website’s performance. This guide dives deep into the essential aspects of Google Analytics, from analyzing traffic sources to understanding user demographics and tracking user engagement.
Traffic Sources Analysis:
Discover where your website traffic originates. By examining the Acquisition section, you can identify whether visitors come from organic search, paid campaigns, direct visits, social media, or referral links. This knowledge helps in refining marketing strategies and optimizing resource allocation.
User Demographics Insights:
Gain a comprehensive view of your audience by exploring demographic data in the Audience section. Understand age, gender, and interests to tailor your marketing strategies effectively. Leverage this information to create personalized content and improve user engagement and conversion rates.
Tracking User Engagement:
Learn how to measure user interaction with your site through key metrics like bounce rate, average session duration, and pages per session. Enhance user experience by analyzing engagement metrics and implementing strategies to keep visitors engaged.
Conversion Rate Optimization:
Understand the importance of conversion rates and how to track them using Google Analytics. Set up Goals, analyze conversion funnels, segment your audience, and employ A/B testing to optimize your website for higher conversions. Utilize ecommerce tracking and multi-channel funnels for a detailed view of your sales performance and marketing channel contributions.
Custom Reports and Dashboards:
Create custom reports and dashboards to visualize and interpret data relevant to your business goals. Use advanced filters, segments, and visualization options to gain deeper insights. Incorporate custom dimensions and metrics for tailored data analysis. Integrate external data sources to enrich your analytics and make well-informed decisions.
This guide is designed to help you harness the power of Google Analytics for making data-driven decisions that enhance website performance and achieve your digital marketing objectives. Whether you are looking to improve SEO, refine your social media strategy, or boost conversion rates, understanding and utilizing Google Analytics is essential for your success.
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
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;
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
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.
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.
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…
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).
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…
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…
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.
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.
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.
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!
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.
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…
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
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)
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…
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.
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).
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.
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.
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.
Presentation of the main features of the ESP8266 WiFi module created for the course "Pervasive Systems"University of Rome "La Sapienza"