Arduino Interfacing
Making Connections




Here we have connected UART TX(Purple),RX(Grey),GND(Black),VTRANS(Yellow), PWRKEY(Blue) pins of modem to Arduino Uno RX, TX, GND, 5V, GPIO2/Pin no 2 respectively
Make sure you press PWRKEY switch before running the below code or incorporate the PWRKEY activation code before sending AT command. Wait for atleast 30 seconds after module turns on to send any AT command.
Here is a simple code for testing a simple AT command. This code reads the IMEI number of module which is also printed on it.
void setup()
{
Serial.begin(115200);
digitalWrite(2,1); // Make PWRKEY low
delay(1000);
digitalWrite(2,0); // Make PWRKEY high
Serial.println("Initializing...");
delay(15000);
}
void loop()
{
Serial.println("AT+CGSN");
while(Serial.available())
{
Serial.write(Serial.read());//Forward what Software Serial received to Serial Port
}
delay(5000);
}
Last updated