32u4 with A7 GPRS/GSM

From Elecrow
Jump to: navigation, search

Contents

Introduction

The 32U4 with A7 GPS+GSM/GPRS Board is based on Mega32U4 and A7 GPS+GSM/GPRS module. It can be used to make a call, send text messages and get GPS positioning. Also it has one analog interface, one IIC interface and two digital interface, which you can connect to other expansion modules. It is very easy for you to make a GPS Tracker by using this board.

Model: ACM20327B
32U4 with GSM GPS.jpg

Features

  • ATMEGA32U4+A7.
  • Work voltage: 3.3V to 5V.
  • Operating temperature: -30 ℃ to + 80 ℃.
  • Three kinds of interface.
  • Equipped with 3.5mm headphone jack.
  • 3.7V Battery power supply.
  • Standby average current 3ma or less.
  • Support the GSM / GPRS Quad-band, including 850,900,1800,1900MHZ.
  • Support China Mobile and China Unicom's 2G GSM network worldwide.
  • GPRS Class 10.
  • Sensitivity < -105.
  • Support GPS Positioning.
  • Support for voice calls.
  • Support for SMS text messaging.
  • Support GPRS data business, the maximum data rate: download 85.6Kbps, upload 42.8Kbps.
  • Supports standard GSM07.07, 07.05 AT commands and Ai-Thinker extended commands.
  • Supports two serial ports, a serial port to download an AT command port.
  • Support for Global Positioning System.
  • Horizontal positioning accuracy of less than 2.5m.
  • AT command supports the standard AT and TCP / IP command interface.
  • Support digital audio and analog audio support for HR, FR, EFR, AMR speech coding.
  • Support ROHS, FCC, CE, CTA certification.

Specifications

  • Quad-band: 850/900/1800/1900 MHz.
  • GPRS multi-slot: 12, 1 to 12 can be configured.
  • GPRS mobile station: Class B.
  • Compatible with GSM Phase 2/2 +: Class 4 (2W @ 850/900 MHz) Class 1 (1W @ 1800 / 1900MHz).
  • Current consumption: 1.3mA @ DRX = 5; 1.2mA @ DRX = 9.
  • AT command control: Standard GSM07.07, 07.05 AT commands and Ai-Thinker extended commands.
  • SIM Application Toolkit.
  • GPRS Class 10: Up 85.6 kbps (upstream) & 42.8Kbps (downlink).
  • Dynamic Conditions Altitude <18,000 meters (60,000 feet).
  • Speed <515 m / s (1000 nautical miles), acceleration <4 g.
  • PBCCH support.
  • Coding scheme: CS 1, 2, 3, 4.
  • Support CSD: Up 14.4 kbps.
  • Support USSD.
  • Stack: PPP / TCP / UDP / HTTP / FTP / SMTP / MUX.

Cautions

  • Make sure your SIM card is locked.
  • This product is supplied as is, without an insulated housing. In high humidity weather, pay special attention to ESD precautions.
  • It just supports baud rate 115200bps.

Interface

The interface.png Exampsgdg.jpg

Usage

1. Install the antenna.

Two miniature coaxial RF connector is present on the back of the 32U4 with A7 GPRS/GSM/GPS Board to connect with a GSM antenna or a GPS antenna . The connector present on the 32U4 with A7 GPRS/GSM/GPS is called a U.FL connector.The GSM Antenna supplied with the GPRS Shield has an SMA connector (and not an RP-SMA connector) on it.The connection topology is shown in the diagram below:
.

Install the GPS antenna.jpg Install the GPRS GSM antenna.jpg

2. Insert the Micro SIM card into the SIM card holder.

There is a SIM card holder on the back of the board. Both 1.8 volts and 3.0 volts SIM Cards are supported by this board, the SIM card voltage type is automatically detected.

Insert the SIM card.jpg

3. Connect the battery.

Because the PC USB port output current is not enough,so you should connedct an 3.7V lithium battery to the battery port.

Perfect.jpg

4. Upload the code

Open your Arduino IDE, choose the file, choose the Arduino Leonardo Board.
You can refer to this test code and upload it to your board: 32U4_with_A7_test

/*
 * Created by Keen
 * Modified by Keen 
 * Date: 11/04/2017
 */
#include<stdio.h>
#include<string.h>
#define DEBUG true
String target_phone = "+861**********6"; // Your phone number, not number of 32U4 with A7/GSM/GPS.

void setup()
{
  Serial.begin(115200);
  Serial1.begin(115200);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(8,OUTPUT);
  digitalWrite(5, HIGH); 
  digitalWrite(4, LOW); 
  digitalWrite(8, LOW); 
  Serial.println("After 2s, test begin!!");
  delay(2000);
  funtion_test();
}

void loop()
{
  if (Serial1.available()>0) {
    Serial.write(Serial1.read());
  }
  if (Serial.available()>0) {
    Serial1.write(Serial.read());
  }
}

