Get Start with Blynk

You will learn how to use Blynk in this project.

In the event that you trigger widgets on Blynk, your Raspberry Pi will print out their values.

Follow the steps below, and note that you must do them in order and not skip any chapters.

1. Configuring the Blynk

  1. Go to the BLYNK and click START FREE.

  2. Fill in your email address to register an account.

  3. Go to your email address to complete your account registration.

  4. Afterwards, Blynk Tour will appear and you can read it to learn the basic information about the Blynk.

  5. Next we need to create a template and device, click Cancel.

  6. Go to Template from the navigation bar.

  7. Create New Template

  8. Fill in NAME, feel free to do so; HARDWARE should be Raspberry Pi. Then Done.

  9. You will be redirected to the Info page, just click on save in the top right corner.

  10. Go to Search page from the navigation bar.

  11. Create New Device.

  12. From template.

  13. Select TEMPLATE as the one you just set, DEVICE NAME can be customized. Then click Create.

  14. You should now see a page like this one, which means that your initial Blynk setup is complete.


2. Edit Dashboard

  1. Click on the menu icon in the upper right corner and select edit dashboard.

  2. Then drag any CONTROL Widgets you want onto the Dashboard. I dragged a Switch and a Slider.

  3. Tap the setting icon on the widget.

  4. Create Datastream, select Virtual Pin。

  5. Complete the datastream setup. Here is the datastream created for Switch, so DATA TYPE select Interger, MIN and MAX set to 0 and 1. Create and then Save.

  6. Use the same steps to create a Datastream for the slider widget, and again, modify DATA TYPE, MIN and MAX to what you need.

  7. When finished, click Save And Apply at the top right.


3. Install the Blynk library

Run the following command to install.

cd /home/pi
git clone
cd blynk-library-python
sudo python3

4. Download the Example

We have provided some examples, please run the following command to download them.

cd /home/pi
git clone

5. Run the Code

  1. Go to Blynk’s Device Info page, you will see some information under FIRMWARE CONFIGURATION, you need to copy BLYNK_AUTH_TOKEN down.

  2. Edit the code.

cd /home/pi/blynk-raspberrypi-python
sudo nano
  1. Find the line below and past your BLYNK_AUTH_TOKEN.

BLYNK_AUTH = 'YourAuthToken'
  1. Run the code.

sudo python3
  1. Go to Blynk, and operate the widget on Dashboard.

  2. Now you will be able to see your actions on the terminal.

   ___  __          __
  / _ )/ /_ _____  / /__
 / _  / / // / _ \/  '_/
/____/_/\_, /_//_/_/\_\
        /___/ for Python v1.0.0 (linux)

Connecting to
Blynk ready. Ping: 142 ms
V0 value: ['1']
V0 value: ['0']
V1 value: ['3']
V1 value: ['8']
V0 value: ['1']