Physical switching between UARTs

This is a problem i was working out in my head (inspired my a earlier problem). There is no code or device written fr it (yet). I am just trying to figure out the best way to do it.

Project requirements:

8 "satellite" Uno boards.
1 "master" Uno board.
All 9 boards communicate via Serial (not I2C, SPI, etc). The "satellite" boards send their sensor data to the "master"
one at a time: Round Robin.

I am trying to see how I can "hook" one of the 8 "satellite" board's UART to the "master's" UART one at a time, this way the master board can get a copy of any board's data, then move on t the next board and so on. I could of course make a mechanical disk that can rotate slowly with brushed contacts and all as a rotary switch might do.

But I rather do this electronically: solid state technique to open a exclusive channel for each satellite board one at a time to talk to the master.

I tried with transistors but did not work out.

Any help is apreciated.

Thank you!

Search for 4051 single 8 channel multiplexer.

Perry:

Thank you! I started to read abut this chip but something is not clear to me: will it open channels that can have data flow through or will it just run as a digital pin expander? The examples I looked at were not clear.

Thank you again!

It's analogue, it opens both ways for a single channel at a time. I have used the 4 channel version to do exactly what you are trying to do. Working perfectly.

I was thinking…

  • Is an UNO’s TX pin able to drive eight RX pins, connected together?
  • Could one use an 8-bit NOR gate to transfer 8 TX pins to one RX pin?

Is an UNO's TX pin able to drive eight RX pins, connected together?

I don't see why not, but if you do that then the data you transmit will get sent to all 8 receivers, which means that you will have to devise some means of addressing them so they know when the data is for them.

Could one use an 8-bit NOR gate to transfer 8 TX pins to one RX pin?

NOR will invert the data, so no. Also, idle state is high, so all the idle TX pins will make the NOR gate output low. You need AND to do it that way.

I get it. So, 2 pcs. of 4051 (RX and TX) is easier qua software, but it will take 3 pins of the Arduino as "address lines"!

Well you could probably make it work either way. For the AND gate 8 diodes and a resistor maybe. I can't remember if there's a CMOS or TTL 8 input AND gate, I guess there must be.

You’ve been around here for a while, so it should not surprise you for me to ask why you want to use the inconvenient “UNO” format rather than the Nano, and while we are at it, why you want to use “satellite” processors at all. These things should really be a prior discussion.

Now there are a few more tricks to this business of many-to-one serial. You can certainly select to which serial input stream you wish to listen - or you can use the AND gate to allow any - but only one - to be heard at any time. People say “4051” but of course, the original CD4051 series is pretty much obsolescent, you would actually use a 74HC4051 to match the logic used in the Arduino. The third option, whose suitability is only evident when we understand your real intentions - is to “daisy chain” all the Arduinos together by their serial connections.

In the other direction, using an analog multiplexer to send serial data out only to one of eight directions results in those not selected, floating and seeing ransom input. If you do that, you need a pull-up on each line to fix its default state. Again, a “daisy chain” or sending data to all in parallel and having them respond by address only, may be more practical.