How many no of rx tx pins available on uno r3

I want to connect bluetooth and gps but on uno r3 it seems only 2 pins available for rx tx, How can I connect both gps and bluetooth in arduino uno?

In Arduino mega we can create virtual rx tx for other pins so can same thing we can do for arduino uno r3?

Please help thanks. :)

The UNO only has one hardware UART using pins 0 for receive and 1 for transmission.

Any other serial ports must be done using software serial: http://arduino.cc/en/Reference/SoftwareSerial

Note, there are pin restrictions based on the processor model, and you can only receive from data from one port at a time.

You generally get better performance from hardware serial ports than from using software serial. Here are various machines serial ports:

  • UNO uses pins 0/1 and you use the normal Serial class to address things on the Serial port as well as the USB serial monitor.
  • Mega, DigiX and Due have 4 serial ports. The ports on 0/1 must use Serial0 instead of Serial (Serial is USB only). Ports 18/19 are Serial1, 16/17 are Serial2, and 14/15 are Serial3.
  • Teensy 3.0 has 3 serial ports. The ports on 0/1 must use Serial1 instead of Serial (Serial is USB only). Ports 9/10 are Serial2, and Ports 7/8 are Serial3.
  • ATtiny85 devices like digispark, trinket, gemma have no hardware serial ports.

Presumably you might need to be careful if you use ports 0/1 when you have the chip connected to the computer.

Given you have two devices you want to get input from (bluetooth, gps), it might be better to continue using the Mega (or switch to Due, DigiX, or Teensy 3.0). Alternatively, if you haven't bought the GPS yet, I believe you can get GPS devices that use i2c or spi, and you wouldn't need a serial device.

I only have uno r3, so should I purchase due? what say it has 3 rx tx pins ? or try with virtual serial?

what say it has 3 rx tx pins

Nothing it has four. Try the data sheet page:-

http://arduino.cc/en/Main/arduinoBoardDue

Serial: 0 (RX) and 1 (TX) Serial 1: 19 (RX) and 18 (TX) Serial 2: 17 (RX) and 16 (TX) Serial 3: 15 (RX) and 14 (TX)

vmuthal:
I only have uno r3, so should I purchase due? what say it has 3 rx tx pins ?
or try with virtual serial?

I’ve seen various complaints that not all of the Due libraries are complete, since the Due is a completely different processor (Arm instead of AVR), and a lot of Arduino code assumes it is working on the AVR.

While the Teensy 3.0 also uses an Arm processor, the Teensy 3.0 creator is real active in getting things fixed. Note, I have a Teensy 3.0, so I follow that, but I don’t follow the Due as much, so things could be much better by now. Note, with the Teensy 3.0, you will need to add an overlay to the IDE to get the Teeny 3.0 support. And you should post teensy specific questions over at the Teensy forum, instead of here. http://www.pjrc.com/teensy/index.html

Note, both the Due and the Teensy 3.0 use 3.3v power supplies instead of 5v. So you need to make sure that the voltages are safe for your devices.

That being said, if you want the least amount of hassle and change to your current setup, you should get a Mega.

On your Uno, you could potentially run your bluetooth on ports 0/1 (unplugging the bluetooth when you are uploading your sketches just to be safe) using the hardware serial port, and then use the software serial for the GPS. I’ve used software serial on my Uno to connect to a Seeedstudios bluetooth shield that used pins 6/7 (with a jumper to use pins 0/1). From the documentation, the main problem occurs when you want to use two software serial devices. Given the software nature, it may break down if you try to pump really large volumes of data through the serial port, but I don’t think either a bluetooth serial modem or a gps would send so much data, you might lose it.

Ok about teensy 3.0 I dont know more. So I have option of Mega, I'll go with Mega. Mega 2560 also works same as uno?

Thanks

Mega 2560 also works same as uno

Yes they are the same class of processor and both 5v.

Thank you guys. Purchased Mega 2560. :)