ch340 and sim800l read sms problem

Hello,

I'm trying to find solution for my problem almost 2 days.
I have ch340 and sim800l. My idea is simple - want to turn on and off LED with sms message.
But, I have problem with reading sms. Last night I tryed many, many solutions and once receive SMS text on Serial Monitor, but aftet that I tryed many things without success.

Here is code:

#include <SoftwareSerial.h>

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);
  
  //Begin serial communication with Arduino and SIM800L
  mySerial.begin(9600);

  Serial.println("Initializing...");
  delay(1000);

  mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
  updateSerial();
  mySerial.println("AT+CSQ"); //Signal quality test, value range is 0-31 , 31 is the best
  updateSerial();
  mySerial.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged
  updateSerial();
  mySerial.println("AT+CREG?"); //Check whether it has registered in the network
  updateSerial();
  mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
  updateSerial();
  mySerial.println("AT+CNMI=1,2,0,0,0"); // Decides how newly arrived SMS messages should be handled
  updateSerial();
}

void loop()
{
  updateSerial();
}

void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(mySerial.available()) 
  {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
  }
}

On attached picture you can see output on serial monitor.
It looks signal is good, it is registered on home network, etc.
But when I send sms - LED on sim800l module just blinks few times fast and there is no sms on SM.
Any Solution? Thanks.

SMoutput.jpg

Good try on your first post, but you need to place the code inside of code tags [code][/code] instead of inside quote tags [quote][/quote].

There is nothing in your code to send a message. Please provide that code.

@cattledog

Thank you. Yes, it is my first post on this forum, but before I decide to ask here for help I try everything from internet and my 'custom ideas'.

There is no code for sending a message bcoz module will just receive sms/instructions from my phone or any other. So, I want just to read a message.

There is no code for sending a message bcoz module will just receive sms/instructions from my phone or any other. So, I want just to read a message.

Sorry. I misunderstood your issue.

Your code looks correct for receiving a message and appears to follow this tutorial

Last night I tryed many, many solutions and once receive SMS text on Serial Monitor, but aftet that I tryed many things without success.

Does this mean that last night you did see a +CMT incoming sms message? Were you using the code you posted today?

Yes, that is right tutorial. There is many same or verry similiar variations on internet.
Yes, I saw sms message last night, but not sure I used the 100% same code. As I told you, I tryed so many solutions... :slight_smile:

Maybe I have right trace/track now...
When I connect sim800l module directly on 5v, it works fine and show me result in serial monitor as from picture. But as I told in first post, when I send sms - module start blinking rapidly without sms text on serial monitor. So, after 2 days I get idea what that can be.
AT command "AT+CREG?" show me is module registered on network. I started typeing command every second while sending sms from phone with second hand. And voila! Module lost connection/network every time when it need to receive sms...

I have LM 317 and trying with it to change voltage, but in that case module won't get network...

I am pretty sure now code is OK. Trying to find out how to fix this issue.

I sounds like you have a power issue.

The LM317 may need be able to supply 2A the tutorial says is needed during some transmission bursts, buts not clear what is actually required to receive an sms and not drop from the network due to low power. I have seen reference on the internet to some modules dropping off the network if the voltage drops below 4.0.

When I connect sim800l module directly on 5v, it works fine and show me result in serial monitor as from picture.

The operating voltage of the chip is from 3.4V to 4.4V. Connecting to 5v is a bad idea.

Can you provide details of the module you actually have, and how it is being powered?

It works!
I find some battery from old phone (BL-5CT 1050mAh 3.7V), and I wired it as on the picture:

Just without reset pin, and it WORKS!

Thank you!

Good job working your way through this. +1

I appreciate how as a new poster you managed to correct your initial post to use the code tags and also place your images inline.

Welcome to the forum.