7600X connect Arduino

From Waveshare Wiki
Jump to: navigation, search

Arduino Demo

Option 1: Use the same serial port for control and printing

1 Mainly make the following adjustments, change the program baud rate to 115200, the original program baud rate is 9600, the default baud rate of SIM7600 is 9600, which does not match.

2 Change the wiring, remove the PWR switch control line, the new version of SIM7600 is powered on by default, this function is not used.
3 Please confirm that the TTL level of Arduino is 3.3V, and the default level of SIM7600 is 3.3V
4 Unable to connect to SIM7600 during download, as the download interface is also the same UART

Hardware Connection

SIM7600X 4G HAT connects to development board UNO PLUS / Arduino UNO:

SIM7600X 4G HAT UNO PLUS / Arduino UNO
5V 5V
GND GND
TXD 0 (RX)
RXD 1 (TX)

SIM7600G-H Arduino.png

Demo code

GPS-Demo More-Demo

Install Arduino library

Download the decompression sample program,
Uno-gps-7600.jpg

File -->Examples -->Waveshare SIM7600X, and then choose to run the corresponding example program:

Sim.png-->

Sample Program

GPS Positioning demo

ARDUINO demo3.png

1 Please confirm that the TTL level of Arduino is 3.3V, and the default level of SIM7600 is 3.3V 2 Please confirm the baud rate. The default baud rate of the program is 9600, and the default baud rate of the SIM7600 is 115200


Option 2: Use hardware serial port printing and virtual serial port AT communication.

Hardware Connection

SIM7600CE-CNSE 4G HAT UNO PLUS / Arduino UNO
5V 5V
GND GND
TXD 0 (RX)
RXD 1 (TX)
7(Simulation of RXD)
8(Simulation of TXD)
C1 7
C2 8

7600-uno-78.png

/*
  Software serial multple serial test

 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.

 The circuit:
 * RX is digital pin 10 (connect to TX of other device)
 * TX is digital pin 11 (connect to RX of other device)

 Note:
 Not all pins on the Mega and Mega 2560 support change interrupts,
 so only the following can be used for RX:
 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

 Not all pins on the Leonardo and Micro support change interrupts,
 so only the following can be used for RX:
 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

 created back in the mists of time
 modified 25 May 2012
 by Tom Igoe
 based on Mikal Hart's example

 This example code is in the public domain.

 */
#include <SoftwareSerial.h>

SoftwareSerial mySerial(7, 8); // RX, TX

void powerUp(){
  digitalWrite(9,HIGH);
  delay(500);
  digitalWrite(9,LOW);
  delay(500);
}
void powerDown(){
  digitalWrite(9,HIGH);
  delay(500);
  digitalWrite(9,LOW);
  delay(500);
}

void send_at(char *p_char){
  char i=0,j=0;
  char r_buf[100];
  
  Serial.println(p_char);
  delay(200);
  i = Serial.available();
  for(j=0;j<i;j++){
    r_buf[j]= Serial.read();
  }
  r_buf[j]=0;
  mySerial.println(r_buf);  
  
}

void setup() {
  pinMode(9,OUTPUT);
  digitalWrite(9,LOW);
  delay(200);
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // set the data rate for the SoftwareSerial port
  mySerial.begin(115200);
  mySerial.println("*                               *");
  mySerial.println("        www.waveshare.com        ");
  mySerial.println("*                               *");
  mySerial.println("This is the PING test of SIM7600X");
  mySerial.println("*                               *");  
} 

void loop() { // run over and over
 powerUp();
 mySerial.println("*   wait 15 seconds for signal   *");  
 delay(500);
 send_at("AT"); 
 send_at("AT+CSQ"); 
 send_at("AT+CGREG?");
 powerDown();
 delay(500);
}
 Answer:
If communication is abnormal, please reduce all baud rates; 4800bps is recommended. The command to configure SIM7600 to 4800 is:
 AT+IPERX=4800
{{{4}}}

{{{5}}}