Sample apps

Find sample programs by purpose and MCU.

How to run samples
PurposeSelect one
MCU

52samples

Check each sample for its kit and leaf requirements.

Blink an LED with STM32CubeIDE

Use an STM32CubeIDE project to turn the AP03 STM32 MCU LED on and off every second. Covers downloading, importing, building, programming, and checking the result.

Displays, sound, and LEDs Beginner
MCU
STM32
Kit
AP03 STM32 MCU + USB and power leaves
Tools
STM32CubeIDE

Read battery

Read the battery voltage using the AD converter on the CR2032 coin cell leaf.

Sensors and measurement Beginner
MCU
AVR
Kit
Basic Kit / Basic Kit 2

Button

Displays the status of the boot mode switch on the ESP32 MCU leaf on the serial monitor.

Sensors and measurement Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit / Kit 2

Temperature and humidity sensor

This sample reads the value of the temperature and humidity sensor on the 4-Sensors Leaf and displays it on a serial monitor.

Sensors and measurement Beginner
MCU
STM32
Kit
Basic Kit 2

Temperature and humidity sensor

This sample reads the value of the temperature and humidity sensor on the 4-Sensors Leaf and displays it on a serial monitor.

Sensors and measurement Beginner
MCU
AVR
Kit
Basic Kit / Basic Kit 2

Read HTS221 Temperature and Humidity with ESP32

Use Leafony AP02 ESP32 MCU and AI01 4-Sensors to read HTS221 data in Arduino's serial monitor. Covers assembly, sample code and two-point correction.

Sensors and measurement Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Basic Kit 2

Illum sensor

This sample reads the value of the illuminance sensor on the 4-Sensors leaf and displays it on the serial monitor.

Sensors and measurement Beginner
MCU
STM32
Kit
Basic Kit 2

Illum sensor

This sample reads the value of the illuminance sensor on the 4-Sensors leaf and displays it on the serial monitor.

Sensors and measurement Beginner
MCU
AVR
Kit
Basic Kit / Basic Kit 2

Illum sensor

This sample reads the value of the illuminance sensor mounted on the 4-Sensors leaf and displays it on the serial monitor.

Sensors and measurement Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Basic Kit 2

Accelerometer

Read acceleration with AP03 STM32 MCU and AI01 4-Sensors using Arduino IDE. Includes required libraries, the I2C address, 115200 bps output, and checks.

Sensors and measurement Beginner
MCU
STM32
Kit
Basic Kit 2
Tools
Arduino IDE

Accelerometer

This sample reads the value of the accelerometer on the 4-Sensors Leaf and displays it on a serial monitor.

Sensors and measurement Beginner
MCU
AVR
Kit
Basic Kit / Basic Kit 2

Accelerometer

This sample reads the value of the accelerometer mounted on the 4-Sensors leaf and displays it on the serial monitor.

Sensors and measurement Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Basic Kit 2

Read battery

Read the battery voltage using the AD converter on the CR2032 coin cell leaf.

Sensors and measurement Beginner
MCU
STM32
Kit
Basic Kit 2

IR sensor

Using an infrared sensor IC (AKM AK9754AE) for close-range detection on the SP&PIR Leaf, let's create a system that makes a sound when a person approa

Sensors and measurement Beginner Uses discontinued leaves
MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

IR sensor

Using an infrared sensor IC (AKM AK9754AE) for close-range detection on the SP&PIR Leaf, let's create a system that makes a sound when a person approa

Sensors and measurement Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Extension Kit

IR sensor

Using an infrared sensor IC (AKM AK9754AE) for close-range detection on the SP&PIR Leaf, let's create a system that makes a sound when a person approa

Sensors and measurement Beginner Uses discontinued leaves
MCU
STM32
Kit
Basic Kit 2 + Extension Kit

Sound level meter

Let's assemble leaves as shown in the figure below.

Sensors and measurement Beginner Uses discontinued leaves
MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

Sound level meter

As you rotate the volume, the number of LEDs light up in proportion to the amount of rotation. You can also turn on the number of LEDs according to th

Sensors and measurement Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Extension Kit

Sound level meter

As you rotate the volume, the number of LEDs light up in proportion to the amount of rotation. You can also turn on the number of LEDs according to th

Sensors and measurement Beginner Uses discontinued leaves
MCU
STM32
Kit
Basic Kit 2 + Extension Kit

Distance sensor

An example of using Seeed Studio's Grove series of sensors. The distance measured by the ultrasonic sensor is displayed on the LCD. Ultrasonic sensors

Sensors and measurement Advanced Uses discontinued leaves

Requires a Grove ultrasonic distance sensor

MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

Real time clock

In order to make this sketch work, you need to install the libraries If you haven't installed it yet, refer to Environment to install it.

Displays, sound, and LEDs Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit / Kit 2

