Connecting the sensors
The first step is to connect the two sensors to the Raspberry Pi Pico (H). Both sensors use the I2C protocol and can therefore be connected very easily.
The simplest way to connect the two sensors is with a qwicc cable, as shown in the following picture.
Alternatively, the connection can also be soldered. To do this, we solder connecting cables between the contact points of the two circuit boards:
The connection to the Baseshield can be made using a qwicc Grove adapter cable.
Alternatively, this connection can also be soldered if we cut off the plug at one end of a Grove cable and solder the cable on like a sensor board:
The sensors can be plugged into the following connections on the base shield:
Anschließen der Sensoren
Im ersten Schritt schließen wir die beiden Sensoren an den Raspberry Pi Pico (H) an. Beiden Sensoren benutzen das I2C-Protokoll und können somit sehr einfach angeschlossen werden.
Die einfachste Verbindung der beiden Sensoren geschieht, wie im folgenden Bild dargestellt mit einem qwicc-Kabel.
Alternativ kann die Verbindung auch gelötet werden. Dazu löten wir Verbindungsleitungen zwischen die Kontaktepunkte der beiden Platinen:
Die Verbindung mit dem Baseshield kann mittels einem qwicc-Grove-Adaperkabel erfolgen.
Alternativ kann auch diese Verbindung gelötet werden, wenn wir an einem Ende eines Grove-Kabels den Stecker abschneiden und das Kabel wie eine Sensorplatine anlöten:
Am Baseshield können die Sensoren an folgende Anschlüsse eingesteckt werden:
Software test of the sensors
We can easily check the correct connection of the sensors to the Raspberry Pi Pico (H) by searching the I2C bus.
If the Raspberry Pi Pico (H) finds sensors on the I2C bus, the program outputs the corresponding device addresses.
The BME280 sensor has the addresses 0x76 or 0x77.
The ENS160 sensor has the addresses 0x52 or 0x53.
If the Raspberry Pi Pico (H) does not find any sensors on the I2C bus, this is also output by the program.
A common mistake is to mix up the SCK and SDI cables!
Connection of the LoRaWAN radio module
A LoRaWAN radio module is connected to the serial port of the Raspberry Pi Pico (H) to transmit the measurement data. With this radio technology, data can be sent over a greater range and with lower power consumption than with WLAN, for example.
The radio module is programmed via the serial interface using AT commands.
A description of the individual commands can be found in the Lora-E5 command specification.
LoRa-E5 AT Command Specification_V1.0 .pdf
Power consumption of the radio module
The power consumption of the radio module is by far the highest for the weather station. It therefore makes sense to keep the transmission and reception time as short as possible.
You should therefore think carefully in advance about what you send and how often!
Power consumption of the radio module
The power consumption of the radio module is by far the highest for the weather station. It therefore makes sense to keep the transmission and reception time as short as possible.
You should therefore think carefully in advance about what you send and how often!
Preparation of the timer board
A TPL5111 board from Adafruit is installed to save energy. After a measurement has been carried out and sent via radio, the Raspberry Pi Pico (H) sends a signal to the TPL5111 board. This then switches off the power supply for a set time. After this time has elapsed, the TPL5111 board switches the power supply back on and a new measurement is carried out.
In order for the control between the Raspberry Pi Pico (H) and the TPL5111 board to work, the two parts must be connected as follows:
TPL5111 board | -> | Rasberry Pi Pico (H) | cable color | |||
---|---|---|---|---|---|---|
VDD | -> | VSYS (PIN 39) | red | |||
GND | -> | GND (PIN 38) | black | |||
delay | -> | not connected | ||||
ENout | -> | 3V3EN (PIN 37) | orange | |||
DONE | -> | I/O-PIN (PIN 34) | brown |
The adjustable resistor can be used to change the time for which the TPL5111 board interrupts the power supply.
To make it easy to set the switch-off time, Texas Instruments (manufacturer of the TPL module) provides the following information in the data sheet:
The resistance can be measured between the DELAY and GND connections on the TPL5111 board.
The battery connections (+) and (-) can be soldered to the back of the TPL5111 board.