Hi, According to plan, I did some basic work to learn more about the Nucleo board and the STM32 Platforms and some basic tests with the sensor. Here we go.
Hardware
I bought bunch of parts listed in previous blog. From those the followings were come really handy.
This is how my setup looks like now.
{gallery:width=960,height=750,autoplay=false} My Hardware Setup |
---|
My Prototyping Setup |
Close-up of the SMD Adapter board |
My good old USB oscilloscope that I bought back in Iran about 7 years ago. |
Some Basic Sensor Tests
First I used the Nucleo board only as a 3.3V power supply, just to power up the sensor. I used the oscilloscope to do some measurements.
Measuring Sound
I could generate constant-frequency sound using a Tone Generator website and plot the FFT of the signal using the oscilloscope while I was pushing the sensor on top of desktop PC's speaker by hand.The oscilloscope's software can only run on a Windows machine so I plugged the oscilloscope to an old Windows 7 laptop and used NoMachine remote desktop software to take a picture of the screen. So in the below images, the bottom half of the image is showing the Oscilloscope software via NoMachine and the top section shows the Tone Generator website.
{gallery:width=960,height=750,autoplay=false} Sound and the Sensor |
---|
1.143kHz |
78 Hz |
187 Hz |
Measuring Heart Beat
Just for fun I tried to measure my heart beat with the sensor. I could not get a good measurement while holding the senor on my wrist. But holding it on my neck could make a good signal. Hear is my heart beat, raw and FFT.So it measures something around 1.090 Hz which is 1.09 * 60 = 65.4 beats per minute. I do not know how accurate it is.
{gallery:width=960,height=600,autoplay=false} My Heart Beat |
---|
Heart Beat Raw Signal |
Nucleo Board
Ok. Let's do some measurement on the Nucleo board. I used the STM32CubeIDE for programming the Nucleo board. There is bunch of examples for ADC on NUCLEO-H743ZI which also ran on the NUCLEO-H743ZI2. I used mostly the example called ADC_DMA_Transfer as reference. It basically uses DMA and ADC to writes the conversion results in an array in circular manner.It reads the analoge signal from pin PA6 with 16-bit resolution. The current state of the code can be found here on github on this specific commit. I have not used git for eclipse-based projects before so I do not know yet how much transferable the repo is to a new location or machine.
Here is a visualization of measurement in real-time using the STM32CubeMonitor. It shows the ADC readings in a 16-bit value from tapping directly on sensor and tapping beside of it on the table.
This should plot only one measurement in 4096. It is interesting to see that there is a time gap after each tapping till the measurement comes back to zero (or Vcc/2). This was not visible to me when I was using oscilloscope.
Next Steps
- I would like to use the CMSIS library to calculate the FFT on the nucleo board itself and also grab a better understanding of FFT.
- Send the raw data or the FFT to PC for Analysis
- The rest should be the same as the plan in the first blog.
Related Links
Previous Blog:
- Vibration Sensor and Exercising - Introduction - Blog #1
- My Progress: Experimenting with Vibration Sensors
Other Resources: