SIM900 as RTC with Arduino Mega

Hi,

I have a SIM900 module connected to an Arduino Mega board. I can get the time from the SIM900 using the "AT+CCLK?" command on the serial monitor. The SIM900 has a battery so it keeps time even if powered off. Is there a method to use the RTC from the SIM900 for the Arduino? I have scoured the internet but haven't found a proper solution.

Using that command gives you what you want, you just need to convert it to your desired format. I do not have that module but I assume you are getting a string.

It is. You must first set the gsm module in text mode, then call for "AT+CCLK?". The response can be stored in a string. Then, you must parse the string with year, month, day, hour, minutte, secound to variables. Since you have 2560 mega, avoid using software serial.

Sidenote:I use simcom 7000 myself, it have gps reciver. So once in the day, it get the gps time and set a ds3231 rtc. I minimize sending at commands to my simcom 7000, so it is always ready to recive and send sms messages, performing various tasks.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.