Multiple UART input



  • I have a unique challenge.. I want to read data from 3, HPMA115S0 dust sensors simultaneously. They output data serially at 9600 baud once a second. Don't need to transmit anything, just listen (RX). Is it possible to create 3 or more UART to read in data from these sensors on different pins? If not, can I create a UART to read one sensor, close it and rotate that same UART between different pins to get data from one sensor at a time? Or do I have to wire in a MUX to switch between devices to listen thru one UART?



  • @PycomDev-RedMountainMakers The ESP32 has three UARTs. The first one, UART0, is used for the Python REPL. The other two may be freely available. I say may, because on FiPy and GPy UART2 is used for the communication with the LTE modem. So there are not three UART devices available.
    You should be able to use uart.deinit() and the UART constructor to change the pins assignments. You should expect that on any change the receive buffer's content is lost. If your sensors are constantly sending, then this should not be an issue.


Log in to reply
 

Pycom on Twitter