Introduction: Lightweight Arduino GSM Mobile Phone.
In this instructable I will introduce you my Lightweight Arduino GSM Mobile phone. The lightweight mobile is capable of the following National/International features:
- Make Calls.
- Receive Calls.
- Send SMS.
- Receive SMS.
In this project, I used the GSM SIM900A module to connect to the mobile network. It is an adorable all-in-one cellular module that lets you add voice, SMS and data to your projects. It works on frequencies 900/1800MHz and comes with the friendly RS232 which can be easily interfaced with any MCUs, the baud rate is adjustable from 9600 – 115200 through AT Commands.
I also used a display to visualize GUI interfaces, I selected an LCD touch display by Nextion, trust me it is really an awesome display. Nextion adopts a new and easy way to interface any of your projects through UART. Its easy-to-use configuration software (Nextion Editor) allows you to design your own interfaces using GUI commands and makes the pieces of your development effortless, in turn you can save lots of program space in your MCUs. Thanks to Nextion!!..
On its own, the GSM module and the Nextion touch display can’t do anything. It requires a microcontroller to drive it. At the heart is an Arduino Uno to drive the lightweight GSM Mobile phone, which can send and receive commands over its RX/TX pins.
If you are interested making yours, this guide will show you how to build and upload the source codes to get your project up and running. This is a fairly straightforward project, but an intermediate one especially when you take into account the complexity of the codes.
This project is also a great example of how to use arduino especially for string & character handling, as well as for you to get acquainted with the new Nextion TFT Intelligent LCD Touch Display and using AT commands for the GSM module. Hope you will enjoy and find my post interesting. Now let us make it.
Step 1: Part Required:
Here’s the needed parts for this example.
- Arduino Uno.
- SIM900A GSM module.
- Nextion TFT Intelligent LCD Touch display.
- SIM Card.
- Connecting Wires.
There’s also some optional accessories.
- External Mic & Speaker.
Step 2: Wiring:
Connect the GSM module and the Nextion Display to your Arduino by following the appropriate steps below.
- Nextion +5V to Arduino VDD_5v.
- Nextion RX to Arduino pin_11.
- Nextion Tx to Arduino pin_10.
- Nextion GND to Arduino GND_0v.
- GSM Rx to Arduino pin_1.
- GSM TX to Arduino pin_0.
- GSM GND to Arduino GND_0v.
NOTE: if your SIM card is locked with a PIN code. You can either disable the PIN or enter the PIN via the ‘AT+CPIN’ command just before you can connect the network. Example: “AT+CPIN=1234”.
Step 3: Setup:
Next, I will show you how to prepare the .HMI (Human Machine Interface) for the Nextion display, without forgetting the Arduino sketch.
- Nextion Editor.
- Arduino IDE.
Program the Nextion display:
To make Nextion display the interfaces, the first thing to do is to design an HMI file in the Nextion Editor. This editor allow you to design your interfaces using plug-and-play components like (Text, button, progress bar, pictures, gauge, checkbox, radiobox and much more), for which you can set codes & properties for each of these components.
In this project, I used 8 pages to make the interactive GUI. Most of the icons which I used for the implementation are the freely available Android Icons and can be downloaded from this [link]. I used paint.net (Open Source editor) to edit/resize all the pictures and to create the invert of the icons, to give the feeling of touch when components like buttons are pressed. Touch events like (Press & Release) are also included when components are touched. If you are interested to acquire more about Nextion Instruction Set you can visit the wiki page here.
Programming the Nextion display is just as easy as abc but a time consuming process especially when implementing complex features like numpad & keyboards. However, I wish to mention that at the end you will really enjoy the outcomes, the end results are enormously awesome like above pictures.
- Load the .HMI file into the editor. Scroll down to find my GitHub repository section of this page.
- Compile the .HMI file (just under the menu bar).
- Go to file > Open build folder > copy the .tft file > paste into SD card.
- Note: make sure the SD card is formatted to FAT32.
- Once copied, insert the SD card into the Nextion and then power_on.
- Wait for the .tft to upload.
- Power_off the Nextion, securely remove the SD card and then again power_on.
- Voila!, you should see your new interfaces on the Nextion Display.
Nexiton also provide a handy simulator to test/debug the .HMI files well beforehand you connect your display to your MCUs. The “Instruction Input Area”, allows you to insert commands such as change page, hide/show picture, enable/disable button, enable/disable/insert text & much more to the Nextion display. On the other side, the “Simulator Return Data” gives you the responses from touch events when components on the Nextion display are pressed or even for the commands triggered to the Nextion.
Step 4: Program the Arduino:
The Ardiuno Uno is the brain of the whole mobile system, the Arduino acts as a middleware which interfaces the GSM Module and the Nextion display.
For this project, I did not used any Nextion libraries, as it seems difficult to understand and lack documentations and also my skectches does not compiled when using Nextion libraries, hope to get improvements soon. As such, I decided to move on without the use of libraries, seems to be difficult right? Believe me it’s not.
To get the complete code, simply scroll down to find my GitHub repository section of this page. Copy the code, and paste it into a new sketch in the Arduino IDE. Save it, upload it to your Arduino.
That’s all for the software part!! Compile the code. If there are no errors, congratulations your devices is now configured to automatically connect to the cellular Network through the GSM module. Open the Serial monitor, you should see the AT command logs for each events triggered from the Nextion Display.
Step 5: Source Codes:
You can download the complete code of this project from my GitHub by clicking this link.
Step 6: Demo:
Step 7: BONUS:
By default, the GSM module has an SMS buffer size of 20. Unfortunately, we cannot display all the 20 SMS at once on the Nextion display, getting buffer overflow while compiling Nextion code. As such, I have programmed the Nextion display in such a way to present only 10 SMS.
If 10 or more SMS are present on the GSM buffer, the Low memory warning icon will be displayed on the Nextion display, warning you to delete previous SMS to view the new SMS in an incremental way.
I hope you like my post and hope this tutorial helps you find a way to implement your own Arduino GSM Mobile and yes please share any of your innovations.
Have Fun.. Cheerz… Thanks for reading and sharing.
Participated in the
Internet of Things Contest 2017
12 months ago
Hi mister The project is really great I'm trying to reproduce it for a school project but I can't receive the call and the SMS but I send a call and SMS I use a sim900 and a smart nextion 5''. thank you for your reply
4 years ago
hi friend i have just gone through your project can we like add whatsapp application to it and a sd card module to store the messages as well as video and other application
but i would only like to implement Whatsapp application in it is it possible
Question 5 years ago
Hi friend, I have the GSM module that has several TX RX commands.
I would like to know, the TX RX communication, takes place on the GSM module via the RS232 port?
Answer 4 years ago
Can you please tell me which GSM module you are using?.
5 years ago
sir in the code it shows two errors saying memory overflow in page 2 and 3 what to do
Reply 5 years ago
Thanks for your like on this post. Can you tell me which Nextion display you are using?. Basically you can free memory by decreasing the number of text on Page 3 and Page 4. Simply click on each of the buttons and decrease the size. Note this is a repetitive process for each buttons on page 3 and 4.
Let me know the outcomes.
5 years ago
Wow man really thanks
a lot helped :)
Reply 5 years ago
6 years ago
Great project! I forgot about the GSM shield I had sitting in my parts box. I recall why I never used it much - I had problems finding a SIM card that would work with arduino's and the GSM shield.
Would you please share one more bit with us? What brand sim do you use?
Thanks for sharing your project!
Reply 6 years ago
thanks for watching.
The sim I used in this project is actually a Nano SIM which supports (LTE, 3G, 2G) and my Mobile Operator is Emtel.
Note: The SIM card slot in the GSM module accepts only Normal SIM, as such, I used a "SIM card Multi-Adaptor" to turn the Nano SIM into a Normal SIM, refer to below image.
You can select any SIM card from your favorite Mobile Operator available in your region, no matter if it is a prepaid or postpaid, both should actually work.
Additionally, you need to confirm with your Mobile Service Provider if they support GSM(2g) network, if you reside in country other than USA then by default its YES.
Thanks & Enjoy :-)
6 years ago
There is no Arduino file (.ino) in your GitHub collection.
Reply 6 years ago
Hello grayl, thank you. you can use "lightweight arduino gsm mobile.h". Open it with any of your favorite editor, copy & paste the codes. Enjoy.
6 years ago
Reply 6 years ago
Hello Mderton, thank you..