Is it possible to process multiple data at the same time with ESP32?

Ahmet58
Posts: 21
Joined: Sat Jan 22, 2022 8:38 pm

Is it possible to process multiple data at the same time with ESP32?

Postby Ahmet58 » Thu Dec 01, 2022 9:13 pm

Hi, can esp32 evaluate data from several sensors at the same time? I want to explain a little more; for example i have firebeetle esp32. Can it simultaneously process data from 10 lis3mdl magnetic field reader modules? can i export this data to a screen?

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby mbratch » Fri Dec 02, 2022 2:46 am

How frequently does each need to be sampled? How are you defining "at the same time"? You could process them in a loop with a task, or have them each sampled with their own software timer. A single processor doesn't truly do multiple things "at the same time", and a dual core processor can do up to two things "at the same time". :)

Ahmet58
Posts: 21
Joined: Sat Jan 22, 2022 8:38 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby Ahmet58 » Fri Dec 02, 2022 6:41 am

Thank you for the answer. There will be 5 magnetic reader inputs as a peripheral to the mcu. It is not my intention to confuse sensor data with each other. I just want to measure the voltage change at the digital output of each sensor separately and evaluate it in the code. these data naturally enter the mcu as instant data. While doing this, as an observer, I should be able to see these values ​​on the screen at the same time.

bidrohini
Posts: 202
Joined: Thu Oct 27, 2022 12:55 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby bidrohini » Fri Dec 02, 2022 3:07 pm

In general, it is possible to connect multiple sensors with ESP32 and read the data like this example: https://www.theengineeringprojects.com/ ... esp32.html
But I am not sure which magnetic reader you're using. Which communication protocol does it support? I2C? Or something else? The method of receiving data from all the sensors will depend on the communication protocol.

Ahmet58
Posts: 21
Joined: Sat Jan 22, 2022 8:38 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby Ahmet58 » Fri Dec 02, 2022 4:38 pm

The sensor I want to use is the lis3mdl magnetic sensor with polo. It provides i2c and spi protocol communication.

Ahmet58
Posts: 21
Joined: Sat Jan 22, 2022 8:38 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby Ahmet58 » Fri Dec 02, 2022 4:58 pm

Of course, the following is what comes to my mind as code design;
1- the average of the sensor output voltages.
2- Separate sensor output voltage values ​​for each sensor.
3- to use all these values ​​in formulas with the if operator according to the criteria I have determined.

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby mbratch » Fri Dec 02, 2022 10:33 pm

Ahmet58 wrote:
Fri Dec 02, 2022 6:41 am
... It is not my intention to confuse sensor data with each other. I just want to measure the voltage change at the digital output of each sensor separately and evaluate it in the code. these data naturally enter the mcu as instant data. While doing this, as an observer, I should be able to see these values ​​on the screen at the same time.
Your software can or should be able to distinguish the devices. You mentioned SPI and/or I2C. If you have multiple devices on one of these busses, they are distinguished by I2C address or some other chip select logic, unless you have them on separate busses. In either case, the code must know which one it is accessing. The software processing is fast enough that when you update the screen after reading each one, it appears instantaneous to a user.

Ahmet58
Posts: 21
Joined: Sat Jan 22, 2022 8:38 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby Ahmet58 » Sat Dec 03, 2022 8:00 am

Thanks for the replies. it was very enlightening.

Ahmet58
Posts: 21
Joined: Sat Jan 22, 2022 8:38 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby Ahmet58 » Sat Dec 03, 2022 10:22 am

Would you allow me to ask you one more question? I understand the explanations so far. I need to connect several of the same digital sensor type to the mcu. If the sensors are of the same type, will there be a problem with the i2c protocol being called by the mcu and routing its data?

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Is it possible to process multiple data at the same time with ESP32?

Postby mbratch » Sun Dec 04, 2022 1:06 am

Ahmet58 wrote:
Sat Dec 03, 2022 10:22 am
Would you allow me to ask you one more question? I understand the explanations so far. I need to connect several of the same digital sensor type to the mcu. If the sensors are of the same type, will there be a problem with the i2c protocol being called by the mcu and routing its data?
If you are using multiple i2c devices, ideally, each device has its own unique i2c address. Some devices support multiple i2c addresses by setting some pins to ground or Vcc. However, if you are using two or more devices which have identical i2c addresses, then you can either connect them to separate i2c busses (the ESP32 can support multiple busses), or you could use GPIOs and a little circuitry to disable or enable specific devices.

Who is online

Users browsing this forum: Corand and 65 guests