It is an Arduino code that uses the SIM A7 AI Thinker Version 7.1 module to send an SMS message with the current location, but I received an error during sketch transfer when uploading.
![]()
and for the wiring :
le pin VBAT Ã 5v
GND Ã la masse de lArduino Uno.
le pin URXD (RX) du module au pin TX de l'Arduino Uno (pin 1).
le pin UTXD (TX) du module au pin RX de l'Arduino Uno (pin 0).
e pin EN du module au pin 2 de l'Arduino Uno.
Connexion GPS :
le pin GPSTXD du module au pin 4 de l'Arduino Uno.
Activation du module :
le pin PWRKEY Ã un pin de l'Arduino Uno ( le pin 3).
le pin SLEEP du module à un pin de l'Arduino Uno ( le pin 5).
Connexion des broches de contrôle :
le pin RESET du module au pin 11 de l'Arduino Uno.
le pin UCTS du module au pin 12 de l'Arduino Uno.
le pin URTS du module au pin 13 de l'Arduino Uno.
Please post text instead of microscopic screen captures.
Arduino Uno pins 0 & 1 are used for the uploading, connecting the modem to them can block the process.
Try to disconnect 0 and 1 pins during the upload.
By the way, I see in the pictures, that a softwareserial has been used in the code. What are the pins it connected to?
Please show your code using the code tags.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0, 1); // RX, TX
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
pinMode(2, OUTPUT); // EN
pinMode(3, OUTPUT); // PWRKEY
pinMode(5, OUTPUT); // SLEEP
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(3, HIGH);
delay(5000);
mySerial.print("AT+CGNSPWR=1\r\n");
delay(1000);
mySerial.print("AT+CGNSSEQ="RMC"\r\n");
delay(1000);
}
void loop() {
mySerial.print("AT+CGNSINF\r\n");
delay(2000);
while (mySerial.available()) {
char c = mySerial.read();
Serial.print(c);
}
Serial.println();
delay(2000);
mySerial.print("AT+CMGF=1\r\n");
delay(1000);
mySerial.print("AT+CMGS="+1234567890"\r\n");
delay(1000);
mySerial.print("My current location is: ");
while (mySerial.available()) {
char c = mySerial.read();
mySerial.write(c);
}
mySerial.print("\r\n");
mySerial.write((byte)26);
delay(5000);
}
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0, 1); // RX, TX
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
pinMode(2, OUTPUT); // EN
pinMode(3, OUTPUT); // PWRKEY
pinMode(5, OUTPUT); // SLEEP
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(3, HIGH);
delay(5000);
mySerial.print("AT+CGNSPWR=1\r\n");
delay(1000);
mySerial.print("AT+CGNSSEQ="RMC"\r\n");
delay(1000);
}
void loop() {
mySerial.print("AT+CGNSINF\r\n");
delay(2000);
while (mySerial.available()) {
char c = mySerial.read();
Serial.print(c);
}
Serial.println();
delay(2000);
mySerial.print("AT+CMGF=1\r\n");
delay(1000);
mySerial.print("AT+CMGS="+1234567890"\r\n"); // Replace with the phone number you want to send the message to
delay(1000);
mySerial.print("My current location is: ");
while (mySerial.available()) {
char c = mySerial.read();
mySerial.write(c);
}
mySerial.print("\r\n");
mySerial.write((byte)26);
delay(5000);
}
Please show your code using the code tags.


