1. Arduino UNO
2. GPRS Shield
3. antenna
This experiment uses the Arduino UNO as a gateway. For that, remove the chip from the board ATmega328 UNO then pile GPRS shield on it. Connect the two jumpers in the GPRS connection shield on the USB mode, and power select jumper on the "BO" or the Board.
Replace the SIM-card and antenna. Then connect the Arduino board that functioned as a gateway on a PC / laptop using a USB cable. Run hyperterminal program (Windows) or gtkterm (Linux), or can also use the Arduino program.
Enable mode "serial monitor". Then press the power button on the GPRS shield for 2 seconds. Send the article "AT" on the serial monitor. If the serial monitor responds with "OK", congratulations! GPRS means the shield is active and ready to the next step. If not, then try again make sure its USB port connection. Make sure the serial monitor automatically sends CR (Carriege Return) and LF (Line Feed).
Now try typing "ATD *********" (where ********** filled with a person's mobile phone number). Command is used to call a number that is written. To disconnect the phone, type the command "ATH"
Now continue on experiments in which we will send an SMS via the Arduino that our program. Replace the ATmega328 chip on board UNO. Connect the pin header on the mode of "Ard" or "Arduino". Now write the following sketch:
| / * * Sending an SMS with GPRS Shield * * Author: Outlets Smart, March 2011 * / int led = 13; onModulePin int = 2; / / pin is used to turn the shield without pressing the button timesToSend int = 1; / / Frequency of sms will be sent int count = 0; switchModule void () { digitalWrite (onModulePin, HIGH); delay (2000); digitalWrite (onModulePin, LOW); } void setup () { pinMode (led, OUTPUT); pinMode (onModulePin, OUTPUT); Serial.begin (115 200); switchModule (); / / enable GPRS shield for (int i = 0; i <2; i + +) { delay (5000); } Serial.println ("AT + CMGF = 1"); / / set the SMS mode delay (5000); Serial.print ("AT + CSCS ="); Serial.print (34, BYTE); Serial.print ("IRA"); Serial.println (34, BYTE); } void loop () { while (count <timesToSend) { delay (5000); Serial.print ("AT + CMGS ="); / / specify the destination number Serial.print (34, BYTE); / / send character quotes (") Serial.print ("08 **********"); / / *** complete with phone numbers designated Serial.println (34, BYTE); / / send character quotes (") delay (10000); Serial.print ("Test text of the Arduino shield ..."); / / the contents of SMS delay (10000); Serial.print (0x1A, BYTE); / / end of the command procedure sms 1A (hex) delay (10000); count + +; } if (count == timesToSend) { Serial.println ("AT * PSCPOF"); / / de-activation GRPS shield count + +; } } |

No comments:
Post a Comment