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 now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
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 ESP8266 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 (9) Chapters Close

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

Required additional components

To demonstrate how the ESP8266 works, we will use some additional components. These components will help us learn how to read sensor inputs and control actuators using GPIO pins. Through this you can post sensor data to the Internet and control actuators from Internet resources, such as websites.

Required components

The components we will use include:

  • Sensors:
    • DHT11
    • Photocell
    • Soil humidity
  • Actuators:
    • Relay
    • Power switch tail kit
    • Water pump
  • Breadboard
  • Jumper wires
  • Micro USB cable

Sensors

Let's discuss the three sensors that we will be using.

DHT11

The DHT11 is a digital temperature and humidity sensor. It uses a thermistor and capacitive humidity sensor to monitor the humidity and temperature of the surrounding air, and produces a digital signal on the data pin. A digital pin on the ESP8266 can be used to read the data from the sensor data pin.

Note

The DHT11 sensor is not very precise, but it is perfect for experimenting, which we'll be doing in this book.

DHT11

Photocell

A photocell is a light sensor that changes its resistance depending on the amount of incident light it is exposed to. They can be used in a voltage divider setup to detect the amount of light in the surroundings. In a setup where the photocell is used in the VCC side of the voltage divider, the output of the voltage divider goes high when the light is bright and low when the light is dim. The output of the voltage divider is connected to an analog input pin and the voltage readings can be read:

Photocell

Soil humidity sensor

The soil humidity sensor is used for measuring the amount of moisture in soil and other similar materials. It has two large exposed pads that act as a variable resistor. If there is more moisture in the soil, the resistance between the pads drops, leading to a higher output signal. The output signal is connected to an analog pin from where its value is read.

Note

This sensor is mainly used for demonstration purposes, but it is perfect for the projects we'll do in this book.

Soil humidity sensor

Actuators

Let's discuss the actuators.

Relays

A relay is a switch that is operated electrically. It uses electromagnetism to switch large loads using small voltages. It consists of three parts: a coil, spring, and contacts. When the coil is energized by a high signal from a digital pin on the ESP8266, it attracts the contacts, forcing them closed. This completes the circuit and turns on the connected load. When the signal on the digital pin goes low, the coil is no longer energized and the spring pulls the contacts apart. This opens the circuit and turns off the connected load:

Relays

Power switch tail kit

A power switch tail kit is a device that is used to control standard wall outlet devices with microcontrollers. It is already packaged to prevent you from having to mess around with high voltage wiring. Using it, you can control appliances in your home using the ESP8266:

Power switch tail kit

Water pump

A water pump is used to increase the pressure of fluids in a pipe. It uses a DC motor to rotate a fan and create a vacuum that sucks up the fluid. The sucked fluid is then forced to move by the fan, creating a vacuum again that sucks up the fluid behind it. This in effect moves the fluid from one place to another:

Water pump

Breadboard

A breadboard is used to temporarily connect components without soldering. This makes it an ideal prototyping accessory that comes in handy when building circuits:

Breadboard

Jumper wires

Jumper wires are flexible wires that are used to connect different parts of a circuit on a breadboard:

Jumper wires

Micro USB cable

A micro USB cable will be used to connect the Adafruit ESP8266 board to the computer:

Micro USB cable

See also

Having understood the components that you are going to use with Adafruit ESP8266, you can now proceed to the next step and learn how to upload sketches to your ESP8266.

You have been reading a chapter from
ESP8266 Internet of Things Cookbook
Published in: Apr 2017
Publisher: Packt
ISBN-13: 9781787288102
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 $19.99/month. Cancel anytime