I have five UART-based sensors from the same type which are continuously transmitting package at baud rate of 9600 kbps and every one second continuously (they have only TX and RX and power pins each).
I want to read the sensor reading for all of them by one UART of microcontroller (STM32).
After reading them, I want to display their values on a graphic application by Qt application (of course through virtual port com).
I thought of an analog dual channel multiplexer, but I think there would be a problem because they send data simultaneously and every second, so the data from one or more sensors will got lost.
Another solution I thought, was to use a microcontroller (STM32) with eight UARTs and reading the sensor data with interrupt, but I think it would be a collision and perhaps two sensors will interrupt two UARTs of STM32 at the same time.
The sensor has 2 modes:
- Default mode is transmitting data over UART every 1 second at BR 9600.
- The second mode is ask/answer mode (BR = 9600).
For ask/answer mode, the response time of the sensor is not determined, but it is less than 15 seconds (randomly). Therefore I will use the default mode.
Any suggestion how to solve this problem will be great.