sparkfun ESP32 Technisches Dokument

ESP32 Environment Sensor Shield Hookup
Guide
Introduction
The ESP32 Environment Sensor Shield provides sensors and hookups for
monitoring environmental conditions. This tutorial will show you how to
connect your sensor suite to the Internet and post weather data online.
Required Materials
You’ll need the ESP32 Thing board to interface with this shield. Other
microcontroller boards will work, but since the shield is designed to stack on
the ESP32 Thing, interfacing with them will be difficult.
You’ll also need some means of connecting the two boards together. While
it’s possible to solder them together using snappable male header pins, it
makes good sense to use female headers on one of the boards board so
the boards can be separated again later if needed.
SparkFun ESP32 Thing Environment Sensor
Shiel
d
DEV-14153
Page 1 of 20

The ESP32 Environment Sensor Shield comes with connections for our
weather station. You may also wish to add a soil moisture sensor, which
you’ll need two three-position 3.5mm screw terminals and enough wire to
connect the sensor to the board.
SparkFun ESP32 Thin
g
DEV-13907
Break Away Headers -
Straight
PRT-00116
Female Headers
PRT-00115
Weather Meters
SEN-08942
SparkFun Soil Moisture
Sensor
SEN-13322
Screw Terminals 3.5mm
Pitch (3-Pin
)
PRT-08235
Page 2 of 20

Tool
s
At a minimum, you’ll need a soldering iron and some solder. You may need
a small screwdriver for attaching the wire to the screw terminals between
the soil moisture sensor and the sensor shield. Our pocket screwdriver and
screwdriver kit both have bits that will work wonderfully for that purpose.
They’re also just handy to keep around!
Suggested Reading
If you have not yet used the ESP32 Thing Development Board, check out
this guide first.
If you aren’t familiar with the following concepts, we recommend checking
Soldering Iron - 30W (US,
110V
)
TOL-09507
Solder Lead Free - 15-gram
Tube
TOL-09163
Tool Kit - Screwdriver and
Bit Set
TOL-10865
Pocket Screwdriver Set
TOL-12891
ESP32 Thing Hookup Guid
e
O
CTOBER 27, 2016
A
n introduction to the ESP32 Thing's hardware features, and a primer on
using the WiFi/Bluetooth system-on-chip in Arduino.
Page 3 of 20

out these tutorials before continuing.
Hardware Overview
The ESP32 Environment Sensor Shield incorporates three sensors capable
of measuring five different environmental variables. It also provides
connections for several other sensors that can be connected if so desired.
Onboard Sensors
All of the onboard sensors are connected to the ESP32 via I C connection.
Pressure, Humidity, and Temperature
The first onboard sensor is a Bosch BME280. This sensor measures
relative humidity, temperature, and barometric pressure. On the back side
of the board is a solder jumper (labeled JP1) which can be closed to
change the I C address of the chip. By default the address is 0x77; closing
the jumper forces the address to 0x76.
How to Solder: Through
-
Hole Solderin
g
This tutorial covers everything you
need to know about through-hole
soldering.
Analog to Digital Conversion
The world is analog. Use analog to
digital conversion to help digital
devices interpret the world.
I2C
A
n introduction to I2C, one of the
main embedded communications
protocols in use today.
2
2
Page 4 of 20

Air Quality and Temperature
Next is the ams CCS811 air quality and temperature sensor. Note the
routed out region around this sensor. That provides a buffer against thermal
changes stimulated by the circuitry on the rest of the PCB. As with the
BME280, it is possible to change the I C address of this sensor. Closing
jumper JP2 on the reverse side of the board causes the sensor to adopt
address 0x5A, and by default it will be 0x5B.
Luminosity
The last onboard sensor is the Broadcom APDS-9301. It’s capable of
detecting and reading light levels from nighttime through broad daylight.
Keep in mind that the sensor will saturate if exposed to direct sunlight. By
defaul, the sensor will have an I C address of 0x39. By adding a solder
jumper toward 0 on the jumper pads labeled JP3 on the back of the board,
the address can be changed to 0x29. By adding a solder jumper toward 1,
the address can be set to 0x49.
Jumpers on Back of the Board
There are five jumpers on the back of the board.
2
2
Page 5 of 20

