Configuring the STM32WL55JC1 as a LORA temperature sensing node and a LORA enabled ESP32 configured as a control hub creates a complete system for environmental monitoring and control. One that can be easily expanded to include other sensors and with the option of connecting to other networks.

In this project an STM32WL55JC1 Nucleo is setup to monitor temperature and transmits the measured value using LORA to an ESP32 WROOM development board which is connected to an RFM95 module, several relays and a 16 by 2 LCD.  

An LMT85LP temperature sensor is connected to analogue pin (A0) on the STM32 board which periodically reads in the analogue voltage, converts it to a temperature measurement and transmits this using LORA at 868Mhz. Push buttons connected to the STM32 board are also monitored and their status transmitted, allowing a receiving station to carry out actions based on push button status: in this case turning relays on and off.

The code makes use of the on chip RTC and low power modes to create a sensor that could be used in battery powered equipment.

The ESP32 receives the LORA transmission and displays the transmitted temperature on the LCD, alongside transmitter information such as the received signal strength (RSSI) and a count indicating the number of transmitter events that have taken place.  Based on the status of push buttons connected to the transmitter, relays on the ESP32 board are turned on and off, allowing control of mains operated or high-powered equipment.

The code for the STM32WL55JC1 and the EPS32 is available and is easily modified to allow other sensors to be connected to a LORA network.

The links to the code and design files are listed below
STM32WL55JC1 code

ESP32 Arduino sketch