Basic Kit 2: Try STM32 Logging and BLE
Use this page with AI
Set up with your favorite AI
Gemini & other AI
Copy the setup prompt into your AI. Work through each step together, from checking your kit to getting it running.
Copy the prompt, then paste it into Gemini’s message box.
View prompt
Table of contents
This guide is for trying the demo after swapping in the included STM32 MCU. When your Basic Kit 2 arrives, start with the assembled AVR demo. You can keep using AVR; switching to STM32 is optional.
Basic Kit 2 lets you display sensor readings on a phone or computer. Both the AVR and STM32 MCUs have a demo sketch installed, so you can try the original demos without uploading a program or setting up a development environment.
Try the preinstalled demos
- If this is your first time, start with the AVR demo. Keep the kit assembled and follow the AVR demo shared by Basic Kit and Basic Kit 2.
- Consider STM32 when you need more memory or processing capacity. If you choose to swap the MCU, use this page to try on-device logging and low-power operation.
The rest of this page covers the STM32 demo. If you have already uploaded a different sketch, see the STM32 Logger Beacon sample for instructions on uploading the original demo.
Required items and browser support
- Basic Kit 2 and its CR2032 coin cell
- A Bluetooth-capable phone or computer
- Google Chrome on a supported system such as Android, Windows or Mac; Bluefy on iPhone or iPad
For the first check, connect to retrieve the log and view the graph on screen. Receiving beacons is optional. See Browser compatibility later on this page for the detailed requirements.
Setup
Before changing the stack, check the assembly and leaf replacement basics.
-
Turn the power off and disconnect USB before changing the leaves. Remove the Connector Cover from the STM32 MCU. Remove the AVR MCU and USB leaf from the assembled block, then install the STM32 MCU as shown.

-
Set the STM32 MCU's program switch to Run.

-
Insert the CR2032 coin cell and turn the power switch on.

View sensor readings
Connect and start logging
- Turn Bluetooth on and open the STM32 Logger Beacon web app in a supported browser. Allow Bluetooth access if requested.
- Shake Leafony to enter its connection window, then select Connect in the web app within about 20 seconds. Select Leaf_A (the initial device name) from the list and pair. The connection sets the device's clock automatically. Continue when the app shows Connected.
- Check the measurement interval while still connected. Select Check interval in step 2 of the app and note the number of seconds shown. You can try the current setting first.
- Select Disconnect to start recording. Leave Leafony powered on and wait at least the interval you noted before retrieving the log below.
If the device does not appear in the list, shake it and try selecting it again. It waits for a connection for about 20 seconds. To change the interval, open Interval, name and stored data while connected, enter the number of seconds, and select Save interval.
Retrieve the log and view the graph
- Shake the device and reconnect using Connect in step 1 of the web app.
- Select Read stored data (Get Data) in step 4 of the app. After the stored data is received, graphs show temperature, humidity, illuminance and battery voltage.
- The app disconnects automatically when the transfer finishes. Connect again when you want to retrieve newer readings.
If the graphs do not show any readings yet, use Check interval while connected, select Disconnect to start recording, wait, and retrieve the log again.
Check that it worked
When measurement times and values appear in the graphs, your connection, recording and retrieval check is complete. Try beacon reception or CSV download after checking your browser's support.
Next steps
After trying the demo, set up a development environment when you want to upload your own programs.
- Upload your first program with STM32 (AP03): Set up Arduino IDE and display temperature and humidity, or write a Hello World program with PlatformIO
- Understand the STM32 demo: How STM32 Logger Beacon works and its source code
- Change the AVR (AP01) program: Set up Arduino IDE for AVR and check the blinking LED
For a different STM32 development tool, see the STM32 development environment.
Restore the demo
If you uploaded a different program, use the MCU-specific demo restoration guide. Basic Kit 2 has separate AVR and STM32 demos; select the one for the MCU currently in the stack.
Leaves included in the kit
7 types of leaves. Select a photo or name for specifications and pin assignments.
AP03 STM32 MCU
Accessories and other included items
AZ62 Connector Cover
AZ66 Basic Kit Case
- Product sheet× 1
- Product label× 1
- CR2032 coin cell battery× 1
- M2×18 mm screw× 2
- Screwdriver× 1
How the STM32 demo works
MOST OF THE TIME
Measure, store, broadcast
Beacon mode

One-way broadcast
- Periodically measure temperature, humidity, illuminance and battery voltage.
- Store readings in on-device memory (EEPROM).
- Broadcast readings by beacon, then sleep.
Power consumptionUltra-low
WHEN NEEDED
Set up and read the log
Connection mode

Two-way connection
- Initial setup: set the clock and measurement interval.
- Transfer stored data from on-device memory (EEPROM).
- Graph and analyze the downloaded data on a PC or Android phone*.
Power consumptionMedium
Qualitative comparison of the two modes in the demo.
Switching modes
BeaconConnection
Shake Leafony
Then select Connect in the web app.
Motion detection wakes the device and gives the app time to connect.
ConnectionBeacon
Select Disconnect to start recording in the web app.
The device resumes measuring, storing, broadcasting and sleeping.
First, connect to set the device clock. The demo needs the clock set before it can store readings.
Where the data goes
ConnectionRead and analyze the stored log
- Leafony memory
- PC / Android phone*
- Graphing / analysis
BeaconMonitor beacon readings nearby
- Leafony beacon
- Android phone*
- Real-time monitoring
BeaconApplication example: use Raspberry Pi as a receiver
- Leafony beacon
- Raspberry Pi
- Internet / cloud
- Phone: real-time graphing / analysis
This application example requires software for receiving and forwarding data, and a service for displaying it.
* Android only: the phone condition shown in the original demo diagram. The September 2022 guide also describes Bluefy for iPhone connections. Connecting and receiving live beacons have different browser requirements; see the browser notes below and the current compatibility table.
EEPROM here refers to the MCU’s internal Flash used to retain the log, rather than a separate memory leaf.
The STM32 demo normally measures, stores readings and broadcasts beacons, sleeping between cycles to reduce battery use. Connect to a PC or phone when you need to set the clock or measurement interval, or retrieve the stored log.
You can retrieve the readings stored in the device in a batch. Check the browser notes below for connecting or receiving beacons.
Web Bluetooth
The web app can retrieve and graph up to 169 samples stored in the device. If this is your first time, follow View sensor readings on this page to connect, record measurements and retrieve the log.
Browser compatibility
- Connecting to read the log and receiving beacons without a connection have different browser requirements. Chrome provides the connection feature on Android, Windows, Mac and other supported systems. The official compatibility table lists Linux as partially implemented and unsupported, requiring additional settings.
- Receiving beacons is optional. The web app describes this feature for Android. Chrome's Scanning API is experimental and requires
chrome://flags/#enable-experimental-web-platform-featureson a supported system. See the Web Bluetooth implementation status for details. - On iPhone and iPad, open the web app in Bluefy. The September 2022 guide reports that CSV download was unavailable. CSV download in this demo has not been retested with current Bluefy versions, so use the on-screen graph for your first check.
Demo video
Measurement interval and battery life
The measurement interval depends on the installed sketch and saved settings. The original guide estimates that intervals of several minutes may allow months of CR2032 coin cell operation. This is a theoretical estimate, not a measured runtime guarantee; battery condition, supply losses and the program's activity affect runtime. See low-power design for the calculation method.
