Sunday 19 January 2014

Gizduino (Arduino Clone) & GSM Shield Integration Test (Receive SMS)

Hello There! This topic is about my integration test between the GSM/GPRS Shield with the Gizduino for my research proposal. Gizduino is basically and Arduino Clone that I bought from E-gizmo. (Gizduino, an Arduino clone)


The type of Gizduino I used is the v4.0 which is basically the latest KIT they have as of January 2014. The type of microcontroller it comprises is ATmega 168 and ATmega 328, but for this project, I bought the ATmega 328 since it has a 

higher RAM.

The image shown below is the Gizduino (LEFT) and the GSM/GPRS Shield (RIGHT).




In the next image, I mounted the GSM/GPRS Shield to the Gizduino.




In order for this to work, I downloaded an Arduino Sketch Software. The Arduino Software is free, open source, and available for Windows, Mac OS and Linux. You can download the Arduino IDE from their website.



The image shown below is the Arduino Sketch Environment.



Here is the link for learning more about the Arduino Sketch Environment

Here is the program code I have made:

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;
char number[]="ur cellphone number here";
char message[180];
char pos;
char *p;

void setup()                      //declaring inputs and outputs
{
 Serial.begin(9600);              //initiate gizduino witha baud rate of 9600
 pinMode(7, OUTPUT);              //output for turning LED ON or OFF

 if (gsm.begin(9600))             //condition if gsm is initialized
 Serial.println("\nstatus=READY");     //displays "ready" on the serial monitor if gsm is ready
 else Serial.println("\nstatus=IDLE"); //otherwise displays "idle" on the serial monitor if gsm is not found
};

void loop()     //looping of the program
{
       pos=sms.IsSMSPresent(SMS_UNREAD);  //save to variable if there is an SMS
       Serial.println((int)pos);          //display position number (a.k.a index) of the message
       if((int)pos>0&&(int)pos<=20)       //if message from 0-20 is found
              {                   
               Serial.print("Message Received, INBOX=");  //display an output on the serial monitor
               Serial.println((int)pos);                  //display the position/index of the message
               message[0]='\0';                           //display '0' if no messages found
               sms.GetSMS((int)pos,number,message,180);   //get position/index, number of sender, and text message
               Serial.println(message);                   //display the text on serial monitor
               if(strstr(message, "ON")) digitalWrite(7,HIGH);   //if message 'ON' is received, LED is ON
               if(strstr(message, "OFF")) digitalWrite(7,LOW);   //if message 'OFF' is received, LED is OFF
               sms.DeleteSMS((int)pos);                          //after reading, delete SMS
                }
 delay(5000);                             //delay of 5seconds per loop
};

NOTE:
-->But before you would be able to run this program, download the GSM_Library and paste it in the Arduino libraries located on your Arduino folder in order to have this program running successfully.

-->Also, be sure to set the mode of the GSM/GPRS Shield to USART, and not UART. There is a hardware switch located on the top of the GSM/GPRS Shield Board.

Once the program is uploaded, you are good to GO!

A video shown below is the sample actual presentation of the implemented program I made.
(This was my first time to use an Arduino Kit and Arduino Sketch Environment)





The next image shown below is the combined circuit of the GSM/GPRS Shield and the Gizduino with their own regulated power supply from a 12VDC input into a 5VDC and a 9VDC output. The 5VDC source would be plugged into the GSM/GPRS Shield and the 9VDC source would be plugged into the Gizduino. 

GSM/GPRS Shield and Gizduino Circuit combined

Powered ON image of the GSM/GPRS Shield and Gizduino Circuit combined

The regulator transistors that were used are the LM7809 and the LM350. LM7809 is a 1A/9V regulator for the Gizduino source, since the Gizduino must have an input from 8VDC-10VDC. The GSM/GPRS Shield is powered by the LM350. The LM350 is an adjustable voltage regulator from 3VDC-33VDC of 3A. I created a circuit in such a way that I am able to produce an output of only 5VDC for the GSM/GPRS Shield. (You can check the LM350 pdf for the circuit and its formula for the desired output voltage you would prefer to have: LM350 Datasheet)

Here is an actual video footage in testing this combined circuit:



Project made by: Kirk Benedict P. Macaraeg

