Skip to content

honusz/DaisyTemp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DaisyTemp

Author

Honusz (github.com/honusz)

Description

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

Files

  • 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 holding vdda_mv, vref_raw, temp_raw, and the calculated temp_c.
    • InitInternalTempSensor() — configures and calibrates ADC3.
    • ReadInternalTemperature(TempData&) — reads VREFINT and the temperature sensor channel, then calculates VDDA and die temperature.

Usage

#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
}

Building

This project uses the standard libDaisy / DaisySP build setup. With the toolchain installed, build and flash with:

make
make program-dfu

Notes

Reported 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.

About

Daisy Seed Internal Temperature Sensor

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors