A7670E LTE module Arduino Uno success

Hi everybody,

I was struggling with the A7670E module, but eventually, I got it working with the help of Minicom and ChatGPT. It took me a whole day, and since I couldn’t find many available information, I wanted to share my working code for both SMS and calling.

My SIM card didn’t have an SMSC number set, so I had to use Minicom to reset the SMS mode, look up the correct SMSC number for my operator, and set it manually using the following commands:

AT+CSCS="GSM"
AT+CMGF=1
AT+CSCA="+myOperatorSMSCnumber",145

You can find SMSC numbers here: SIM center numbers.

Connecting to Minicom depends on whether you're using Linux or Windows, but it’s pretty straightforward, and there are plenty of tutorials available online.

The module won't work connected to Arduino power pins, it needs is own power supply 5V 2Amp.

Here is my code used on Arduino UNO. Hope it works for you! Good luck!

#include <SoftwareSerial.h>
// GSM Module connection
SoftwareSerial gsmSerial(9, 10); // TX, RX pins
String PhoneNum = "+123456798";
//Setup
void setup() {
  Serial.begin(9600);          // Start Serial communication
  gsmSerial.begin(115200);       // Start GSM module communication
  // Setup GSM module for SMS
  sendATCommand("AT+CMGF=1", "OK", 30000); // Text mode
  //sendATCommand("AT+CNMI=1,2,0,0,0", "OK", 2000); // New SMS indication
}
//Main loop
void loop() {
 sendSMS("Test message from Arduino UNO!"); //send SMS
 delay(30000);
 checkAndHangup();  // Make sure no active call
 delay(5000);  // Give some time before calling again
 sendCall(); //Dial a call
 delay(10000);
}
//AT commands
void sendATCommand(String command, const char* expectedResponse, unsigned long timeout) {
  Serial.print(command);
  gsmSerial.println(command); // Send the AT command
  long int time = millis();
  while ((time + timeout) > millis()) {
    while (gsmSerial.available()) {
      if (gsmSerial.find(const_cast<char*>(expectedResponse))) {
        Serial.println(command + ": SUCCESS");
         return;
      }
    }
  }
  Serial.println(command + ": FAILED");
  delay(1000);
}
//Send SMS
void sendSMS(String message) {
  sendATCommand("AT+CMGS=\"" + PhoneNum + "\"", "OK", 2000); // Prepare to send SMS
  gsmSerial.println(message); // Send the message content
  delay(500);
  gsmSerial.write(26); // ASCII code for CTRL+Z to send the SMS
  Serial.println("SMS Sent: " + message);
}
//Dial a call
void sendCall() {
  sendATCommand("ATD" + PhoneNum + ";", "OK", 2000);
  Serial.println("Call outgoing...");
  // Wait for call connection
  unsigned long callStart = millis();
  bool callConnected = false;
  while (millis() - callStart < 20000) { // Wait up to 20 seconds for call to connect
    sendATCommand("AT+CLCC", "0", 2000); // "0" means call is active
    if (gsmSerial.find("1,0,0,0,0")) { // This means the call is connected
      Serial.println("Call Connected!");
      callConnected = true;
      break;
    }
    delay(1000); // Check again in 1 second
  }
  if (callConnected) {
    delay(30000); // Keep the call active for 30 seconds (adjust as needed)
    Serial.println("Hanging up...");
    sendATCommand("AT+CHUP", "OK", 5000); // Hang up call
  } else {
    Serial.println("Call was not answered.");
  }
}
//Reset any active calls and Hangup
void checkAndHangup() {
    sendATCommand("AT+CLCC", "OK", 2000); // Check active calls
    sendATCommand("AT+CHUP", "OK", 5000); // Try to hang up if needed
}

2 Likes

Thanks for sharing!

Can you show a diagram for the wiring?

Yes, I can do, once I get back home.
But the wiring is very simple.

A7670 board ---> Arduino Uno
TX ----> 9
RX ----> 10
GND ----> GND

Power supply ---> A7670 board
5V out ---> 5V(Vcc)

Power supply ---> Arduino Uno
5V out ---> 5V in
GND ---> GND

The module must share the ground with Arduino Uno and power supply. If you don't get any Serial connection, swap over pins 9/10 so Tx ---> Rx, Rx ---> Tx.

Hope that helps, let me know!

Thanks for an interesting project. I have an A7670 breakout on the way from China. I beleive the voltages for TX and RX are 1.8V or 3.3V. Is this catered for by the breakout board ?
Did you connect the TX and RX pins directly to the Una or use some form of level agjustment?

@buxter1980 How did you get that to work, I have the same sim board but based on the link you gave, I can't find my country in the list. Also don't you need to connect the PWR-K pin?

Sorry, I couldn't connect to my account so had to make another one. By the datasheet, both voltages are supported. I connected them directly to UNO just as described in the answer for @sleepywisdom.

I'm replying from a different account, my account doesn't seems to connect anymore. Anyways..

The SMSC list is not fully complete. If you can’t find your country, try Googling it or ask your mobile provider.

I didn’t connect the PWR-K pin, and it works fine. Your board might be slightly different and could require the connection. Try using 3.3V.

Here’s the manual I received with the board, which is used as a shield on the Raspberry Pi. It's a bit different from using it on an Arduino, but reading it will definitely provide useful information, such as how to use Minicom to set the SMSC number via serial.
Good luck!

I have changed to an Arduino Pro Mini 328 8MHz 3.3V which is connected to the A7670E module using 2 as the RX and 3 as TX. Direct connections. I am using a mix of your code and my own. I found that I needed to reduce gsmSerialSerial to 9600 to read responses from the module. It is working reliably. sendATCommand("AT+CMGS="" + stringPhoneNum + """, "OK", 2000); connects okay but returns FAILED. I haven't tried to resolve that as yet.

First of all, thank you so much @buxter1980 @buxter23 for sharing this project, you helped me avoid several hours of trial-error.

I'd like to share that I got my own project working with the same A7670E LTE module, but I connected it to an Arduino Nano board, successfully powering the module through the 5v output, without any external power! I'm also able to send SMS and Phone Calls without any problems.

Now, my goal is to be able to open voice communication through the phone call, but I'm having some trouble coming up with a microphone solution. I got MAX9814 mic working as a sensor and for audio recording, but I'm still unable to hear it from the other side of the call.
Has anyone tried something like this?

Thanks in advance!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.