Hi! I have problem connecting SIM900a to arduino via RS232 the connections are OK but the testing is not happening. So, can anybody provide me code which work for SIM900 a.
nyukin:
I had this problem. Curiously if I turned the shield off my serial monitor showed NORMAL POWER DOWN which nobody mentioned, but that probably doesn't matter. I just found the fix. (and it doesn't require a Teensy) I have a Linksprite shield that I've been using pins 7 and 8 for software serial on, so if you're using pins 2 and 3 make sure to change it back from my code. Here's how I got it to stop outputting Ý Ý Ý Ý Ý Ý://Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART
#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8);
void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
mySerial.println("AT+IPR=19200"); // Tell the SIM900 not to autobaud
}
void loop()
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
I can now open the serial monitor and issue AT commands and the SIM900 module responds the way I would expect. (Saying OK to certain commands, taking input for commands like sending an SMS, etc.) A new issue I found is that I don't know how to send Control + Z from the Arduino Serial Monitor. To work around this, I opened Terminal on my Mac and established the same type of connection there:~ $ screen /dev/tty.usbmodem1421 19200
From that I can send ASCII code 26 (Control + Z) and I successfully sent an SMS by typing in each AT command needed to do so. I've been following the excellent tutorial at http://tronixstuff.com/2013/09/18/tutorial-arduino-sim900-gsm-modules/ but now I can do much more because I can just type things into Terminal. Hope this helps somebody!
Hello,
I am facing the same issue as you did. I get junk characters that range from chinese symbols to ones that look like the pound symbol. I have a arduino board connected to the SIM900 module and I am using the Serial Monitor to see the results.
As far as I can see, when I set it at 19200 baud rate, I get a set of junk characters, but while its set at 9600, I get an entirely different set of junk letters. I can assure you that the GSM board is working perfectly fine since its blinking as well as I can call it.
I have set the baud rate at the Control panel level, the arduino level, the gsm level as well as the serial monitor level.
Connections: GSM Tx - Pin 7 Arduino | GSM Rx - Pin 8 Arduino | GSM GND to Ardunio GND
Any help?
mhmdtanveer:
Hello,I am facing the same issue as you did. I get junk characters that range from chinese symbols to ones that look like the pound symbol. I have a arduino board connected to the SIM900 module and I am using the Serial Monitor to see the results.
As far as I can see, when I set it at 19200 baud rate, I get a set of junk characters, but while its set at 9600, I get an entirely different set of junk letters. I can assure you that the GSM board is working perfectly fine since its blinking as well as I can call it.
I have set the baud rate at the Control panel level, the arduino level, the gsm level as well as the serial monitor level.
Connections: GSM Tx - Pin 7 Arduino | GSM Rx - Pin 8 Arduino | GSM GND to Ardunio GND
Any help?
i'm having same issues here.. but my problem is bit different because my module shows mixed characters, some of which are what i sent and others are unrecognizable.
its been a week now that i'm trying to solve the issue. but nothing goes right.
jgalaxy:
The Ý Ý Ý Ý Ý Ý is due to a communication error related to auto-bauding. Nothing other than typing "AT" or "At" will result in synching up with the Shield. I am glad yours works. For those having the issue described above need only follow as defined.hello, I have the same problem. You found the solution to this problem? sorry for my English I speak Spanish.
i tried to do the solution listed. for once it worked fine but only displayed half of the message also in the beginning it still showed those chinese characters. after that one time, the things it showed fine,, were also converted to some junk . someone please help me with this.
Hi, I'm having same problem here but with Arduino Pro Mini 3.3v 8Mhz. I only receive junk characters too. ![]()
By making the following connection it works but using a Usb FTDI (or TTL) to PC:
FTDI RX to SIM800L TX
FTDI TX to SIM800L RX
FTDI GND to SIM800L GND
SIM800L VCC to 4.2v Battery
Just use any Serial app and you're ready to go, default baud speed is 115200.
If you send "AT" command, "OK" is received with no problems.
So I've figured out:
_ SIM800L module is working ok.
_ It's not a powering issue, 4.2v battery is fine.
_ It's not speed mismatch (115200 is ok)
_ What we receive is not Chinese, but unrecognized characters.
I'm almost certain that the problem is with Logic Level Tolerance.
The datasheet of the module states it's 2.8v level RXD and TXD so we need to care of level shifting to the needed 2.8v IO.
I don't have any diodes, but i've made many attemps with resistors to pull up and pull down the signals, with no luck yet (not very skilled with electrical issues).
There is a solution that might work right straightforward for 5volts here:
http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-in-slave-mode/
For 3.3v pro mini arduino will keep trying.
Also remember that the module and arduino are powered with different power supplies, so, you need one more wire, a ground-to-ground connection. And never connect the module to 5v otherwise you'll fry it.
Hey all,
I found the solution to that yyyyyyy problem. I think you have been powering your GSM module with the arduino board. Try powering it with an external power supply and the yyyyyyy will go. In my case I used sim900 and faced the same problem. But now it is solved.
Can someone help me? [Sure - code tags added my moderator] This is my code.
#include <LiquidCrystal.h>
#include "SIM900.h"
#include "sms.h"
#include <SoftwareSerial.h>
//#include <sms.h>
#include <PString.h>
SMSGSM sms;
boolean started = false;
char buffer[160];
char smsbuffer[160];
char n[20];
//LiquidCrystal lcd(4,2,3,7,8,9);
int buttonState;
int lastButtonState = LOW;
long lastDebounceTime = 0;
long debounceDelay = 50;
boolean st = false;
int buzzer = 12;
void setup() {
//lcd.begin(16, 2);
Serial.begin(9600);
if (gsm.begin(2400))
{
started = true;
}
if (started)
{
delsms();
}
sms.SendSMS("+60142646978" , "Gas Sensor and GSM module activated");
}
void loop() {
//lcd.setCursor(0, 0);
//lcd.print("Detektor Gas SMS");
int val = analogRead(A0);
val = map(val, 0, 1023, 0, 100);
//lcd.setCursor(0,1);
//lcd.print("Kadar: ");
//lcd.print(val);
//lcd.print("% ");
//code using sensor detection
if (val > 10) {
tone(buzzer,800,500);
delay(1000);
st = true;
}
else st = false;
if (st != lastButtonState) {
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
if (st != buttonState) {
buttonState = st;
if (buttonState == HIGH) {
PString str(buffer, sizeof(buffer));
str.begin();
str.print("Gas Detected! Gas leakage at ");
str.print(val);
str.print("%");
//String a=str;
sms.SendSMS("+60142646978", buffer);
}
}
}
//code using sms lapor.
lastButtonState = st;
int pos = 0;
if (started)
{
pos = sms.IsSMSPresent(SMS_ALL);
if (pos)
{
sms.GetSMS(pos, n, smsbuffer, 100);
delay(2000);
if (!strcmp(smsbuffer, "lapor"))
{
PString str(buffer, sizeof(buffer));
str.begin();
str.print("Rate of gas leakage currently at ");
str.print(val);
str.print("%");
//String a=str;
sms.SendSMS("+60142646978", buffer);
}
delsms();
}
}
}
//delete sms yang dihantar
void delsms()
{
for (int i = 0; i < 10; i++)
{
int pos = sms.IsSMSPresent(SMS_ALL);
if (pos != 0)
{
if (sms.DeleteSMS(pos) == 1) {} else {}
}
}
}
I'm using arduino uno, sim900 module, mq2 gas sensor and buzzer to create a gas sensor detector based on sms.
I have to 2 option :
- The mq2 gas sensor detects and send the result via sms to the number set in the code.
- We can send a specific string to know the surrounding gas percentage and send the result to the specific number set in the code.
But I want to change the second option to be auto reply to any incoming number. What should I do?
I had the exactly same problem. I realized hat i just forgot to connect the GND. All done now!!