Skip to content

Sample embedded rust program, capable to read out and report heart sensor data connected to an ADC pin.

Notifications You must be signed in to change notification settings

andy31415/rust-stm32f3-discovery-adc-heart-sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is an example program that runs on a stm32f3 discovery board and reports ADC readings for pin PA2

Hardware details

Discovery board

STM32F3 Discovery board should be quite commonly available, including on AliExpress

Pulse sensor

The Pulse Sensor is one of the lowest cost models found on AliExpress, Generally searching as pulsesensor.

It looks like this:

Heart sensor image

You can find more details about how it works around the web, like at Last Minute Engineers.

Connections

  • GND of the sensor is connected to GND of the discovery board
  • Vcc of the sensor is connected to 3V of the discovery board
  • A0 (Sig) of the sensor is connected to the PA2 pin of the discovery board

Execution

You can just execute the binary and it will use RTT to display timestamp + pulse value

cargo run

You can feed it to plotting. A very basic version would be:

cargo run | feedgnuplot --stream --domain --lines

If you place your finger on the sensor (with some fiddling on pressure and how it is held), this results in an output that looks like:

Sensor readings line plot

About

Sample embedded rust program, capable to read out and report heart sensor data connected to an ADC pin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages