The MagPi - July 2018

(Steven Felgate) #1

raspberrypi.org/magpi May 2018 79


Feature


raspberrypi.org/magpi July 2018 79


KEEP IT DRY


Find two waterproof enclosures: one
larger one for the Pi and the breadboard
or HAT, and another smaller one for the
BME280 sensor. The larger box should
have a couple of holes for the RJ11 cables
connecting the wind and rain sensors,
and for some long wires to the BME280.
If using the recommended enclosures
(see p70), you can use this 3D-printable
mount (magpi.cc/aadkGv) to secure the
Raspberry Pi inside the larger box, and
this one (magpi.cc/rGSAQc) to hold the
BME280 sensor in the smaller one.


STEP 2


SEAL IT UP
Use short self-tapping screws to secure
the mounts into the holes and/or
grooves at the back of the larger box.
In order to get representative readings
for ambient temperature and humidity,
air needs to circulate around the BME280


STEP 1


You should now have a working
weather station prototype on a
breadboard. For a more robust,
long-term installation, or if you
don’t have room for a breadboard
in your enclosure, you can construct
a weather station HAT (hardware
attached on top) for your Pi. This
will involve some soldering – if
you’ve never soldered before,
Raspberry Pi has a great resource
plus video tutorial to get you started:
magpi.cc/VKGfig.
Note that to really be able to call it
a HAT, your board should include a
programmed EEPROM. The Adafruit
Perma-Proto HAT kit does come as
a variant with an EEPROM, so this
is definitely something you could
do, although we aren’t covering
the procedure in this guide. A
good place to start is this GitHub
repository (magpi.cc/ILpFCS), or
this article (magpi.cc/iAEnXI).
If you want to turn the
components into a HAT, then
follow these instructions:
magpi.cc/INdatp.

BUILD A WEATHER STATION


sensor. Remove both hole covers from
one side of the smaller box. You can then
pass the wires for the sensor up through
one hole. Make sure you mount this box
outside with the holes facing downwards
so that rain cannot enter this way.
Use waterproof nylon cable glands to
prevent moisture entering the enclosure
through the holes used for the cables.

STEP 3


PLUG THE HOLES
The larger recommended enclosure has
holes on all four sides that are sealed
with rubber plugs. Use three of these
holes along the bottom of the box to
provide an escape route for your cables.
Use an M16 cable gland in each of the
two outer holes and pass the cable for
the rain gauge through one and the cable
for the wind sensors through the other.
Use the larger M20 gland for the
centre hole and feed the power cable,
DS18B20 probe, and the wires for the
BME280 sensor through.

STEP 4


CRACKIN’, GROMMET
The hole in the M20 is quite large, so you
should pad the cables to ensure a tight
fit. A 3D-printable grommet is available
at magpi.cc/PrfCnV. Use two grommets
rotated at 180 degrees to each other so
that there is no gap all the way through.

STEP 5


MOUNTED OUTSIDE
You could mount your station on a wall,
rooftop, fence, or even on a plumbing
pipe stuck in the ground. The larger box
can be installed inside, to help keep it dry
and allow easier connection to power and
networking. However, the various cables
for the external sensors (rain gauge, wind
vane, anemometer, and BME280) will
then all need to be routed inside, so this
may involve a bigger hole in an external
wall. Mounting everything outside means
you only have to supply power to the
weather station (assuming you are using
wireless connectivity for data transfer).

It is not possible to provide specific
instructions for mounting your
station, as the exact method will
depend on your particular location
and environment. However, here are
some tips for a couple of aspects
of the process that should help you
get started:


  • Installing your Weather
    Station outside: wind sensors
    (magpi.cc/Pxbabi).

  • Installing your Weather Station
    outside: connecting to WiFi
    (magpi.cc/jujoYP).
    You may not be able to find an ideal
    location. Perhaps trees block the
    wind, or the rain gauge is partially
    sheltered by an overhang. Don’t
    worry, just install your weather
    station anyway.

  • The rain gauge needs to
    collect rain.

  • The anemometer and wind
    vane need to be in the wind.

  • The smaller BME280 box
    needs to breathe – try to avoid
    situating it in direct sunlight.

  • The weather station needs to
    be connected to power, and to
    a network (wirelessly or via an
    Ethernet cable).

Free download pdf