I am trying to get Arduino nano and SIM800L module working together. I provided the module with the recommended external voltage of 4.0V (documentation states 3.6V - 4.2V) transformed via LM2596. The original source is 5V 3A.
LED on SIM800L blink once a second as stated in documentation when in an unconnected state.
The schema is the following:
Antena
\_/
|
Arduino SIM800L | External 4.0V
NET ---/
VCC ----- +4.0V
D2 --------- RST
D3 --------- RX
D4 --------- TX
GND ----- GND
I have already tried 3 different libraries for AT communication and also sending raw AT commands using writing to serial manually. I also tried another SIM800L module because I thought the module is faulty.
Here is the dump from serial communication:
[551135] ### TinyGSM Version: 0.10.9
[551139] ### TinyGSM Compiled Module: TinyGsmClientSIM800
AT
��AT
�AT
H�j���[552012] ### Unhandled: Hj
AT
AT-���[552317] ### Unhandled: AT-
AT
��AT
��AT
�Z5
[553228] ### Unhandled: Z5
AT
␚)O���[553532] ### Unhandled: ␚)O
AT
AT���[553836] ### Unhandled: AT
AT
��AT
��AT
�)OK��[554748] ### Unhandled: )OK
AT
���[555053] ### Unhandled: 5
AT
���AT
��AT
��AT
�j�H�[556266] ### Unhandled: jH
AT
CC����[556570] ### Unhandled: CC
AT
AT���[556875] ### Unhandled: AT
AT
��AT
AT
���[557787] ### Unhandled: T
AT
�H����[558091] ### Unhandled: H
AT
AT���[558395] ### Unhandled: AT
AT
��AT
��AT
AT
jRO���[559610] ### Unhandled: jRO
AT
AT���[559915] ### Unhandled: AT
AT
��AT
��AT
AT
�
OK��[561128] ### Unhandled: OK
Failed to initialize SIM800L
As you can see the module is trying to negotiate the baudrate. By default, I use speed 9600 as stated in the documentation. When I use a different baudrate the module does not respond at all.
It seems the module replies and sometimes even correctly. Response to AT
command should be OK
.
Do you know how do I successfully negotiate the speed and establish reliable serial communication with the module? Do I miss any electrical components in my circuit like a capacitor or resistor? I tried to use capacitor 35V / 3300µF but without any difference. I think my power source is strong enough.
The source code is the following:
#define PIN_GSM_RST 2
#define PIN_GSM_TX 3
#define PIN_GSM_RX 4
#define GSM_BAUDRATE 9600
#define TINY_GSM_MODEM_SIM800
#define TINY_GSM_DEBUG Serial
#define TINY_GSM_USE_GPRS true
#define TINY_GSM_USE_WIFI false
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <TinyGsmClient.h>
#include <StreamDebugger.h>
SoftwareSerial serial_SIM800L(PIN_GSM_RX, PIN_GSM_TX);
StreamDebugger debugger(serial_SIM800L, Serial);
TinyGsm modem(debugger);
TinyGsmClient client(modem);
void setup() {
Serial.begin(9600);
delay(1000);
Serial.println(F("Serial initialized"));
serial_SIM800L.begin(GSM_BAUDRATE);
delay(5000);
while (!modem.init()) {
Serial.println("Failed to initialize SIM800L");
}
}
void loop() {
//
}