void funtion_test(){
   Serial.println("Test begin!!");
   digitalWrite(8, HIGH); 
   delay(3000);       
   digitalWrite(8, LOW); //Power ON..
   Serial.println("A7 Power ON!");
   Serial.println("You may receive the AT   OK"); 
   sendData( "AT",1000,DEBUG);
   delay(500);
   digitalWrite(5, LOW);  //Sleep
   Serial.println("A7 go to sleep now!");
   delay(3000);
   Serial.println("test GPS function");
   testGPS();          //no call, A7 sleeping   
   sendData( "AT",1000,DEBUG);
   delay(500);
   Serial.println("if you receive GPS data,the sleep test failed!");
   digitalWrite(5, HIGH);   // wake up
   delay(1000);
   Serial.println("A7 WAKE UP!"); 
   Serial.println("test whether wake up or not, if OK, A7 wake up"); 
   sendData( "AT",1000,DEBUG);
   delay(500);     
   digitalWrite(4, HIGH); // power off A6
   Serial.println("A7 power off!");
   delay(3000);
   digitalWrite(4, LOW);
   Serial.println("print AT and you not receive OK"); 
   sendData( "AT",1000,DEBUG);
   delay(500); 
   Serial.println("A7 not Respond"); 
   digitalWrite(8, HIGH);           //POWER UP
   delay(3000);       
   digitalWrite(8, LOW);
   delay(3000);
   Serial.println("A7 Power ON!"); 
   Serial.println("................................."); 
   sendData( "AT",1000,DEBUG); //
   delay(1000);
   Serial.println("The funtion is Get GPS..."); 
   testGPS();
   Serial.println("The funtion is Dial Voice Call..."); 
   delay(1000);
   DialVoiceCall();
   Serial.println("The funtion is Send SMS ..."); 
   delay(1000);
   SendTextMessage();
   Serial.println("This function is submit a HTTP request...");
   delay(1000);
   TCP_GPRS();
   Serial.println("All the test of 32U4 with A7 is complete!");
}

void testGPS(void){
  sendData("AT+GPS=1",1000,DEBUG);     
  sendData("AT+GPSRD=1",3000,DEBUG);
  sendData("AT+GPS=0",10000,DEBUG);
}

void TCP_GPRS(){
   sendData("AT+CREG?",5000,DEBUG); //Query network registration
   delay(100);
   sendData("AT+CGATT=1",5000,DEBUG);
   delay(100); 
   sendData("AT+CGDCONT=1,\"IP\",\"CMNET\"",2000,DEBUG);//setting PDP parameter 
   delay(100); 
   sendData("AT+CGACT=1,1",10000,DEBUG); //Activate PDP, open Internet service
   delay(100);  
   sendData("AT+CIPSTART=\"TCP\",\"www.baidu.com\",80",10000,DEBUG);
   delay(100);
   sendData("AT+CIPSEND=5,\"12345\"",2000,DEBUG); //Send string "12345" 
   delay(100); 
   sendData("AT+CIPCLOSE",2000,DEBUG);     //Close TCP
   delay(100); 
   /*
     sendData("AT+CREG?",3000,DEBUG);     
     sendData("AT+CGATT=1",1000,DEBUG);
     sendData("AT+CGDCONT=1,\"IP\",\"CMNET\"",1000,DEBUG);
     sendData("AT+CGACT=1,1",1000,DEBUG);
     sendData("AT+CIPSTART=\"TCP\",\"google.com\",80",3000,DEBUG);
     sendData("AT+CIPSEND=80",1000,DEBUG);
     sendData("GET http://www.google.com HTTP/1.0\r\n",100,DEBUG);
     */
}

void SendTextMessage()
{ 
  sendData("",2000,DEBUG);
  sendData("AT+CMGF=1",2000,DEBUG);//Because we want to send the SMS in text mode
  delay(100);
  sendData("AT+CMGS="+target_phone,2000,DEBUG);//send sms message, be careful need to add a country code before the cellphone number
  delay(100);
  sendData("GSM test message!",2000,DEBUG);//the content of the message
  delay(100);
  Serial1.println((char)26);//the ASCII code of the ctrl+z is 26
  delay(100);
}

void DialVoiceCall()
{
   sendData("AT+SNFS=0",5000,DEBUG);
   delay(100);
   sendData("ATD"+target_phone,5000,DEBUG);// "ATD+86137xxxxxxxx"dial the number
   delay(100);
}


String sendData(String command, const int timeout, boolean debug)
{
    String response = "";    
    Serial1.println(command); 
    long int time = millis();
    while( (time+timeout) > millis())
    {
      while(Serial1.available())
      {       
        char c = Serial1.read(); 
        response+=c;
      }  
    }    
    if(debug)
    {
      Serial.print(response);
    }    
    return response;
}

void httpRec(const int timeout){
    String response = "";    
    long int time = millis();
    while( (time+timeout) > millis())
    {
      while(Serial1.available())
      {       
        char c = Serial1.read(); 
        response+=c;
      }  
    }    
    Serial.print(response); 
}


After you complete download the code, open the Serial monitor, you will see some information as bellow:

Choose the Board.png 32U4 with A7 test.png

Resource

Personal tools
Namespaces

Variants
Actions
Elecrow Store
Navigation
Elecrow Products
Toolbox