There are lots of websites that talk about using a GSM shield with an Arduino, in addition to the Arduino IDE itself. There are also several GSM libraries out there, or you can use AT commands to roll your own. I couldn't find any that talk about using the mini development module so I thought it may be useful to publish this 'ible. At this stage I have no library preferences and no particular desire to go it alone.
Please note, while I have investigated my module, there seem to be many versions of the mini module and I will leave it to you to experiment and work out the details of your version for yourself - its quite easy. Also note that the same module PC board supports either the Sim900 or the Sim900A chip and they are used similarly, so I will assume a Sim900.
My mini module is version 3.4 and the front and back is shown in the photos. Electrodragon.com publishes a schematic for their module, and it differs slightly from my module. The differences are:
- The Electrodragon module is version 3.6
- It has 3.3V to 5V and visa versa level translators onboard for the serial interface. Mine does not.
- My module is missing R2 on the back, and it links the empty "Restart" pin to the "Powkey" input on the Sim 900 chip. The Electrodragon module schematic refers to the "Restart" pin as J12 but is drawn incorrectly, it actually connects to the base of the transistor, not to VCC as shown. R2 (R6 on theirs) is a 4k7 surface mount resistor and you will need to install it if you want to use the Restart input to power the mini module up or down. You will also need to remove the 4k7 resistor (R25) on the top side of the mini module as it connects the transistor base to the positive supply. This is done so that the mini module will always turn on automatically when power is applied, and if its present you can't turn the module on or off under software control.
- There are a few other components shown on the schematic but are not installed on my module but they are not important to using it.
Step 1: Hardware....
You cannot power the module from the Arduino, as it is incapable of supplying the necessary peak currents. The Sim900 draws about 2A every so often. It's not necessary to build a 2A supply, as a large storage capacitor on the power supply output will supply the current. I am using a small switch mode buck power supply to step down from an external 12V DC source to 3.3V, with a 0.1F 5V super capacitor on its output and that works a treat. I believe that a 1000uF low esr cap will also work, but I've not tried it. The photo shows the power supply with a 0.1F cap underneath.
The Sim900 communicates at TTL levels limited by its power supply voltage. The hardware reference manual says TXD and RXD (serial transmit and receive respectively for the Sim900) max output and input voltage respectively is the same as the power supply...3.3V in my case.
The Arduino UNO, when using the SoftwareSerial library, transmits data on its digital IO pins at their voltage levels. When the Uno is supplied at 5V the maximum output voltage is 4.2V, and is 2.3V when supplied by 3V.
At first I put a voltage divider into the transmit signal path, but found it was not necessary, and it works to transmit and receive serial data between the module and the Uno.
Wiring it up
You will need to work out which digital pins are used by your preferred library provider for their compatible GSM shield. In my case I will use digital pins 2 & 3 and SoftwareSerial on the UNO. Some also use another digital pin to control switching power on and off for the GSM shield. Connect the UNO TX SoftwareSerial pin to the mini module RX pin and similarly for the Uno RX pin. Remember to connect common grounds between the UNO and the power supplies and the mini module.
Do NOT use the RS232 outputs on the side of the PC board, as it outputs some +-7V and can damage your Arduino. The TTL level serial output pins must be used (near the antenna connection). Also please check the ground pins on the connector as some people have reported that the pinout of their module is different to that shown in the photos of my mini module.
Step 2: Software....
The Arduino IDE includes a library for their GSM shield using the Quectel M10 GSM chip, and Surprise! it is almost identical to the Sim900A chip! Since it's easy, well documented, and has nice tools, I'm choosing to use this library to play with. The shield uses pins D2 (RX) and D3 (TX) for serial comms, and pin D7 to power the M10 up and down. You don't have to use D7 as the mini module will turn itself on in standard configuration. Wiring to these pins allows me to use the mini module as if it was the Quectel shield. If you want to use some other pins, hop into the GSM library GSM3IO.h and change them as you want.
Details of the library are explained on the Arduino GSM shield website
And I found this handy Youtube video...
Ok, recapping, we are using the Arduino GSM library with D2 as serial receive and D3 as serial transmit, power is applied to the mini module at 3.3V and has a large cap to supply the current peaks. An unlocked GSM SIM card is installed in the mini module and the net-light led is flashing slowly. A common ground is connected to the module and UNO. Ok, connect up the UNO to your PC and load the "test modem" sketch in the tools folder of the examples included with the library.
It should print the IMEI number of your mini modem on the serial monitor! Yah! Success! Next project is to hook up a GPS module and swap SMS's with it.