Here’s what they do:
JP1 - Close this jumper with a solder blob to change the I2C address of the
BME280 sensor from 0x77 to 0x76.
JP2 - Close this jumper with a solder blob to change the I2C address of the
CCS811 sensor from 0x5B to 0x5A.
JP3 - Close the 0 half of this jumper with a solder blob to set the address of
the APDS-9301 sensor to 0x29. Close the 1 half of this jumper to set the
address to 0x49. If you accidentally bridge the entire jumper, the address
will be 0x29, but nothing bad will happen.
JP4 - Cut this trace to disable the onboard NTC thermistor used by the
CCS811 for temperature compensation. If you do this, you must add an
external NTC thermistor for the CCS811 to work properly.
JP5 - Cut the traces on this jumper to disable the pull-up resistors for the
I2C bus.
Optional, off-board Sensors
There are connections for five off-board sensors as well: wind speed and
direction, rainfall amount, temperature, and soil moisture.
Wind Speed and Direction
Coupled with SparkFun’s weather station, the wind speed and direction can
be measured by counting pulses per second and by measuring the
resistance of a discrete step potentiometer. The pins for these two functions
are connected to ESP32 Thing pins 14 (speed) and 35 (direction).
One tick per second corresponds to 1.492mph (2.40 kph) of wind speed.
Obviously, the orientation of the weather meter determines what the
resistance is for a given position. Sixteen positions are available and the
Page 6 of 20

voltage corresponding to each can be found on page 2 of the weather
meter’s datasheet. Our example code provides you with a solid example on
using the direction sensor, as well.
Soil Moisture
SparkFun’s soil moisture sensor can be connected to the shield and
monitored via analog voltage conversion. The sensor connects to pin 26 of
the ESP32 Thing.
Rainfall
The weather station will also provide you with a rainfall gauge. Much like
the wind speed gauge, the rainfall gauge generates ticks to tally the amount
of rain that has fallen. Count ticks to determine how much rain has fallen
recently. Each tick represents 0.011" (0.28mm) of rainfall. This sensor is
connected to pin 25 of the ESP32.
External Temperature
If you so desire, you can connect one of our TMP36 external temperature
sensors to the board at this location. Connecting it through a short wire will
allow you to measure temperature outisde of the enclosure that the rest of
the system is in. It measures with a 10mV/deg C output voltage. It is
connected to pin 13 of the ESP32.
Page 7 of 20

Any I2C Sensor
We’ve provided a header which will allow you to connect any other I2C
sensor or device you may think useful to the board. In fact, the pinout of this
header is such that many SparkFun I2C boards can be directly attached
without any wire order change at all!
Hardware Assembly
As previously mentioned, it’s a good idea to use headers (both male and
female) to connect the two boards. Here we’ll show you a bomb-proof
method to solder down the headers and making sure that they’re true and
square so it’s easier to connect (and disconnect) the two boards.
Trim the Headers
When you purchase male and female headers, they’ll be too long for the
ESP32 Thing and Environment Sensor Shield. You’ll need to trim them
down to an appropriate length. This means 20 pins each.
For the male headers, this is relatively easy–they’re designed to be trimmed
or snapped to length. They come in 40-position pieces, so you’ll only need
to order one and then snap it in half.
Page 8 of 20

For the female headers, however, things are a little trickier. In order to trim
to the appropriate length, you’ll lose one pin since these come in 40-
position pieces as well. That means you’ll need to order two of these in
order to get two 20-position pieces, and you’ll have two 19-position pieces
left over. Bummer, I know.
The best way to trim the female header pieces is to count out 20 pins, pull
the 21st pin, then use a side cutter to cut the gap between the 20th and
22nd pin.
You must be careful when cutting the header to center your snip. An off
center cut may result in the mechanical portion of the header escaping or
losing some of its retention force.
Optionally, you may take a file, piece of sandpaper, or some other
sanding/grinding tool to sand down the end of the header so that it’s
smoother. You can do both pieces at the same time by holding them
together and rubbing the ends on the finishing surface.
Install the Male Headers
We’re going to install the male headers on the ESP32 Thing board first.
We’re going to do so “right side up”, with the headers extending down from
the side of the board with no components on it. This is easier than doing it
the other way as the connectors on the component side of the board create
a difficult gap when attempting this method from that side.
First, insert your male headers long-side-down into a breadboard, as shown
below. You can see that we’re inserting the headers into the second column
in from the edge–columns labeled as B and I on the breadboard we’re
using here.
Page 9 of 20

Now, with the headers installed, you can easily drop the ESP32 Thing
board into place on top of them.
Go ahead and solder all the pins to the ESP32 Thing at this time.
If you're new to soldering, check out our through-hole soldering
tutorial. We'll wait here.
If you’re new to soldering, you may want to solder just the first and last
position on each side, then pull the board free of the breadboard, to avoid
heat damage to your breadboard. You may find it easier to remove the
board from the breadboard by inserting a flat-edge screwdriver under the
end of the ESP32 and gently levering the board away from the breadboard
by turning the handle of the screwdriver.
Install the Female Headers
Page 10 of 20
Andere Handbücher für ESP32
1
Dieses Handbuch passt für folgende Modelle
1
Inhaltsverzeichnis
Andere sparkfun Zubehör Handbücher




















