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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.121.242