Multiple Serial Comm. on Arduino Uno

Hey there! I am working on a project which sends GPS locations through SMS on demand. As it turns out, I'll be needing GSM shield/module, GPS shield/module and, of course, an Arduino Uno board. My question is, can I use these two hardware(s) with Uno simultaneously using h/w and s/w serial? If yes, please suggest some ways and necessary functions. I am aware that the Mega would make the job a lot easier but i cannot because of the cost constraints.

Thanks in advance!

Shields may force you to use specific pins for communication and I know nothing about the shields you mention. If you want advice about specific devices you should post a link to the datasheets.

Having said that ... if you don't need HardwareSerial for communication with your PC you can use that and SoftwareSerial to have 2 serial connections on an Uno.

Two instances of SoftwareSerial will probably not be suitable as only one of them can work at any one time.

...R Serial Input Basics

Hi,

gargle arduino gps gsm gprs shield

http://www.dfrobot.com/index.php?route=product/product&product_id=673#.VgJnlMuqqko

Not sure if it has everything you need, you may have to ask them.

Tom.... :)

kushal_kqb: My question is, can I use these two hardware(s) with Uno simultaneously using h/w and s/w serial? If yes, please suggest some ways and necessary functions. I am aware that the Mega would make the job a lot easier but i cannot because of the cost constraints.

Arduino Leonardo boards are even cheaper than Arduino UNO boards and offer one extra Serial:

UNO: - Serial ==> for serial connection to USB/PC - extra serial can be emulated in software

Leonardo: - Serial ==> for serial connection to USB/PC - Serial1 ==> available in hardware - extra serial can be emulated in software

So with Leonardo you can have easily Serial for debugging via USB/PC, Serial1 for GPS and one serial port in software emulation for GSM.

Thanks everyone! So the answer is an undoubted yes.

Lets assume that the h/w serial is used by the GPS module and s/w serial by the GSM module. Now, I want the arduino to send lat and long readings via SMS to some number. So this means, it has to first communicate with the h/w serial and then switch to s/w serial to send the sms. How can this be done? .listen()? Please brief me and would be grateful to have some links to documentations.

Thanks in advance!

kushal_kqb: How can this be done?

Have you looked at any SoftwareSerial examples?

Assuming your SoftwareSerial instance is called mySerial all you need to do is mySerial.read() and Serial.read() for HardwareSerial.

...R

Oh yeah. Thanks a lot!