Showing results for 
Search instead for 
Did you mean: 

Simultaneous reading of sensors

Associate II

Hi,is it possible to acquire data from multiple sensors at the same time? Let me explain better, I have to acquire HR data from a PPG MAX30102 and the time between querying and receiving the data is about 2.5 ms, after which I should interrogate two other sensors and in total I would like to acquire at 240 Hz but I fear that reading sensors in sequence this is not possible. Is there a way to read data from sensors simultaneously and not one after the other? I am using an stm32 Nucleo-64 with Arduino IDE. Moreover there is a way to set the output frequency of a port to 240 Hz like in stmCUBE?

ST Employee

For simultaneous polling of the sensors, each sensor must be connected to its own communication interface. In addition, it can make sense to transfer the data via DMA, because this can maximise the parallelisation of the read-in.

Why don't you just use the much more flexible STM32CubeIDE for configuration and debugging?



In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Unfortunately Arduino tends to reinforce the single linear execution mindset.

You can do more than one thing concurrently on different buses/sensors, especially if their response is delayed.

You need to start thinking in a threaded or interrupt model, where more than one thing can be happening at once, and you sequence through states, as they occur on the time-line, rather than sitting in a delay loop blocking.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..