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.
- Blue pill – 1
- ST-Link Debugger – 1
- FTDI – 1
- Breadboard – 1
- Jumper wires
GSM module is connected to USART1 and FTDI is connected to USART2.
Let’s see how to create code using stm32cubemx.
Run stmcubemx software create a new project. Now enter STM32F103C8 in search space.
In SYS, select serial wire in Debug.
In RCC, Select Crystal/Ceramic Resonator in both HSE and LSE.
In UART1, select Asynchronous in mode and change baud rate to 9600 in Parameters Settings.
In UART1, check USART1 global interrupt in the NVIC interrupt table.
In UART2, select Asynchronous in mode and change baud rate to 9600 in Parameters settings.
In Clock Configuration, change with 72MHz in HCLK.
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.