Software Serial vs. USB

Recently I’ve been working on a networked “clock” thingy. The network consists of a master, which is sending current time to the slaves, the slaves are 10digit 7segment displays which are showing the time. I use software serial over a RS485 network in order to send commands from the master to the slaves. The chip is an LTC485 which is working properly with the termination resistors, and also I am sharing the grounds between the arduinos by adding a third wire to A and B.

Right now the slave is powered by a 12V external power supply. And I am using the master over USB(that’s why the ground sharing was necessary).

But I’ve found a bug, which I think is the problem of the Arduino. The slave is getting junk messages when I am not touching the onboard USB connector’s shielding, which I guess is some kind of grounding problem. If you have any idea why the data is getting messed up feel free to share it.

My only idea is to connect the connector’s shielding to the external power supply’s ground.

I’ve attached the slave’s code.

serial_multiplex_multi.ino (3.4 KB)

A diagram of your wiring would be better

I can think of no good reason why you shouldn't ground the common lines to earth ground. But where and how could be an issue. Best practice is to have separate ground wires from each slave and the ground wire from the master all terminate in a single point earth ground.