0

In my project I want to retrieve the Latitude and longitude and then transmit to a cell phone through GSM module. But the GSM as well as GPS modules uses the same pins i.e. Tx and Rx, so is it possible to use both modules at the same time?

Link to products

GSM - http://www.ebay.co.uk/itm/SIM800L-GPRS-GSM-Module-SIM-Board-Quadband-PCB-Antenna-for-MCU-Arduino-/191611848583?hash=item2c9cf4c787

GPS-- http://www.ebay.co.uk/itm/New-1PC-Ublox-NEO6MV2-GPS-Module-Aircraft-Flight-Controller-For-Arduino-/400830328802?hash=item5d53596fe2

Thank you.

2 Answers 2

2

Yes. Use SoftwareSerial for one of them. That way you can use any pins you like for that module.

I'd recommend using the GPS module on the SoftwareSerial since it's (mainly) half duplex, and SoftwareSerial can't both transmit and receive at the same time like the hardware UART can.

Either that or switch to a different Arduino board that has more than one hardware UART.

2
  • Well, thanks for the answer, and please will you suggest any arduno board other than MEGA which has more hardware UART. Commented Oct 7, 2015 at 12:42
  • 1
    This table is useful: arduino.cc/en/Products/Compare Also you might want to consider other boards than Arduino - there are other makes using other kinds of chips that do so much more using the same (or similar) footprints.
    – Majenko
    Commented Oct 7, 2015 at 12:44
0

If you are using two software serial then you can always use the listen() function to listen to specific object.

Suppose you have two software serial objects named GSM and GPS.
Now if you are reading or writing data to GSM then start with this, gsm.listen();
Now you can read/write data to GSM.
Next if you plan to read or write data to GPS then do this, gps.listen();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.