I've got several sensors connected to a single Arduino and it's sending those values to a Wemos that publishes the data to an MQTT server.
Right not I have the code sending data like:
pH:7.20
(wait 1 second)
ec:1500
(wait 1 second)
tempC:15.8
(wait 1 second)
current:0.212
(loops back)
So basically it reads a sensor, sends the data via serial, waits 1 second, and moves on to the next sensor, etc.
Another option would be to send:
ph:7.20,ec:1500,tempC:15.8,current:0.212
(wait 1 second and loop again)
Basically read all the sensors without a delay between them and send off the values as one big batch across the serial.
Are there any recommendations on which is better to use, perhaps from a fault-tolerance perspective in the case that one of the sensors dies or something? Or maybe from the perspective of programming complexity when you have to parse a bigger object as in the case of the latter?