The SIM900A Mini is a compact GSM/GPRS module that enables cellular communication in embedded systems. It allows devices to send and receive SMS messages, make and receive voice calls, and connect to the internet via GPRS. This module is widely used in various applications such as remote data monitoring, IoT devices, automotive applications, and security systems.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.4V - 4.5V) |
2 | RST | Reset pin, active low |
3 | RXD | Serial data receive pin |
4 | TXD | Serial data transmit pin |
5 | GND | Ground connection |
#include <SoftwareSerial.h>
SoftwareSerial SIM900A(7, 8); // RX, TX
void setup() {
// Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
// Begin serial communication with SIM900A Mini and set baud rate
SIM900A.begin(9600);
// AT command to set SIM900A to SMS mode
SIM900A.print("AT+CMGF=1\r");
delay(100);
// Set module to send SMS data to serial out upon receipt
SIM900A.print("AT+CNMI=2,2,0,0,0\r");
delay(100);
}
void loop() {
// Check if the SIM900A Mini has sent any data to the Arduino
if (SIM900A.available()) {
Serial.write(SIM900A.read()); // Forward what SIM900A Mini has sent to Serial Monitor
}
// Check if the Arduino has sent any data to the SIM900A Mini
if (Serial.available()) {
SIM900A.write(Serial.read()); // Forward what Serial Monitor has sent to SIM900A Mini
}
}
Note: This example sets up the SIM900A Mini 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. Adjust the pin numbers as needed for your setup.