one sensor with multiple protocol

Thread Starter

Embededd

Joined Jun 4, 2025
195
I have a bit of a weird question, and I’d really like to hear how someone with practical experience would approach it.

Suppose you have a temperature sensor that can provide temperature data through four interfaces: UART, SPI, I2C, and CAN. You need to connect it to an MCU and simply read the room temperature. Since all four interfaces can give you the same temperature value, which one would you actually choose, and more importantly, what would be your reason for rejecting the others?

Personally, I would probably remove CAN first, but my reason is not very strong. I mainly associate CAN with automotive and distributed/robust communication, so it feels unnecessary for a simple temperature sensor connected directly to an MCU. But I’m not sure if that is a good technical reason.

Then between SPI, UART, and I2C, I would probably remove SPI because it generally needs more signal lines than I2C, especially when multiple devices are involved. That leaves UART and I2C.

If saving pins is the main concern, I might choose UART because it only needs TX and RX, whereas I2C needs SDA and SCL. But I also know this is probably oversimplifying the decision

how would you make this decision. Which interface would you choose in this particular situation, and what would be your reason for rejecting the other three?
 

RH3

Joined Nov 14, 2016
3
My first consideration would be what type of sensor and its location in relation to the MCU.

Then does it need two-way communication/handshaking?

In the case of a remote wired sensor does it autonomously send data or does it need to be polled?

Is there more than one sensor sitting on the same wired path?

Is a wired sensor’s environment noisy?

So, the choice of the most appropriate protocol may be dictated by the type of sensor, data transmission path and electrical environment. There will be one protocol that stands out as the most suitable.
 

panic mode

Joined Oct 10, 2011
5,152
what environment? what temperature range? what accuracy?
for simple DIY automation and easy connectivity i would use ESP01 (Really small and has WiFi), and connect to it one or several DS18B20.
 
Top