Connect with us

SIM908c GSM module with Arduino Mega without any shield

Discussion in 'Microcontrollers, Programming and IoT' started by Nafis, Dec 3, 2014.

Scroll to continue with content
  1. Nafis

    Nafis

    7
    0
    Dec 3, 2014
    Hello,

    I needed to work with GSM so I bought a SIM908c module. Also I bought a breakout board to connect with Arduino Mega. I am using the gsmlib library for this module.

    My connections are as follows:

    3.5V 1A power input + 100uF bypass capacitor => VBAT

    3.5V 1A power input + 4.7uF bypass capacitor => VRTC

    Power Adapter ground => GND

    Arduino Mega pin 53 => PWRKEY

    Arduino serial TX1 pin 18 => TXD

    Arduino serial RX1 pin 19 => RXD

    Power Adapter ground => DTR

    Now I am using the library example of AT command named GSM_GPRSLibrary_AT. After uploading the sketch and observing the serial monitor the following responses show up:

    GSM Shield testing.
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:ELSE
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:ELSE
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:ELSE
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:AUTO BAUD RATE
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    DB:NO BR
    Trying to force the baud-rate to 9600

    1200
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    2400
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    4800
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    9600
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    19200
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    38400
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    57600
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    115200
    ATT: OK
    RIC: AT+IPR=9600
    AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ATT: OK
    RIC: AT

    ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

    status=IDLE

    This kind of responses appears even if I don't give any power to VBAT and VRTC. I am definitely did something wrong but I can't figure it out. Please kindly help.
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,501
    2,841
    Jan 21, 2010
    Try connecting the arduino's txd to the device's rxd and vice versa.
     
  3. Nafis

    Nafis

    7
    0
    Dec 3, 2014
    Thanks for your reply. I understand what you meant and I tried it before, it doesn't give any response. I read from somewhere (Probably datasheet) that for this module TXD is meant to connect with device's TX.
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    11,974
    2,803
    Nov 17, 2011
    The datasheet of the GSM module states on page 15:
    TxD = O = output, therefore connect to RxD of the µC
    RxD = I = input, therefore conenct to TxD of the µC
    Also note that DTR shall be kept low by a pull-down resistor.
    See also chapter "4.6 Serial Interface" on page 28 ff.
     
    Nafis likes this.
  5. Nafis

    Nafis

    7
    0
    Dec 3, 2014
    I did try TxD to Arduino's RxD and vice versa. Currently it gives the same result. Also I connected DTR directly to GND of power supply. Do you suggest to add a resistor in series? Also, should I connect it to Arduino's GND instead of GND of power supply? Thanks.

    NB: I am not using any GPS tx/rx or debug tx/rx. I kept them open. I only need GSM to work with.
     
    Last edited: Dec 3, 2014
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,501
    2,841
    Jan 21, 2010
    Are they not connected together? That may be your problem.
     
  7. Nafis

    Nafis

    7
    0
    Dec 3, 2014
    Really? well, Arduino is taking power from USB connected to PC. I tried powering the module from Arduino before but that didn't work either. I thought Arduino is not providing enough current to the module.
     
  8. Nafis

    Nafis

    7
    0
    Dec 3, 2014
    Ok, now I am taking input from Arduino without any external power supply. I am taking power from Arduino 5V pin. But using multimeter I measured at VBAT the voltage is 3.7V and at VRTC it's 4.2V. But still it's not working. Please also note that there could be any problem on the code and the Library may be?
     
  9. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,501
    2,841
    Jan 21, 2010
    OK, the first thing is that it requires 3.2 to 4.8V If you are powering this from the Arduino's power rail then it needs to be within this range. (as an addendum to this, VBatt can be as high as 5.5V, so USB is OK for this)

    USB is from 4.5 to 5.5 V so it's likely to be outside the ratings for this device. (given the addendum, it is unlikely you have damaged it merely from the supply voltage)

    If you're using an alternate supply for the module then you need to ensure they have common ground rails.

    I'm not sure that the inputs are 5V tolerant. It would be wise to operate the arduino from a lower supply voltage as well. (An update to this, the inputs are limited to 3.1V, so they are most definitely not 5V tolerant). This can cause damage especially if you have tied any input to the 5V rail.

    The amended information comes from page 44 (section 6.1 - absolute maximum ratings). The recommended values are 3.2 to 4.8V
     
  10. Nafis

    Nafis

    7
    0
    Dec 3, 2014
    I know, the recommended voltage range for the module is from 3.2V to 4.8V. I took 5V from Arduino to power the module and the arduino is taking power from laptop's USB. And I am sure the Arduino isn't ruined, it's fine. At the very beginning, I was powering the module from Arduino 3.3V, the response was same. Then I also used 5V, the response was same. Most probably the module isn't ruined yet as I am still having debug responses from the Library example code. Also if you see the 4.1 Power Supply section from the datasheet, it is advised to provide 2A current for the module. But from USB, the arduino can draw around 250-300mA current. So, I hope it didn't ruin the module even if I gave 5V from the Arduino. Moreover, the arduino 5V isn't exactly 5 volts, it gives 4.9 volts, and the absolute maximum for the module is 5.5V as you said.

    Now, as it is mentioned in 4.1 Power Supply section, I decided to use a 2A power supply. I stepped down the voltage using diodes in series to make sure the voltage stays in the 3.2 to 4.7 voltage range but current stays around 1.7 amps. So, either way, I am pretty sure the module is not burnt out, as it is also giving responses as before.

    But, now as I see section 6.7 VRTC characteristics, I figured I gave more than 3.1V, around 3.9 to 4.5V to VRTC, and current was probably around 1A with external power supply but with arduino it is 305mA. Do you think this isn't right? should I make the current 2uA and the voltage to 3.1V for VRTC?

    BTW, steve, I am very thankful that you are spending your valuable time and effort to my problem. I've been winding up with this for quite a long time now.
     
  11. Nafis

    Nafis

    7
    0
    Dec 3, 2014
    OK, now I gave 2.9V and 1.9uA to VRTC by dividing the voltage with two resistors. Still, the same thing shows up.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-