Arduino 1 communicates with Arduino 2 and send data back to Computer

Dear All,
I am looking for ways to identify data sent from different Arduinos. Let says I connect 3 Arduinos and Arduino 2 is the one to send it back to PC.

  1. Arduino 1 ----> send data to ----> Arduino 2 and then Arduino 2 ----> send the data to PC
  2. Arduino 3 ----> send data to ----> Arduino 2 and then Arduino 2 ----> send the data to PC
  3. Arduino 5 ----> send data to ----> Arduino 2 and then Arduino 2 ----> send the data to PC

PC serial Logger will show the data received as follows:
Arduino 1 Data Data
Arduino 3 Data Data
Arduino 5 Data Data

I have attached the Block Diagram of my idea in this topic. I would like to know how do I setups the Arduinos so that the data has their own ID?

Thanks.

Each Arduino sending data needs to append a byte to the end of the data that contains the Id.

The diagram you have drawn is a bus system and therefore will require coordinated pinMode changes so that device 1, 3 and 5 don't fight each other for control of the Tx line going into device 2.
Sending data via I2C may be a simpler option.

mikb55:
Each Arduino sending data needs to append a byte to the end of the data that contains the Id.

The diagram you have drawn is a bus system and therefore will require coordinated pinMode changes so that device 1, 3 and 5 don't fight each other for control of the Tx line going into device 2.
Sending data via I2C may be a simpler option.

Dear Mikb55,
Thanks for the reply. The device we have does not have I2C, that leads us to think of the method in the block diagram.

Do you have any tutorial link/websites that can do this coordinated pinMode changes for Rx/Tx?

Thanks.

sdas86:
Dear Mikb55,
Thanks for the reply. The device we have does not have I2C, that leads us to think of the method in the block diagram.

Are all the devices Arduinos?
On the Uno pins A4 and A5 are used for the I2C bus.
Are you already using these pins for some other purpose?

mikb55:
Are all the devices Arduinos?
On the Uno pins A4 and A5 are used for the I2C bus.
Are you already using these pins for some other purpose?

Dear Mikb55,
The Device 1, Device 3 and Device 5 are not Arduino. They are mostly Sensors such as temperature sensors, door sensors, light sensors, sos button and so on.

Do you have any idea how to use only 1 Rx/Tx and use on multiple Devices? I found some info about Multiplexer but I am also not sure how to use them.

Thanks.

First you said you were connecting 4 Arduinos, now you say you are connecting 3 sensors to one Arduino.
People can only give advice if you provide accurate information.

Just follow the tutorials for each type of sensor using whatever pins they tell you to use.

If you run out of pins then use an Arduino Mega or use multiple Uno/Nano boards.

mikb55:
First you said you were connecting 4 Arduinos, now you say you are connecting 3 sensors to one Arduino.
People can only give advice if you provide accurate information.

Just follow the tutorials for each type of sensor using whatever pins they tell you to use.

If you run out of pins then use an Arduino Mega or use multiple Uno/Nano boards.

Dear mikb55,
Sorry for confusing you. I am trying to make the idea simpler.
Arduino 2 communicate with device 1, device 3 and device 5 and send the data one-by-one to PC.

Any idea on how to do this? Thanks.