4. CONNECT SENSORS TO METRO THROUGH
BFREE
Now let’s set up the weather station. Follow the
wiring diagram (Figure
C
) to connect the Si7021
temperature and humidity sensor module (black)
and the RFM9x LoRa transceiver (blue) to your
BFree shield on top of the Metro M0.
Before running your weather station from
the solar panel, lets test that everything works
on constant power. Connect the Metro to
your computer, and upload the Battery Free
Transmitter code from the Weather Station
repo. This new main.py program accumulates
temperature and humidity samples, averages
them, and sends them as a LoRa packet in a
continuous, non-breakable loop.
Now monitor the serial port as you connect
and disconnect the Metro from your computer.
Whenever the station broadcasts a LoRa
message, it will also print a message to the serial
port containing all the information sent in the
LoRa frame and the number of samples collected
since the start of the program (Figure
D
).
5. SET UP THE LORA RECEIVER
Now that your LoRa transmitter is working, you
need a receiver. Connect the second RFM9x
LoRa transceiver directly to the second Metro
M0 Express board, using the same pins as
before (Figures
E
and
F
). This receiver will be
permanently connected to a PC via a USB port
and continuously listen for LoRa frames sent by
your weather station.
C
PROJECTS: Perpetual Computing
Vito Kortbeek and Przemysław Pawełczak
C
D
E
F
G
86 makezine.com
M82_82-89_BatteryFreeComp_F1.indd 86M82_82-89_BatteryFreeComp_F1.indd 86 7/11/22 4:34 PM7/11/22 4:34 PM
..................Content has been hidden....................

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