Ks0142 keyestudio SIM900 GSM/GPRS Module Shield: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 83: Line 83:
<br>
<br>


===2) For adding serial ports RXD(D6) and TXD(D7): send text===
===2) For adding serial ports RXD(D0) and TXD(D1): send text===
<pre>
<pre>
#include <SoftwareSerial.h>
  void sendMeg()
SoftwareSerial SIM900(6, 7); // define serial port PIN
  {
void SIM900_Start()
  Serial.println("AT");
{
  delay(2000);
   digitalWrite(9, HIGH);
  Serial.println("AT+CMGF=1");
  delay(2000);
  Serial.println("AT+CMGS=\"15812345678\"");//change into your phone number
  delay(2000);
   Serial.print("ABCDEFGHIJKLMN\r\n");//write the content here
   delay(2000);
   delay(2000);
   digitalWrite(9, LOW);
   Serial.write(0x1A);
   delay(5000);
}
void setup() {
  // put your setup code here, to run once:
   Serial.begin(9600);
}
}
void Call_Phone()
void loop() {
{
   // put your main code here, to run repeatedly:
   SIM900.println("ATD15812345678;"); // the numbers behind ATD is your phone number to dial.
   delay(15*1000);
   delay(100);
   sendMeg();
  SIM900.println("ATD15812345678;");
  delay(30000);            // wait for 30 seconds...
  SIM900.println("ATH");   // hang up
}
void setup()
{
  pinMode(9, OUTPUT);
  SIM900.begin(19200);  //set baud rate   
  SIM900_Start(); 
  delay(20000);  // wait for SIM900 to work
}
void loop()
{
  Call_Phone();
  do
  { 
  }
   while(1);
}
}
</pre>
</pre>
<br>
<br>
<span style="color: red">''' Code to Note:''' <br>
<span style="color: red">''' Code to Note:''' <br>
'''1.''' In the code, it will use the library '''SoftwareSerial.h''', you don't need to add it because the software IDE comes with this library.<br>
'''1.''' Serial.println("AT+CMGS=\"15812345678\"");//change into your phone number<br>
'''2.''' In the code '''SIM900.println("ATD15812345678;")''', you can change the phone number you want to dial.
'''2.''' Serial.print("ABCDEFGHIJKLMN\r\n");//write the content here


<br>
<br>
'''Test Result:'''<br>
'''Test Result:'''<br>
Done uploading the code, insert the SIM card into SIM900 GSM/GPRS shield, and then install the antenna, as well as stack the shield onto UNO R3 board.<br>
Done uploading the code, insert the SIM card into SIM900 GSM/GPRS shield, and then install the antenna, as well as stack the shield onto UNO R3 board.<br>
Power the UNO R3 board, the PWR LED on the shield lights; long press the SIM900-POWER button, waiting the Stable LED and NET LED light up; release the SIM900-POWER button, wait for a minute, your phone will receive the message sent from SIM900.<br>
Power the UNO R3 board, the PWR LED on the shield lights; long press the SIM900-POWER button, waiting the Stable LED and NET LED light up; release the SIM900-POWER button, wait for a minute, your phone will receive the message sent from SIM900.
 
<br>[[File:图片.jpg|400px|frameless|thumb]]<br>
<br>[[File:图片.jpg|400px|frameless|thumb]]<br>
    
    
Line 133: Line 122:
<br>
<br>


===3)For adding serial ports RXD(D6) and TXD(D7): call up===
===3) For adding serial ports RXD(D6) and TXD(D7): call up===
   
   
<pre>
<pre>
Line 184: Line 173:


==Resources ==
==Resources ==
'''PDF Download:'''<br>
https://drive.google.com/open?id=1jOILOgDrelbZg6sHrxSgydIBUHy1sb-j
'''Code_for_default_serial_port:'''<br>
https://drive.google.com/open?id=1vnyUdZL12Jh5WaFYfS4kfoZyODk2eY7m


'''Code_for_adding_serial_port:'''<br>
'''Download Code:'''<br>
https://drive.google.com/open?id=1y2WVPyqmO7KDBWEGNg8XuhUEt-0WLtT7


'''Code_for_adding_serial_ports_RXD_D6_and_TXD_D7_:'''<br>
https://fs.keyestudio.com/KS0142
https://drive.google.com/open?id=1qFHgPQGK-7waHJYH-S0agM6fgLO6fUkM


'''VIDEO:'''<br>
'''VIDEO:'''<br>

Latest revision as of 15:11, 6 January 2021

Keyestudio SIM900 GSM/GPRS Module Shield


Introduction

SIM900 GSM/GPRS shield is based on Quad-Band SIM900 GSM/GPRS module. It provides Arduino with GSM/GPRS function.
This shield allows you to make voice calls, send SMS or make connections to the Internet network.
On the shield, there is a serial port toggle switch for you to select either software serial port or hardware serial port to be connected to GPRS Shield.
If you choose software serial port, you need to use the Software UART; otherwise, you need to use the Hardware UART.
The shield includes a high capacitor dedicated to RTC (Real Time Clock).
If you toggle the switch to DBG-Port, you can connect the port to Arduino or connect the port to PC by Arduino to proceed the debugging.