Speaker

Use the piezoelectric loudspeaker in the SP&PIR Leaf to make the melody sound.

Displays, sound, and LEDs Beginner Uses discontinued leaves
MCU
STM32
Kit
Basic Kit 2 + Extension Kit

自動測定監視システム(抵抗と温度を測定してGoogle Sheetsに保存)

このサンプルはGoogle SheetsをつかったIoTサービス入門で紹介したものと抵抗測定を組み合わせたものです。 Leafony で恒温槽内複数の被測定基板の抵抗と温度を測定してBeaconで送信しRaspberry Piを使ってGoogle スプレッドシートに測定データを保存します。

Sensors and measurement Advanced Japanese article

Requires a Raspberry Pi and a prototyping board

MCU
AVR
Kit
Basic Kit / Basic Kit 2

micro SD

c++ / Connect the SD card to the following pins: SD Card ESP32 D2 - D3 SS CMD MOSI VSS GND VDD 3.3V CLK SCK VSS GND D0 MISO D1 - / include "FS.h" incl

Displays, sound, and LEDs Beginner Uses discontinued leaves

Requires a microSD card

MCU
ESP32
Kit
ESP32 Wi-Fi Kit / Kit 2

LCD

Let's assemble leaves as shown in the figure below.

Displays, sound, and LEDs Beginner Uses discontinued leaves
MCU
STM32
Kit
Basic Kit 2 + Extension Kit

体重計

このサンプルはWeb Bluetoothを使ったIoTアプリ入門で紹介したものと歪センサーを組み合わせたものです。BLEを使って体重をスマートフォンやパソコンに表示することができます。

Sensors and measurement Advanced Japanese article

Requires strain sensors and an HX711 board

MCU
AVR
Kit
Basic Kit / Basic Kit 2

Web Bluetooth IoT with STM32

This sample is an STM32 implementation of the one introduced in the Basic Kit Web Bluetooth IoT. The Web Bluetooth application uses the same one as th

BLE / Wi-Fi Advanced
MCU
STM32
Kit
Basic Kit 2

Speaker

Use the piezoelectric loudspeaker in the SP&PIR Leaf to make the melody sound.

Displays, sound, and LEDs Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Extension Kit

STM32 Simple BLE Beacon

This is a simple BLE Beacon sample design using STM32 Leaf. Send the string "HELLO BEACON" for a period of time, then repeat the sleep cycle.

BLE / Wi-Fi Advanced
MCU
STM32
Kit
Basic Kit 2

Blink

Turns on and off the LEDs on the AVR MCU leaf every second.

Displays, sound, and LEDs Beginner
MCU
AVR
Kit
Basic Kit / Basic Kit 2

LCD

Let's assemble leaves as shown in the figure below.

Displays, sound, and LEDs Beginner Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Extension Kit

Wi-Fi touch sensor

View ESP32 Wi-Fi Kit touch readings in a phone or PC browser. Connect to Leafony's Wi-Fi and explore 29pin header touch inputs and the detection threshold.

BLE / Wi-Fi Advanced Uses discontinued leaves
MCU
ESP32
Kit
ESP32 Wi-Fi Kit / Kit 2

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.

BLE / Wi-Fi Advanced
MCU
STM32
Kit
Basic Kit 2

Speaker

Use the piezoelectric loudspeaker in the SP&PIR Leaf to make the melody sound.

Displays, sound, and LEDs Beginner Uses discontinued leaves
MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

Log and Visualize ESP32 Sensor Data in Google Sheets

Send readings from ESP32 Wi-Fi Kit 2 with 4-Sensors or DHT22 to Google Sheets. Set up Apps Script, Arduino or PlatformIO, and plot your data in Grafana.

BLE / Wi-Fi Advanced
MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + sensor (4-Sensors / DHT22)

Google Sheetsを使ったIoTサービス

Leafony blockは、センシングデータをBeacon ^1 の電波で飛ばします。beaconの電波をRaspberry Piが受け、インターネット経由でGoogle スプレッドシートに書かせて、データの可視化ができます。

BLE / Wi-Fi Advanced Japanese article

Requires a Raspberry Pi

MCU
STM32
Kit
Basic Kit 2

LCD

The display has 8 characters per line and 2 lines . Hello, World! has 13 characters and does not fit on one line. This sample uses Hello! , which fits

Displays, sound, and LEDs Beginner Uses discontinued leaves
MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

4-sensors LCD

(/examples/advanced/avr-mcu/exten/4-sensors_lcd/lcd_overview2.png)

Displays, sound, and LEDs Advanced
MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

ESP32 BLE Beacon

This is an example of a BLE Beacon type environmental sensor application using ESP32. By adding sensor data to the Attribute of the GATT Server, it ca

BLE / Wi-Fi Advanced Uses discontinued leaves

