The GSM SIM900 module is a complete Quad-band GSM/GPRS solution in a compact plug-and-play package. It can be used to add cellular communication capabilities to microcontrollers and computers, allowing for voice calls, SMS messages, and data transfer over the GSM network. This makes it an ideal component for applications in remote monitoring systems, IoT devices, and any project requiring mobile connectivity.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (3.4V to 4.5V) |
2 | RST | Reset pin |
3 | RXD | Serial data receive pin |
4 | TXD | Serial data transmit pin |
5 | GND | Ground connection |
AT+CSQ
command to check signal quality.Q: Can the SIM900 module connect to 3G or 4G networks? A: No, the SIM900 is a 2G module and can only connect to GSM/GPRS networks.
Q: How do I send an SMS using the SIM900 module?
A: You can send an SMS by issuing the appropriate AT commands (AT+CMGS
) through the serial interface.
Q: What is the baud rate for serial communication with the SIM900?
A: The default baud rate is 9600 bps, but it can be configured with the AT+IPR
command.
#include <SoftwareSerial.h>
SoftwareSerial SIM900(7, 8); // RX, TX
void setup() {
// Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
// Begin serial communication with Arduino and SIM900
SIM900.begin(9600);
// Give time to SIM900 to initialize
delay(20000);
// AT command to set SIM900 to SMS mode
SIM900.print("AT+CMGF=1\r");
delay(100);
// Set module to send SMS data to serial out upon receipt
SIM900.print("AT+CNMI=2,2,0,0,0\r");
delay(100);
}
void loop() {
// Check if SIM900 is sending a message
if (SIM900.available()) {
Serial.write(SIM900.read());
}
// Check if the serial monitor is sending a message
if (Serial.available()) {
SIM900.write(Serial.read());
}
}
Note: This example sets up the SIM900 module to send and receive SMS messages. The SoftwareSerial
library is used to create a serial connection on pins 7 and 8 of the Arduino UNO. Ensure that the SIM900 module is powered correctly and that the antenna is connected before running the code.