Specification

1. Auto-adaption to 3.3V and 5V main board, supporting 3.3V platforms such as leaf maple and Chip kit;
2. After connecting the SIM900 shield to Arduino, 9V/2A DC power supply is needed. Otherwise, there might be malfunction;
3. Quad-Band GSM/GPRS 850/900/1800/1900MHz (Support 2G card of UNICOM, China Mobile, do not support Telecom card).
We use SIM900 GSM Module – supporting communication in 900MHz band.
You should check the mobile network band in your area.


Shield Details

  • Dimensions: 67mm x 85mm x 21mm
  • Weight: 35.7g


thumb


PINOUT Explanation


thumb


Using Method

1. Insert the SIM Card into the SIM Card slot.
thumb

2. Make sure the antenna pad is buckled properly. If you don’t want to fix it on the board, a patch cord is also supplied with the GPRS Shield to interface the antenna to the board. At the same time, plug your headphone into the shield.
thumb

3. Then, connect UNO R3 to computer using a USB cable, and upload the code to the board.
thumb

4. UNO R3 communicates with GPRS module by serial port, so after uploading (you must plug the shield into UNO R3 after uploading the code, or serial port can’t work.), connect RXD(D0) on UNO R3 to TXD on the shield, TXD(D1)to RXD on the shield.

5. Note that: If you need more serial ports, except for the default serial port D0 and D1, you can add some by programming.
We provide the code to make RXD(D6) and TXD(D7) serial ports below.

thumb

6. Because in the program, you can set set the number you want to dial. After uploading and connecting, press dialing key and you can make a voice call by the headphone with a mobile phone.


Test Code

1) For default serial ports RXD(D0) and TXD(D1):call up

void setup()
{
  pinMode(13, OUTPUT);   
  pinMode(9, OUTPUT); //D9 is SIM900 turn on pin
  digitalWrite(9,HIGH);
  delay(1000);
  digitalWrite(9,LOW);
  delay(15000);
  Serial.begin(9600);
}
 
void loop()
{
  Serial.print("ATD15812345678;\r");//15812345678 your dialing phone number
  delay(100000);
//  Serial.println("ATH");
  delay(200000);
}


Code to Note:
In the code Serial.print("ATD15812345678;\r"), here you can change the phone number you want to dial.


Test Result
Done uploading the code, connect the earphone and SIM card to the shield, and connect the antenna. Shown below.
Then stack the shield onto UNO R3 board, slide the toggle switch to the UART side, powered on, wait for about 2 minutes, it will dial the number that you have set well in the code. After calling, you can talk through the earphone.

thumb

thumb


2) For adding serial ports RXD(D0) and TXD(D1): send text

  void sendMeg()
  {
  Serial.println("AT");
  delay(2000);
  Serial.println("AT+CMGF=1");
  delay(2000);
  Serial.println("AT+CMGS=\"15812345678\"");//change into your phone number
  delay(2000);
  Serial.print("ABCDEFGHIJKLMN\r\n");//write the content here
  delay(2000);
  Serial.write(0x1A);  
 }
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}
void loop() {
  // put your main code here, to run repeatedly:
  delay(15*1000);
  sendMeg();
}


Code to Note:
1. Serial.println("AT+CMGS=\"15812345678\"");//change into your phone number
2. Serial.print("ABCDEFGHIJKLMN\r\n");//write the content here


Test Result:
Done uploading the code, insert the SIM card into SIM900 GSM/GPRS shield, and then install the antenna, as well as stack the shield onto UNO R3 board.
Power the UNO R3 board, the PWR LED on the shield lights; long press the SIM900-POWER button, waiting the Stable LED and NET LED light up; release the SIM900-POWER button, wait for a minute, your phone will receive the message sent from SIM900.
thumb



3) For adding serial ports RXD(D6) and TXD(D7): call up

#include <SoftwareSerial.h>
SoftwareSerial SIM900(6, 7); // define serial port PIN
void SIM900_Start()
{
  digitalWrite(9, HIGH);
  delay(2000);
  digitalWrite(9, LOW);
  delay(5000);
}
void Call_Phone()
{
  SIM900.println("ATD15812345678;"); // the numbers behind ATD is your phone number to dial.
  delay(100);
  SIM900.println("ATD15812345678;");
  delay(30000);            // wait for 30 seconds...
  SIM900.println("ATH");   // hang up
}
void setup()
{
  pinMode(9, OUTPUT); 
  SIM900.begin(19200);   //set baud rate    
  SIM900_Start();  
  delay(20000);  // wait for SIM900 to work 
}
void loop()
{
  Call_Phone();
  do
  {   
  }
  while(1);
}


Code to Note:
1.In the code, it will use the library SoftwareSerial.h, you don't need to add it because the software IDE comes with this library.
2.In the code SIM900.println("ATD15812345678;"), you can change the phone number you want to dial.


Shipping List

1. keyestudio SIM900 GSM_GPRS Module Shield *1
2. Extension cable 22CM *1

thumb

Resources

Download Code:

https://fs.keyestudio.com/KS0142

VIDEO:
http://video.keyestudio.com/ks0142/


Get One Now