Hi everyone, this post is intended to show you how to expand the memory of an SIM800 GSM modem using a micro SD card. It can come in handy in case you need to store some files with large data.
The features of the micro SD card used are
- SONY 16GB high capacity class 10 micro SD
- FAT32 partition.
Make sure the card is properly inserted. Power on the GSM modem after inserting the micro SD card and connect to the computer using a USB to TTL converter.
Now open any hyper terminal device. The one I’m using is putty. Select the serial port and give the baud rate as 9600.
The firmware version of the GSM modem I’m using is 1308B08SIM800M32. You can check your firmware version by giving the AT command AT+GSV.
Ok, now if you are interfacing the SD card for the first time then you have to give the following AT commands.
Now restart the GSM modem by the AT command
Now to check whether the GSM modem has detected the SD card lets check the memory. give the AT command
Now you will get a reply showing the available internal memory and the memory of the micro SD card that has been detected by the GSM modem. If you don’t see the memory of the SD card or if it is shown as 0 bytes then there could be some problem with the setup you are using (it may be with the connection, firmware or SD card type).
We can see from above figure that the SD card is detected by the modem as ‘D’ drive. You can get this name of the drive by giving
The modem replies with the name by which the SD card is mounted.
Now let us list the files in the SD card. Give the command
The modem replies with ERROR. This means there are no files present. Now let us create a file in the SD card. Type
If you list the files now, you can see the file TEST.txt, in the D drive.
Now let us write some data to the file. The format is as follows.
here, there are three arguments. First one is either 0 or 1.
0: if you want the data to begin from the starting position.
1: if you want to append some data to the present data.
The second argument is the size of the data you are going to input. It can be a maximum of 10240, and the third argument is the time window in seconds for inputting the data. After giving the above command a prompt appears where you can type the data to be saved. The prompt closes only if
Important: The prompt closes only if the length given is reached or a timeout occurs. So choose the length and time carefully.
Now to read from the file give the following AT command
Here the first argument is either 0 or 1.
0: read from the beginning
1: read from a particular position
The second argument is the length of the data to be read. If the entered value is larger than the actual length it will be automatically replaced by the actual length. The third argument is for specifying the position from where the data to be read. It is important only if the first argument is 1. But you have to give this argument even if the first argument is zero (only that it is not important).
You can see the difference in the output data when the arguments changed.