Honusz (github.com/honusz)
A minimal example for the Daisy Seed that reads the STM32H7's internal die temperature sensor and prints the result over USB serial.
On startup the example initializes ADC3 and calibrates it for single-ended conversions. In the main loop it samples the internal VREFINT and temperature sensor channels, computes the reference voltage (VDDA) and die temperature, and logs the values once per second while blinking the onboard LED as a heartbeat. If ADC initialization fails, the LED blinks rapidly to indicate an error.
Example output:
Daisy Seed internal temperature sensor demo
Temp: 34.82 C | vdda: 3300 mV | vref_raw: 1489
DaisyTemp.cpp— Program entry point: initializes hardware, logging, and the temperature sensor, then loops reading and printing values.int_temp_sensor.h— Self-contained helper for the internal temperature sensor:TempData— struct holdingvdda_mv,vref_raw,temp_raw, and the calculatedtemp_c.InitInternalTempSensor()— configures and calibrates ADC3.ReadInternalTemperature(TempData&)— reads VREFINT and the temperature sensor channel, then calculates VDDA and die temperature.
#include "int_temp_sensor.h"
TempData temp_data = {0};
if(!InitInternalTempSensor())
{
// ADC init failed
}
if(ReadInternalTemperature(temp_data))
{
// temp_data.temp_c contains the temperature in Celsius
}This project uses the standard libDaisy / DaisySP build setup. With the toolchain installed, build and flash with:
make
make program-dfuReported values are approximate. The STM32H7's internal temperature sensor is intended for rough die-temperature estimation, not precision measurement — accuracy depends on factory calibration data and VDDA stability.