Skip to main content
ECiot.1
Associate II
May 5, 2023
Question

Simultaneous reading of sensors

  • May 5, 2023
  • 2 replies
  • 1414 views

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?

This topic has been closed for replies.

2 replies

Peter BENSCH
Technical Moderator
May 5, 2023

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?

Regards

/Peter

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.
Tesla DeLorean
Guru
May 5, 2023

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 VenmoUp vote any posts that you find helpful, it shows what's working..