STM32 Logger Beacon
This is a sample design of a BLE Beacon that can record temperature, humidity and measurement time using the Flash memory in the STM32 leaf.
The temperature/humidity measurement method using Beacon can only provide the temperature/humidity at the current time, and in order to know the measured values up to now, it was necessary to constantly receive Beacon radio waves with a separately installed receiver.
Since Beacon’s radio wave is very weak and its transmission time is short, it is often missed during reception, which is insufficient for stable measurement.
However, in this sample, the measurement record can be kept in the non-volatile memory installed in the STM32, so even if the Beacon signal is not received, the data recorded in the non-volatile memory can be retrieved later by connecting to Leafony.
This sample also includes a web application sample that can both receive Beacon and read data written to STM32 Flash memory.
Sample source code
The source code for the sketches and tools used can be viewed in the repository below.
Sample-Sketches/STM32_Logger_Beacon at master · Leafony/Sample-Sketches
STM32 Sensors Logger Web Application
What to prepare
- Android smartphone
Laef to use
|-||CR2032 coin cell battery||1|
How it works
Write a sample sketch on the STM32 leaf.
Open the web app on your Android smartphone, and once it is connected to Leafony, the current time on your smartphone will be registered. After that, once the connection with Lefaony is disconnected, it will shift to Beacon operation.
The web app side receives the Beacon signal and displays the current temperature.
When you connect Leafony again and press the Log button, the STM32’s Flash memory will be read out and a graph of the past temperature and humidity will be displayed.