Hey Everyone,
I’m working on sending and receiving texts on SIM300 interfacing it with an arduino uno.The sending bit and the subsequent display on an LCD screen has been performed sucessfully.However,I’m facing issues with the receiving bit while communicating with the GSM modem using an arduino. Meaning,I’m able to read the received texts by typing in AT commands on the hyperTermminal window but not so on the serial monitor.On the serial monitor i see a meaningless display of numbers and symbols.
My code and screen shots of my serial monitor window for receiving sms onto the SIM300 are enclosed here.
My objective is: Whenever a SMS is sent to the SIM300 GSM module, that message should be displayed on the LCD using Arduino. I am using Arduino Leonardo. But I am unable to code it properly. So I am in great need of your help and as you said, you have got the output for this, so can you post the code here ASAP?
Was the SIM300 module purchased at RobotShop? Can you tell us the part number so that we can look up the specifications to be able to answer your questions more precisely?
I suspect that you might need to add a delay after the line “mySerial.write(10);” so that the GSM module has time to process the commands and return its response: I would start with a delay of 1000 ms and then reduce it to a smaller number through experimentation.
Without the delay, the Arduino might be looping and sending new commands to the GSM module before it had time to respond to the first.
Also, we noticed that you might mean ‘\n’ instead of ‘/n’ in your IF conditions, however doing a println of incomingByte when it is a newline character (\n) will result in two lines being printed. Not sure if that’s what you intend.
Hello,Mr.Arcand,
I introduced a delay but it doesn’t seem to have made any difference to the output. As,in,i still see quite a lot of unrecognisable symbols in the sms content.Thanks for pointing out the redundant “\n” and println. Sender’s name and number is displayed correctly,but the content of the text message is still a mix of numbers and weird looking symbols.
Do you think i might have to flush out the serial buffer (namely,9 and 10 in my code),if so,Serial.flush() doesn’t work on arduino anymore and is giving me compile time errors.
Any other suggestions which might help me?
Moreover,i was wondering if i could use the receive sms code on the GSM library(in arduino) on a module that isn’t the arduino GSM shield(and is the SIM300).What are the physical connections to do so,if that is possible?