Dear Automator...
In the great opportunity I would share about my new project and i have finished it. My posting will discuss about how to use GPRS shield (SIM900) in arduino. I used product from duinopeak and you can check here. !!
Now let's to the main topic of the discussion.
3. Power on/off by D9
The type of Antenna connector is IPEX, and the maximum transit power of SIM900 is 30dBm(1w). More information please see the Specification of GPRS Antenna.
8. Led indicator
If you can not see the messages in the serial monitor, you should click the "send new" option that will add carriage return at the end of AT command and then send AT command "AT+IPR=19200" to set the baud rate of the SIM900.
Picture 1 Duinopeak SIM900 Shield
In the great opportunity I would share about my new project and i have finished it. My posting will discuss about how to use GPRS shield (SIM900) in arduino. I used product from duinopeak and you can check here. !!
Now let's to the main topic of the discussion.
There’re two choices for you to communicate GPRS shield with
the main board while plugging the two jumpers on to the SWserial or
HWserial positions. If using SWserial, D7 and D8 will be used by SIM900
of GPRS Shield; if using HWserial, D0 (RX) and D1 (TX) will be used.
3. Power on/off by D9
Some pins of SIM900 are break out beside the ISP port, there're LINEIN_R, LINEIN_L, ADC, PWM1, PWM2, GPIO1~GPIO6, GND, FW_update (DISP_CLK, DISP_DATA, DISP_D/C, DISP_CS), RI, DCD, DSR, CTS, VDD_EXT, LDTR, LRTS. And those pins are pointed from SIM900 without any setting.
It can provide 3v volts to VRTC of SIM900 from CR1220 battery.
5v pin: Soft start circuitry is added in the new version to smooth out the power shock at the moment the shield turns on, preventing the shield from unexpected reset issue.
Vin pin: The range of input voltage are between 6.5v to 12v.
7. AntennaThe type of Antenna connector is IPEX, and the maximum transit power of SIM900 is 30dBm(1w). More information please see the Specification of GPRS Antenna.
8. Led indicator
Getting Familiar With AT Commands
As you receive the GPRS Shield, what would be the first thing you
want to do with it? Send out a text (SMS)? Or call up someone (headset
required)? You can do all of this by talking to the GPRS Shield using AT
Commands - a special language that it understands. AT Commands are simple textual commands sent to the GPRS modem
over its serial interface (UART), so you can use any serial terminal
software to communicate with it.
- Preparatory Work
- Follow the steps below to set up the hardware system.
- 1. Insert an activated SIM card to SIM Card Holder
- A 6 Pin Holder for SIM Cards. Both 1.8 volts and 3.0 volts SIM Cards are supported by SIM900, the SIM card voltage type is automatically detected.
- 2. Check the antenna
- Make sure the antenna have installed properly in the antenna interface.
- 3. Communication port configuration
- The GPRS shield can be controlled via hardware serial port or software serial port of Arduino. Here we use the software serial port as default. Choose it by inserting jumper caps as below.
- 4. Plug to Arduino
- Stack the GPRS Shield onto Arduino.
- 5. Power up Arduino
- Power up Arduino by USB cable or DC Jack. The Power-on indicator LED should light up once connectted.
HOW TO CHECK DEVICE USING AT COMMAND
- Usage
- Let's have a try to control the GPRS shield with AT commands. The GPRS Shield comes with all accessories that you need to get started with sending data over the GSM network except an Arduino board and a GSM SIM Card. If you want to make voice calls, you would also require a headset with microphone.
- Step 1: Test Setup
//Serial Relay - Arduino will patch a //serial link between the computer and the GPRS Shield //at 19200 bps 8-N-1 //Computer is connected to Hardware UART //GPRS Shield is connected to the Software UART #include <SoftwareSerial.h> SoftwareSerial GPRS(7, 8); unsigned char buffer[64]; // buffer array for data recieve over serial port int count=0; // counter for buffer array void setup() { GPRS.begin(19200); // the GPRS baud rate Serial.begin(19200); // the Serial port of Arduino baud rate. } void loop() { if (GPRS.available()) // if date is comming from softwareserial port ==> data is comming from gprs shield { while(GPRS.available()) // reading data into char array { buffer[count++]=GPRS.read(); // writing data into array if(count == 64)break; } Serial.write(buffer,count); // if no data transmission ends, write buffer to hardware serial port clearBufferArray(); // call clearBufferArray function to clear the storaged data from the array count = 0; // set counter of while loop to zero } if (Serial.available()) // if data is available on hardwareserial port ==> data is comming from PC or notebook GPRS.write(Serial.read()); // write it to the GPRS shield } void clearBufferArray() // function to clear buffer array { for (int i=0; i<count;i++) { buffer[i]=NULL;} // clear all index of array with command NULL }
- 2. Upload the code to Arduino. If you do not know how to upload the code, please click here.
- 3. Download and fire up serial tool if you don't have one. Choose the correct COM port for Arduino, and set it to operate at 19200 8-N-1 and then click "Open Com". You can also use AT Command Tester to send AT commands. Please click here if you are interesting in it.
- 4. Power up the SIM900 by pressing the power button in about 2 seconds. The red LED will be on. The green one beside it will blink. If the shield join the network sucessfully, the green LED will blink every 3 seconds.
RDY +CFUN: 1 +CPIN: READY Call Ready
If you can not see the messages in the serial monitor, you should click the "send new" option that will add carriage return at the end of AT command and then send AT command "AT+IPR=19200" to set the baud rate of the SIM900.
- Notice: How AT commands control the GPRS Shield
- The ATmega328P microcontroller on Duemilanove board has only
one UART which is used for communicating with the PC. What we need is an
Arduino Sketch running inside the ATmega328P that would emulate a
second serial port (UART) using software on the digital pins D8 and D7
and patch through all the communication between this second software
serial port and the actual hardware serial port. By doing this, all the
data coming from the computer (connected to the actual hardware UART)
would be routed to the GPRS Shield (connected to software UART) then, we
would be able to issue AT commands to control the GPRS Shield. The
block diagram outlining this scheme is shown below.
Step 2: Send A Text Message (SMS) - Based on step 1, now we try to send a text message by using AT commands.
- 1. The GPRS Shield can send SMSes in two modes: Text mode and PDU (or binary) mode. To send out a human readable message, select the text mode by sending AT command "AT+CMGF=1". If succeeds, The GPRS Shield will respond with an OK.
- 2. To enter the number of your target phone, tick "SendNew" option and send AT+CMGS="136*****556". This will instruct the GPRS Shield to send a new message to the phone number specified (replace the number with the phone number of your target phone). The GPRS Shield will send a> to remind you of typing the message. Please note that phone number specified as parameter in any AT command must be in E.123 format.
- 3. After entering your message, tick "send hex" option and then send a hex: 1A. The modem will accept the message and respond with an OK. A few moments later, the message should be received on the handset whose number you had specified. I sent "How are you ?". You can check the histroy by clicking "EXT". The commands histroy is listed below "Set Multi Char".
- NOTE: If, in spite of following the steps as specified above, you're unable to receive the message on the target handset, you might need to set the SMS Message Center number. Send the following command between the AT+CMGF and AT+CMGS commands:AT+CSCA="+919032055002". Replace the phone number specified with the SMS Center number of your GSM Service Provider. The message center number is specific to each service provider. You can get the message center number by calling up the customer care center of the GSM Service Provider and asking them for it.
Mas mau nanya lampu indikator warna merah hanya hidup beberapa detik.masalahnya kenapa ya?
ReplyDeleteitu power supplaynya kurang mas, tambah supplay external
Delete