using of arduino uno with three serial communication device

Sir
i m trying to make line follower with start and stop control by bluetooth and simultaneously automatic accident module with messaging and GPS device. but the problem is only one at a time is working, both of them are not working simultaneously with same arduino board.

It is going to be difficult to get 3 serial comms working on an Uno. A Mega, with 4 HardwareSerial ports would be much more sensible.

On the Uno I am assuming you are using HardwareSerial for one connection and SoftwareSerial for a 2nd connection. You could try my Yet Another Software Serial for the third but I don't know if that would work - I have not tried it like that.

I presume you are using SoftwareSerial at 9600 baud - it does not work well at high baud rates.

Any form of SoftwareSerial is hard work for a 16MHz Arduino and trying to run two of them may interfere with its ability to do other stuff.

...R

I tried with mega but the problem is gps module is not working on it

I tried with mega but the problem is gps module is not working on it

That seems very strange. Are you sure that you used the correct pins with the corresponding Serial interface and that you had Tx/Rx properly crossed between the Arduino and the GPS unit.

Yah i used the pin no 18 and 19 but its not working. i wrote the programme

#include <SoftwareSerial.h>
SoftwareSerial gps(19, 18);
void setup() {

Serial.begin(9600);
while(!Serial);
gps.begin(9600);
delay(1000);

Serial.println("Setup Complete!");
}

void loop() {

if(gps.available()){
Serial.write(gps.read());
}

if(Serial.available()){
gps.write(Serial.read());
}
}

That should work, first glance (how does it not work? "doesn't work" could mean it doesn't compile, or it compiles, but it doesn't get anything from the GPS, etc) - but why on earth would you use software serial for the GPS on a mega?

The whole point of using the mega is so you DON'T need to use software serial, and can instead use hardware serials (the Mega has Serial (the one connected to USB, for serial monitor), Serial1, Serial2 and Serial3. See pinout diagrams for which pins those other ports are on. Use those instead of making a software serial.

Thanx body for the suggestion it worked. now its working.