Until recently, for sending an SMS we had to use third-party services from the Internet. We had to log on to a third-party server, copy and paste the message in the text box, pull up the mobile phone numbers, or copy and paste the group of mobile phone numbers separated by commas and then press send.
In some rare cases, the SMS would not reach the destinations. So the guys at our company decided to buy an SMS server to create own facility for sending mass SMSes.
The proposal was moved and eventually the SMS server was bought and put into operation. But when I heard how much the entire system cost, I was spellbound. That is when I decided to make a cheap and efficient Raspberry Pi based SMS server at a fraction of the cost.
In this article, we will design an Raspberry pi based SMS server using a GPRS shield, pin details of which include +5V, Tx and Rx, as shown in Fig. 1.
You can buy a GPRS shield for US$ 4.7 from here, however the video instructions provided by the vendor would most likely be in Mandarin. So, in all probability, you would not be able to understand the audio instructions and face problem while soldering the surface-mount diodes LED1 and LED2.
To solve that problem, I have marked the polarity of the diodes as shown in Fig. 2. The positive rail comes from the edge of the PCB, where D1, R1, D4 and R3 have been marked.
All surface-mount resistors (R1, R2 and R3) are 4.7-kilo-ohm each. The diode and capacitor shown in Fig. 2 should be mounted on the other side of the PCB.Fortunately, you can avoid soldering this kit by ordering the assembled kit from here (We recommend users to see the video instructions from here, as it really helps to understand how to use this GPRS shield.) Do clip the antenna on the module.
Getting started with hardware
Following hardware items are required to get started:
1. GPRS shield 900MHz – 1800MHZ
2. USB-to-serial dongle (required as these shields do not work on direct UART connections)
3. Raspi computer (preferable model B2 with 512MB RAM)
4. SIM card ready for sending SMSes
To start with, after logging on, update Raspi using the following commands. This ensures that you have the latest software and drivers installed.
[stextbox id=”grey”]$ sudo apt-get update
$ sudo apt-get upgrade[/stextbox]
Now, to send and receive SMSes using a GSM modem on Raspi, install Linux application Gammu and its GTK front-end Wammu.
[stextbox id=”grey”]$ sudo apt-get install gammu wammu[/stextbox]
Circuit and working
Connect the GPRS shield to Raspi using USB-to-serial dongle/adaptor as shown below and also in Fig. 3.
[stextbox id=”grey”]GPRS shield Dongle pins
Pin-2 : +5V : connect to VCC of
Pin-3 : Ground : connect to GND of
Pin-14 : Tx : connect to Rx of dongle
Pin-16 : Rx : connect to Tx of dongle[/stextbox]
Insert the SIM card into the SIM card jacket and connect the GPRS shield. You will find one LED (power LED) is glowing steady while the other LED (signal LED) is blinking steadily. In case there is a signal problem, the signal LED will blink fast.