0

I want my Arduino Micro to interact with my SIM 800 L module. But unfortunately nothing happens, may you can help me figure out where I made a mistake. Here's my wiring:

Arudino Board

SIM-Module

Summary of my wiring:

  • External Battery ---> 800L
  • plus ---> 5VIN
  • minus ---> GND (both in POWER and UART TTL-Section)

  • Arduino ---> 800L
  • RX ---> RXD
  • TX ---> TXD

With that setup I'm using the following code:

#include <SoftwareSerial.h>
#include<Arduino.h>

//Arduino Micro
//SIM 800l


SoftwareSerial mySerial(1, 0); // RX, TX 

void setup()  
{
  // Open serial communication
  Serial.begin(9600);

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);

  Serial.println("Setup finished");

}

void loop() // run over and over
{
  Serial.println("Sending AT command");
  mySerial.write("AT"); //OK should be returned
  delay(1000);
  //read sim-module response
  Serial.println("Response: ");
  while( mySerial.available() )
  {
    char c = mySerial.read();
    Serial.print(c);
  }

  mySerial.write("at+cmee=2"); //set sim-module into debug mode

  delay(1000);

  mySerial.write("at+cpin?"); //check if pin is necessary


  //read sim-module response
  while( mySerial.available() )
  {
    char c = mySerial.read();
    Serial.print(c);
  }

}

But it gives me the following output as a loop:

 Sending AT command
 Response:
 Sending AT command
 Response:
 Sending AT command
 Response:

And I've noticed that a yellow LED is blinking on the Arduino while running the program so I assume there has to be some input from the SIM800 but I can't read the data at the moment. On the 800L-board itself is also an LED that blinks in an interval of about one second, wich tells you that it has no connection (I live in a relatively remote area) but even if there's no connection shouldn't it still return OK when sending AT?

If you need any further information feel free to ask. I would appreciate every idea you come up with :)

Edit: On the photo the wire goes from the Arduino directly to the 800L but I've changed it so the 800L-power comes from a battery now.

1 Answer 1

1

Here is some edit in your code

#include <SoftwareSerial.h>
#include<Arduino.h>

//Arduino Micro
//SIM 800l


SoftwareSerial mySerial(9,10); // RX, TX 

void setup()  
{
  // Open serial communication
  Serial.begin(9600);

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);

  Serial.println("Setup finished");

}

void loop() // run over and over
{
  Serial.println("Sending AT command");
  mySerial.write("AT\r\n"); //OK should be returned
  delay(1000);
  //read sim-module response
  Serial.println("Response: ");
  while( mySerial.available() )
  {
    String c = mySerial.readString();
    Serial.println(c);
  }

  mySerial.write("at+cmee=2\r\n"); //set sim-module into debug mode

  delay(1000);

  mySerial.write("at+cpin?\r\n"); //check if pin is necessary


  //read sim-module response
  while( mySerial.available() )
  {
    String c = mySerial.readString();
    Serial.println(c);
  }

}

Change UART pins to 9,10 as 0,1 are already used in normal serial. Secondly change Seria.read() to Serial.readString() because as far as i know the response is string.

3
  • Thank you for your advice but I still get nothing returned. Only the RX led on my arduino is blinking but nothing arrives on tx. I tried mapping rxd to txd, put it to port 9,10 then back to the RX,TX ports but nothing gets me a response :/ Commented Apr 12, 2019 at 11:53
  • sorry I missed on thing. Carriage Return and EOD character are most important part of AT commands. I just see that those are missing.
    – Vaibhav
    Commented Apr 12, 2019 at 12:05
  • Thank you very very much, retrying some wiring positions and the carriage return did the job its woking now :) Commented Apr 12, 2019 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.