Good evening all,
i try to connect an arduino nano to a GSM/SIM module.
The project is to recieve a sms and check it with the arduino, to start a 12v motor.
Below the code that i use:
#include <SoftwareSerial.h>
#define PIN_TX 8
#define PIN_RX 9
SoftwareSerial mySerial(PIN_TX, PIN_RX);
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
delay (1000);
Serial.println("Initializing...");
// Once the handshake test is successful, it will back to OK
mySerial.println("AT");
updateSerial();
// Configuring TEXT mode
mySerial.println("AT+CMGF=1");
updateSerial();
// Decides how newly arrived SMS messages should be handled
mySerial.println("AT+CNMI=1,2,0,0,0");
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
while (Serial.available()) {
// Forward what Serial received to Software Serial Port
mySerial.write(Serial.read());
}
while(mySerial.available()) {
// Forward what Software Serial received to Serial Port
Serial.write(mySerial.read());
}
}
In the picture are some modules that i have tested, but havent achieved anything with them.
I also have searched for some solutions but fund nothing with my problem.
The problem is, that i get the "Initializing" in the Seriel Monitor but the modules show no response to any AT command. The modules are linked in the mobile network and must get signals. The sim card that i use workes in a mobile phone and i canceld the pin code check at the beginning.
I would really appreciate if someone of you have an link or some addvise for my problem.
It would be much better if You post links to the datasheets of the modules being used.
Schematics are often useful, sometimes necessary in fault finding. How the setup is powered is number one check.
Thanks for your reply.
I only have from the left module in the picture schematics and datasheets.
The link to that one is:
https://www.az-delivery.de/en/products/sim808-gprs-gsm-shield-module
The other ones are two SIM800L and one 900 module
No need for the device schematics. We want the schematics showing the connections for Your project.
Without datasheet You need to be lucky that a helper recognise the device and steps in.
Which ones? All different SIM modules are not operated the same way.
Are you saying that you do not see "OK" after this piece of code?
// Once the handshake test is successful, it will back to OK
mySerial.println("AT");
updateSerial();
Please show a drawing of how you have connected the Rx and Tx connections of the module to the Arduino to verify that they are correct for your code.
#include <SoftwareSerial.h>
#define PIN_TX 8
#define PIN_RX 9
SoftwareSerial mySerial(PIN_TX, PIN_RX);
mySerial.begin(9600);
Why do you think that this is the correct baud rate for the gsm module?
excactly. that is my problem. none of AT commands work.
The Rx and Tx are connected the right way at the arduino. I checked it for safty´s sake with twisted connection.
Because i tested all baud rates from 2400 to 9600, which was ritten in some datasheets for the chips.
I orderd different ones, after the first one, because i wasn´t sure that the first one were "broken" or damaged.
I will drop Your question. Without requested useful facts I've no more replies.
Standard questions…
Project power supply& schematics please.
Power supply is a laboratory power supply which delivers 5V and max. 2,5A
Schematics is Module via Rx and Tx to the pin 8 and 9 from the nano.
the nano is connected to the computer via usb, so that i can try the AT commands in the Seriell Monitor.
#include <SoftwareSerial.h>
#define PIN_TX 8
#define PIN_RX 9
SoftwareSerial mySerial(PIN_TX, PIN_RX);
//SoftwareSerial mySerial(8,9);
Is Module Tx connected to Arduino pin 8 and Module Rx connected to Arduino pin 9? The pin order in the software serial constructor is (rx,tx) and is referenced to the Arduino.
Yes, so i have connected them.
to spesifi this a bit more. i geht some questionmarks etc. back but the "ok" never shows up.
i get some question marks etc. back but the "ok" never shows up
That sounds like a baud rate mismatch.
but i checked the baud rate which was given in the manuals from the chips and that doesn´t change anything.
any ideas what i could try else?
Try reversing Rx and Tx connections, although it certainly sounds like you had them correct.
Possibly try different line endings for the AT command.
Otherwise, I have no ideas.
What do you mean by different line endings? Do you have an example for me pls?
i think i know what you mean, but i have tried that too, with the same results
The manual I find for the SIM808 says that it wants to see <CR><LF> line endings on the commands you send it:
Where you do mySerial.println("AT") I am not 100% sure what line ending println() uses. You could write:
mySerial.print("AT\r\n")
This would explicitly send <CR><LF> in that order.
The notes indicate that to get auto-baud determination to work on the SIM80x, it is recommended to wait a few seconds after the AT -- your code is not waiting before moving ahead with the next command.
All of these modules have to be manually "turned on" with a press on the power button, at which point the indicator LEDs light to to show power on and network connect status. I suppose you're looking out for that?
Is the modem 0V connected to the Arduino 0V ?
A schematic please - not a sentence