Go Down

Topic: Arduino Leonardo - SIM800C - Serial Monitor Problem (Read 82 times) previous topic - next topic

certy

Hello to everyone.

I am trying to send a command and receive an answer using Arduino Leonardo's SIM800C serial monitor. I can send commands to SIM800C, but SIM800C does not respond via serial monitor. What would be the reason?

Code: [Select]

#include <SoftwareSerial.h>

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

const int SIM800C_RST = 9;

void setup() {

   delay(1000);
   digitalWrite(SIM800C_RST,HIGH);
   delay(2000);
   digitalWrite(SIM800C_RST,LOW);
   delay(5000);

   SIM800CCC.begin(9600);
   Serial.begin(9600);
   delay(1000);

   Serial.println("ready");
}

void loop() {

     while(Serial.available()!=0)
     SIM800C.write(SIM800C.read());

     while(SIM800C.available()!=0)
     Serial.write(SIM800C.read());
}

pylon

The Leonardo has the hardware serial interface (pins 0 and 1) available for your use by the Serial1 object. Why do you use that horrible SoftwareSerial emulation instead?

Did you use a level converter? According to the datasheet you must not provide 5V to the UART pins and the device itself has an output voltage of below 3V, so the Leonardo will not see a high enough voltage to register a HIGH state.

Go Up