Requires a Raspberry Pi

MCU
ESP32
Kit
ESP32 Wi-Fi Kit 2 + Basic Kit 2

STM32 LoRa message communication

Build an AP03 STM32 MCU and AC07 LoRa Mary transmitter and receiver. Use Arduino IDE or PlatformIO to send hello messages and check reception.

LoRa / cellular communication Advanced Uses discontinued leaves

Requires both a transmitter and a receiver

MCU
STM32
Kit
Basic Kit 2 + LoRa leaf
Tools
Arduino IDE / PlatformIO

PIR melody test

Using the infrared sensor IC for short range detection (AKM AK9754AE) installed in the SP&PIR leaf, let's create a system that plays a melody when a p

Displays, sound, and LEDs Advanced Uses discontinued leaves
MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

STM32 LoRa クイックスタート

(/examples/advanced/stm32-mcu/stm32/stm32_lora_tx_sensors/ap07_fig2.jpg)

LoRa / cellular communication Advanced Uses discontinued leaves Japanese article

Requires a transmitter and receiver; add an LCD to display RSSI

MCU
STM32
Kit
Basic Kit 2 + LoRa leaf

Watering plants with a motor

This sample app is a combination of the one introduced in the Basic Kit Web Bluetooth IoT and Motorleaf. Using Bluetooth, you can control the electric

Displays, sound, and LEDs Advanced

Requires an electric pump

MCU
AVR
Kit
Basic Kit / Kit 2 + Motor leaf

STM32 LoRa 署名付き通信

このチュートリアルではAC07 LoRa Maryリーフに搭載されるATECC608Aを使用して、LoRaの通信に署名をつける方法を紹介します。 通信に署名をつけることで、データの送り元が、受信者が意図したデバイスであるかどうかを判定することができ、通信の安全性が向上します。

LoRa / cellular communication Advanced Japanese article

Requires both a transmitter and a receiver

MCU
STM32
Kit
Basic Kit 2 + LoRa leaf

Web Bluetooth IoT

This sample is the same as the one introduced in Basic Kit Getting Started Guide. Let's read the source code to understand how it works.

BLE / Wi-Fi Advanced
MCU
AVR
Kit
Basic Kit / Basic Kit 2

STM32 セルラー通信クイックスタート

^1 : このサンプルのセルラー通信は、携帯電話のLTE網を使うIoT向けのCat-M1方式です。

LoRa / cellular communication Advanced Japanese article

Requires an IoT SIM, power leaf, and other parts listed in the article

MCU
STM32
Kit
Basic Kit 2 + cellular leaf

Save temperature and humidity to Google Sheets with AC09 Cat-M1 TY

Send temperature and humidity measured by 4-Sensors to Google Sheets every 10 minutes using AC09 Cat-M1 TY.

LoRa / cellular communication Advanced

Requires Spacer, USB-C, and AV06 leaves, plus a 1NCE or SORACOM SIM

MCU
STM32
Kit
AC09 Cat-M1 TY + 4-Sensors + STM32 MCU

STM32 LoRa 受信機

AC07 LoRa Mary でデータを受信する最もシンプルなサンプルプロジェクトです。 LoRa送信機やLoRa送信機 + 4-Sensorsのデータを受信することができます。

LoRa / cellular communication Advanced Japanese article
MCU
STM32
Kit
STM32 MCU + LoRa leaf + USB leaf

Google Sheets IoT

We will create an IoT environment sensor using Leafony Beacon1) and Raspberry Pi, and visualize the sensor data using Google Spreadsheet.

BLE / Wi-Fi Advanced

Requires a Raspberry Pi

MCU
AVR
Kit
Basic Kit / Basic Kit 2

STM32で人物検出する推論ネットワークの実装

- Emmbedded Software Packages Manager というウィンドウが開かれます。 - STMicroelectronics というタブを選択します。 - X-CUBE-AI をクリックすると様々なバージョンの Artificial Intelligence が表示されますの

Camera and AI Advanced Uses discontinued leaves Japanese article

Requires a camera, display, and other parts listed in the article

MCU
STM32
Kit
Custom configuration (see article)

LoRa

Using LoRa Easy leaf, sensor data (temperature, humidity, illumination, tilt) can be sent to a distant location and output to a PC terminal.

LoRa / cellular communication Advanced Uses discontinued leaves

Requires both a transmitter and a receiver

MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit + LoRa leaf

Camera

An example of using Seeed Studio's Grove series sensors. Let's try to save an image taken by the camera once a minute to a microSD card.

Camera and AI Advanced Uses discontinued leaves

Requires a camera, RTC & microSD leaf, and microSD card

MCU
AVR
Kit
Basic Kit / Kit 2 + Extension Kit

“Published” describes the article status, not the availability of its products.

Search documentation, sample apps, and Q&A