How to send SMS with GSM (SIM800) using STM32F1(Bluepill) in Keil IDE

Introduction:

Hi, in this article we will see how to send SMS with SIM800 GSM module using blue pill microcontroller in Keil IDE. SIM800 is a quad-band module 850/900/1800/1900MHz and this module support USART Communication.

Requirements:

  • Blue pill – 1
  • ST-Link Debugger – 1
  • FTDI – 1
  • Breadboard – 1
  • Jumper wires

Schematic Diagram:

GSM module is connected to USART1 and FTDI is connected to USART2.

Code:

Let’s see how to create code using stm32cubemx.

Step1:

Run stmcubemx software create a new project. Now enter STM32F103C8 in search space.

Step 2:

In SYS, select serial wire in Debug.

Step 3:

In RCC, Select Crystal/Ceramic Resonator in both HSE and LSE.

Step 4:

In UART1, select Asynchronous in mode and change baud rate to 9600 in Parameters Settings.

Step 5:

In UART1, check USART1 global interrupt in the NVIC interrupt table.

Step 6:

In UART2, select Asynchronous in mode and change baud rate to 9600 in Parameters settings.

Step 7:

In Clock Configuration, change with 72MHz in HCLK.

Step 8:

In Project Manager, Enter the project name and location where want to save. Click on Generate Code.

Now, open source code in Keil IDE. Alternatively, You can skip these steps and directly download code.

Note: In code change the mobile number to which number you want to send the message.

Make connections as per schematic and load the code to the microcontroller and see the output in serial with FTDI connected to UART2 of the microcontroller.

Output:

You may also like...

2 Responses

  1. As I web site possessor I believe the content matter here is rattling great , appreciate it for your efforts. You should keep it up forever! Good Luck.

  2. Hairstyles says:

    Hi I am so happy I found your blog page, I really found you by accident, while I was searching on Google for something else, Anyways I am here now and would just like to say many thanks for a incredible post and a all round enjoyable blog (I also love the theme/design), I don抰 have time to look over it all at the minute but I have bookmarked it and also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the great work.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: