Serial Communication between Two Arduino Boards

Hello All

I want to communicate with 2 Arduino serially. I want one Arduino( Sender) to read analog input and send it to another Arduino(Receiver) to read that analog voltage. This analog voltage is shown in the Arduino(Receiver) serial monitor.

Your post was MOVED to its current location as it is more suitable.

What have you tried so far ?
Where are you stuck ?
Which Arduino boards will you be using ?

Yes i tried.
I just write the code but failed.
I am using Arduino UNO board.

You have been here long enough to know that if you do not post your code then we cannot help you fix it

In what way did it fail ?

@amitshishodia
1. Check that your hardware setup between two UNOs are similar to the diagram of Fig-1.

uartUnoUno-1
Figure-1:

2. Acquire voltage from the wiper-point of Pot and show it on SM1 (Serial Monitor-1) and then send it to UNO over the SUART (Software UART) Port. To this job, you need to upload a sketch into UNO-1 (the Sender). Can you post what codes you have written/tried?

3. You also need a sketch to upload into UNO-2 to acquire the signal sent by UNO-1, retrieve the original voltage and show it on SM2. Can you post the codes that you have written/tried?

Note that a Uno has only one hardware serial port, so it is normal to use a SoftwareSerial port to communicate between boards so that hardware Serial can be used to upload sketches and for debugging

Sir please check my sode


void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
}

void loop() {
  int AnalogInput1 = analogRead(A0); // 24v battery Input AI
  int AnalogInput2 = analogRead(A1); // 24v battery Input AI
  int AnalogInput3 = analogRead(A2); // Fuse Voltage Input AI
  int AnalogInput4 = analogRead(A3); // Fuse Voltage Input AI
  
Serial.write(AnalogInput1); //Write the serial data
Serial.write(AnalogInput2);
Serial.write(AnalogInput3);
Serial.write(AnalogInput4);
delay(1000);
}
type or paste code here

Are you using any voltage divider circuit or IC to measure the voltage?
Arduino's analog inputs are 5V tolerant. Above this voltage will destroy them.

assuming it's all wired right ...

how many bytes do you have in AnalogInput1 (an int)?
how many bytes will Serial.write()

I would suggest to study Serial Input Basics to handle this

Sir i have converted 24v to 5v

Can you explain what you are measuring with the analog inputs?

Please send me your code or guide me on what can I do with my code.

I am measuring analog voltage

I am trying but i am not get any data.

did you study the content of the link? seems it was not even clicked...

I already open this link.

you did not answer the 2 questions in #10

char AnalogInput1[10];
char AnalogInput2[10];
char AnalogInput3[10];
char AnalogInput4[10];

void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
}

void loop() {
  Serial.readBytes(AnalogInput1,10); //Read the serial data and store in var
  Serial.readBytes(AnalogInput2,10);
  Serial.readBytes(AnalogInput3,10);
  Serial.readBytes(AnalogInput4,10); 
  
  Serial.print(AnalogInput1); //Print data on Serial Monitor
  Serial.print(", ");
  Serial.print(AnalogInput2);
  Serial.print(", ");
  Serial.print(AnalogInput3);
  Serial.print(", ");
  Serial.println(AnalogInput4);
  delay(1000);
}

what's that code supposed to do?

Please do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags which I added for this time).