XBee 3 based datalogger that uses Grove Wio-E5 module to send data to LoRaWAN network.
Hardware | Model | Link |
---|---|---|
Main computer | XBee Digi 3 | Link |
Computer board | XBee Explorer USB-C | Link |
LoRaWAN module | Grove Wio-E5 | Link |
Voltage/Current/Power sensor | Adafruit INA260 | Link |
Temperature sensor | Sparkfun TMP102 | Link |
Battery | 3.7V LiPo |
Connections of the hardware used.
Device | PIN | Device | PIN |
---|---|---|---|
XBee Explorer USB-C | VIN | Battery | + |
XBee Explorer USB-C | GND | Battery | - |
XBee Explorer USB-C | 3V3 | INA260 | VCC |
XBee Explorer USB-C | GND | INA260 | GND |
XBee Explorer USB-C | SDA(7) | INA260 | SDA |
XBee Explorer USB-C | SCL(19) | INA260 | SCL |
XBee Explorer USB-C | 3V3 | TMP102 | 3V3 |
XBee Explorer USB-C | GND | TMP102 | GND |
XBee Explorer USB-C | SDA(7) | TMP102 | SDA |
XBee Explorer USB-C | SCL(19) | TMP102 | SCL |
XBee Explorer USB-C | 3V3 | Grove Wio-E5 | 3V3 |
XBee Explorer USB-C | GND | Grove Wio-E5 | GND |
XBee Explorer USB-C | TX(2) | Grove Wio-E5 | TX |
XBee Explorer USB-C | RX(3) | Grove Wio-E5 | RX |
Programming of the XBee modules is done easiest with PyCharm, download it and install it from here.
Once installed, open the plugins
tab and download the Digi XBee
plugin.
Download this repository's code as a ZIP file or clone it directly to your device. Unpack the ZIP file somewhere.
Next open up PyCharm and navigate to File -> Open...
. From the pop-up window, find where you unpacked this repository's code and open the folder, this will create a PyCharm project out of it. The code should already contain all the required libraries.
Plug the USB-C connection to your device via cable. In PyCharm, navigate to the Select an XBee device
and press the Discover and select an XBee device
option in the drop-down window. From here select Local PC
and let it search. If your device is not found, try to modify the search settings.
Upload the code to the built device and check that it is sending data to your LoRaWAN server. PyCharm may also prompt you to enable MicroPython REPL
on the XBee device if it is not on already, allow it.
The XBee 3 that is used here only has 1 UART line which means that both the USB and the Wio-E5 UART connection are on the same line. This causes messages and commands sent to one device appear for the other. The Wio-E5 shouldn't get confused with normal print statements intented for the PC connected, but it may confuse the user