For fast transaction call 0916.457.0748

SIM800L and Raspberry Pi 3 B Controlled 3 LED -- Tutorial


Raspberry Pi is a series of credit card-sized single-board computer while SIM800L is available for GPRS and SMS message data remote transmission. Combining both of them we would be able to control different devices via GPRS data communication or Text messaging. 

In this tutorial we will be using SIM800L SMS message data remote transmission mode to control three LED. We will be covering also how to setup serial communication for raspberry pi.

Hardware Required:

Configuring the GPIO Serial Port On

The first thing you’ll need to do is to ensure all software components are up-to-date.

Update the repository and upgrade the installed packages:

pi@raspberrypi:~ $ sudo apt-get update && sudo apt-get upgrade -y

Update the firmware:

pi@raspberrypi:~ $ sudo rpi-update

Reboot to apply changes:

pi@raspberrypi:~ $ sudo reboot

Enable UART

Raspberry Pi 3 compared to previous Raspberry pi behaves differently with regards to the UART interface on the GPIO header, that's why we need to enable it first.

Enabling UART with minimum core frequency:

pi@raspberrypi:~ $ sudo nano /boot/config.txt

Add this line to the bottom

# Enable UART

Disable Console

In case you would like to connect a HAT using the UART interface, it’s recommended to disable the console.

To disable the console, edit the following file as follows:

pi@raspberrypi:~ $ sudo nano /boot/cmdline.txt 

you will see something like:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

remove the line: console=serial0,115200 and save.

 Reboot to apply changes:

pi@raspberrypi:~ $ sudo reboot

Circuit Connection:

  • SIM800L ------ Rasp GPIO
  • Vcc ------- 5V
  • Gnd ------ Gnd
  • Rx ------- Tx
  • Tx ------- Rx
  • LED1 --- GPIO 23
  • LED2 --- GPIO 24
  • LED3 ---- GPIO 25


The code focuses more on receiving messages, but it can be modify depending on the usage.


  • Hector

    Hello, very good tutorial. The GSM module have a 3.7-4.4 V input. There are no problems if you connect the module direct to the 5V raspberry Pin ?

  • sadewa

    very nice info, i have some problem with this in send sms via raspberryPi..
    how i solve this.. because first, i don’t know where i put the code.., second, i don’t know the code for sms in raspberry pi

    Please Help..

Leave a comment

Please note, comments must be approved before they are published

Payment Methods

Facebook Rewards Program