Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
ESP8266 Internet of Things Cookbook

You're reading from   ESP8266 Internet of Things Cookbook Over 50 recipes to help you master the ESP8266's functionality

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781787288102
Length 268 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Marco Schwartz Marco Schwartz
Author Profile Icon Marco Schwartz
Marco Schwartz
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

ESP8266 Internet of Things Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Configuring the ESP8266 FREE CHAPTER 2. Your First ESP8266 Projects 3. More ESP8266 Functions 4. Using MicroPython on the ESP8266 5. Cloud Data Monitoring 6. Interacting with Web Services 7. Machine to Machine Interactions Index

Reading data from a sensor using MicroPython


Reading sensor data is an essential function of the ESP8266. You can do that using MicroPython. To demonstrate it, we are going to read the temperature and humidity from the DHT11 sensor using MicroPython.

Getting ready

In this tutorial, you will need an ESP8266 board, a USB cable, and a few other components, which include:

Mount the ESP8266 board and the DHT11 sensor onto the breadboard. Connect a 10 kΩ pull up resistor to the DHT11 data pin and connect the pin and GND pin to the 3V pin and GND pin of the ESP8266 board, respectively. Finally, connect the data pin of the DHT11 to GPIO 5 of the ESP8266 board. Use jumper wires to do the connections.

The setup is shown in the following diagram:

Note

Refer back to Chapter 2, Your First ESP8266 Projects to confirm the DHT11 pin configuration.

How to do it…

You can use MicroPython to read digital signals...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images