49 comments:

  1. do you have a code for GPRS?? where certain data are to be sent into a webserver?

    ReplyDelete
    Replies
    1. elow po...actually SMS based gamit namin pag transfer ng GPS data to the webserver gamit ang Visual Basic which is connected with a Serial TTL..plano sana namin magutilize ng GPRS, kaso mejo magastos tlga xa in terms sa load..xenxa late reply po..

      Delete
  2. Good evening Mr. Kirk.

    I'm Nathan from AMA Fairview QC, just want to ask you kung paano ang circuit diagram or software codings ng isang laser security system using Arduino and GSM Shield (SIM900D). We are testing the codes dito sa part ng post mo but then, every time na kino-contact namin, nage-AT commands siya but then walang natatanggap yung phone ko every time we're testing the sim card on the gsm shield.

    If there are available time for you to answer my question, feel free to email me at nathan.underscore14@gmail.com, baka may maitulong ka sa plight ng aming project. thanks in advance.

    by the way, ang project namin is about laser security system. once na may dumaan sa laser, biglang mag-aalarm tapos may darating sa iyo na sms message. that's our concept. hoping you can help us if ever possible.

    thank you!

    ReplyDelete
  3. hi po..tanong ko lng po if ilang beses po kau nkapagcontrol..kasi po isang beses ko lng po na ON at OFF ung LED..di na gumana ulit..

    ReplyDelete
  4. sir gusto ko sana malaman kung panu yung setup kahit walang gsm library thanks you reply please

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

    status=IDLE

    pinalitan ko rin ng braud(9600,19200) same parin ang problem.

    ReplyDelete
  6. Good day sir !
    do still have the schematic diagram of your project..
    i want to know what is the connection of the regulators to the gizduino and gsm module..
    pls help sir .. pls send at my e-mail
    ultimate_glenn@yahoo.com
    Thank you ahead sir !

    ReplyDelete
  7. Good evening sir. i have some problem about my gsm. what should i do if my output in serial monitoring is "ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp" I use my arduino mega 2560 and Gizduino x with GSM/GPRS Shield but the output is the same. thanks sir in advance

    ReplyDelete
  8. hello po! newbie po ako pagdating sa arduino. Im using ATmega2560 and yung GSM shield v1.2 from e-gizmo. pinagpatong q lng po sya gaya ng ginawa nyo. Hindi po umiilaw yung gsm ko. I've run a lot of programs already. wala pa rin. I've also compiled yung pinost nyo po. Error po dito SMSGSM sms; nadownload ko na po yung library na pinost nyo and copied it into the IDE library.

    ReplyDelete
    Replies
    1. kung hindi po umilaw yun wala po ung power.. need mo po external power supply..

      Delete
  9. Hello po! Paano niyo po pinagsama yung power supply nila? :-D

    ReplyDelete
  10. Para sa mga na hihirapan dyan. Follow nyo lang ang instructions i have tested it on my SIM900D. Make sure na may sariling power supply po ang GSM. Bumili po ako ng 9v battery para lang sa kanya. Always check po ang Library nasa wastong folder sa libraries ng arduino. At meron po example sa loob mismo ng GSM Library na na download nu, pweding pweding gamitin nun tested ko na po..

    ReplyDelete
  11. One last thing na lang pala.. Para sa may mga IDLE state..
    like this
    -----------------------
    Pulse Here!
    Pulse Here!
    Pulse Here!
    ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp

    status=IDLE
    --------------------

    Paki ON na lang po ng GSM nyo may manual ON button po yun..

    ReplyDelete
  12. sir panu mag send message.may sample code ka sir.pwede pahingi

    ReplyDelete
  13. Sir pano po magsend ng AT command using your codes. thank you po

    ReplyDelete
  14. Thanks Sir Kirk napagana ko din!

    ReplyDelete
  15. hi po. ask ko lang po. kung atmega328 po gagamitin ko, ano pong pins ang i coconnect sa gsm at sa atmega?. salamat in advance:)

    ReplyDelete
  16. hi po. ask ko lang po. kung atmega328 po gagamitin ko, ano pong pins ang i coconnect sa gsm at sa atmega?. salamat in advance:)

    ReplyDelete
  17. Sir, wala na po sa link yung GSM library

    ReplyDelete
  18. Sir pwede pong makahingi ng gsm library kc po hindi n po madownload ung gsm library.. eto po ung acc ko, itotaikic13@gmail.com kailangang kailangan ko lng po kc pra s proj nmin.. thankyou po.

    ReplyDelete
    Replies
    1. Bro, ano gamit mo arduino version? gamit ko yung arduino lib ng e-gizmo kaso ayaw macompile sa version na gamit kong arduino.

      Delete
    2. ung IDE b ng arduino ung sinasabi mo pre? version 1.0 ung gamit ko ehh, pero may GSM library ka? ung mga nakikita ko kcng library ehh ung pang arduino uno at mega, alang pang.gizduino

      Delete
    3. oo yung IDE. dalawa kasi version ng arduino ko 1.0.6 at 1.6.4. Dun sa 1.0.6 nag uupload naman at lumilitaw yung READY kaso hindi nakaka-receiv ng messages. Dun naman sa 1.6.4 version ayaw mag compile. Yung gamit kong library is yung sa e-gizmo eh.. GSMSHIELD http://www.e-gizmo.com/doculist.htm#gggg

      Delete
  19. It works! Used Arduino 1.0.6 IDE. I've changed this line

    if((int)pos>0) &&(int)pos<=20) //if message from 0-20 is found

    to

    if((int)pos>0) //if message from 0-20 is found

    ReplyDelete
  20. ichecheck ko po ung link po ng library n binigay mo mamaya, :-) ung prob kc sakin nggaganito

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

    status=IDLE
    ,,,,,,,,,,,
    Opo ung 1.0.6 ung ginagamit kong ver ng arduino.. ung latest version nila ayaw mgcompile ehh.. ung gsm library mo po dun mo pinaste s libraries s loob ng arduino po diba?

    ReplyDelete
    Replies
    1. ah baka naman walang external supply yung GSM shield mo? or baka naka off yung GSM shield?

      Delete
    2. oo dun lang din naka paste yung GSMSHIELD sa library folder ng arduino

      Delete
  21. May external supply sya kaso nkaohh pla ung manual switch nya tetestingin ko plng mamaya, haha, ano po gamit mong gizduino? Ung sakin kc gizduino x..

    ReplyDelete
  22. pano po sya lagyan ng reply if ever na nag on na ung device po salamat sir

    ReplyDelete
    Replies

    1. try to use this command
      SMSGSM sms;

      sms.SendSMS("numberhere","messagehere");

      Delete
  23. pwedeng patulong makahingi nang library nito , badly needed lang

    ReplyDelete
    Replies
    1. Sorry for the late reply guys, just find the library at google. I believe you may download them at arduino websites. My dropbox account has been removed due to high storage usage and I have changed my dropbox account. sorry for the inconvinience.

      Delete
  24. HEY THERE.. Can we use gizduino for our project ,, Microcontroller Based PrintER vENDO Machine .

    ReplyDelete
  25. gudeve po.
    ask lng po sana ng help if the project is tracking using gps shield gsm/gprs shield and gizduino. salamat

    ReplyDelete
  26. gudeve po.
    ask lng po sana ng help if the project is tracking using gps shield gsm/gprs shield and gizduino. salamat

    ReplyDelete
  27. gud eve po..pa help po,, paanu b gawn ang sketch ng send a sensor result from arduino to Cp.. thanks

    ReplyDelete
  28. This comment has been removed by the author.

    ReplyDelete
  29. This comment has been removed by the author.

    ReplyDelete
  30. pahingi po ako library ng gsm wala napo sa drop box

    ReplyDelete
  31. ano po bang version ng gizduino at gsm ang compatible?

    ReplyDelete
  32. Hi sir Kirk, saan po ako makapag-download o makahingi ng GSM library. Excited lang po ako mai-try yung inyong awesome project in receiving SMS message. Just bought my first microcontroller GizD Ver5 328 w/casing and SIM900D GSM shield last April 2016. (Eugene Aquino: aquinoeugenio@yahoo.com)

    ReplyDelete
  33. sir meron po ba kyung alam na code if ever i check yung status nung led if it's on/off thanks po in advance email me sir meron rwlgutierrez@gmail.com

    ReplyDelete
    Replies
    1. sir baka sakali lng po meron kayung alam na codes for auto reply or malaman yung status nung LED kung nka ON/OFF

      Delete
  34. This comment has been removed by the author.

    ReplyDelete
  35. Good day sir, Kirk here. search nyo na lng po sa google GSM Library. kasi yung dropbox link is not functional anymore kasi yung account ko nuon is non existing na po.thanks

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. Hi sir, pwede po pa help. may error po po sa pag compile 'no matching function for call to 'SMSGSM: :GetSMS(int, char[25], char[180], int)'

    ReplyDelete
    Replies
    1. pa reply nlng po sa email ko graldkennedybataller@gmail.com. salamat po.

      Delete