Go Down

Topic: Connecting to a modem (Read 632 times) previous topic - next topic

ProfePaco

Hi there:

I have bought this GSM modem:

http://www.ebay.es/itm/270829600250?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

I have some doubts about connecting it to Arduino.

This modem has both 12V serial output and TTL output. So I will use TTL output to connect it to Arduino...

However, when Arduino is connected to the PC, for debugging, can the pins 0 and 1 be used? should i connect the modem to 0 and 1 pins? I have to use a specific library for serial connection?

when I write serial.println and the Arduino is not connected to the PC, the communication goes through 0 and 1 pins?

Thanks in advance.

PaulS

Quote
However, when Arduino is connected to the PC, for debugging, can the pins 0 and 1 be used?

No. They are the serial port pins.

Quote
should i connect the modem to 0 and 1 pins?

Not if you want it to work.

Quote
I have to use a specific library for serial connection?

Depends on the Arduino. If you have a Mega, use another set of hardware serial pins, and use the corresponding SerialN class. If you have any other Arduino, use NewSoftSerial (for 0023 or earlier) or SoftwareSerial (for 1.0+). Do not use SoftwareSerial with 0023 or earlier.

Quote
when I write serial.println and the Arduino is not connected to the PC, the communication goes through 0 and 1 pins?

Serial data is transmitted by those pins, regardless of whether the Arduino is actually connected to the PC or not.

ProfePaco

Thanks a lot for your patient to answer my questions.

However, I need just a bit of clarification.


are the sentences correct?


* pins 0 and 1 do not work when the Arduino is connected to the computer, because then the serial communication is working through the USB port.

*if no additional library is used, pins 0 and 1 don not work for serial communication (even when Arduino it NOT connected to computer though USB)

* As I am using 1.0 the library to employ is SoftwareSerial. Then I will be able to communicate to the modem.


Thanks in advance.

PaulS

Quote
are the sentences correct?


* pins 0 and 1 do not work when the Arduino is connected to the computer, because then the serial communication is working through the USB port.

No, this is not right. Pins 0 and 1 DO work - they perform a specific function, though, so that they are not available for other purposes.

Quote
*if no additional library is used, pins 0 and 1 don not work for serial communication

No, this is not right. The HardwareSerial class, instanced as Serial, is what makes pins 0 and 1 work for serial communication. That library is part of the Arduino core.

Quote
As I am using 1.0 the library to employ is SoftwareSerial.

Yes, this is correct.

Quote
Then I will be able to communicate to the modem.

Well, that's a big leap, but, in theory, you should be able to.

ProfePaco

This is quite strange.... I had no problems to use a bluetooth module connected to pins 0 and 1. No need of new library.

Why a modem is different?

PaulS

Quote
This is quite strange.... I had no problems to use a bluetooth module connected to pins 0 and 1. No need of new library.

While talking to the serial monitor? Without getting stuff confused on either side?

ProfePaco


Quote
This is quite strange.... I had no problems to use a bluetooth module connected to pins 0 and 1. No need of new library.

While talking to the serial monitor? Without getting stuff confused on either side?


Just the bluetooth module... using serial.println

PaulS

Quote
Just the bluetooth module... using serial.println

But, OP wants to talk to the bluetooth module and the PC independently. So, either different hardware (Mega with multiple hardware serial ports) or different software (for software serial ports) is needed.

Go Up