Hardware components

Software apps and online services

Story

Many projects like this involve requiring a WiFi shield, or a Bluetooth Module. However, thanks to Blynk, as that is still possible, it is no longer necessary. This tutorial will explain in depth on how to control your Arduino (simply connected via USB to the computer) from your phone!

Step 1: Configure Blynk

1 / 3

The first thing you will need to do is download Blynk from the App Store or Google Play store on a mobile device. When you open the app, you will be prompted to make an account. Do it! Make sure you sign up with an email you can easily access.

Then, once you do that, it's time to make your first project. Click on the new project. Give the project a name, and select the board you are using. Then, click the 'Email' button so that authorization code is emailed to you. You will need it later!

Now that you have a blank project, click anywhere on the screen so you see a menu on the side. Select a button, and then tap it and enter the settings as shown in the third picture. This will give it a name (so it's user interface is more friendly), and then sets the pin it will control to D13.

This is all you need to do on the phone! Pretty easy, right? Let's move on!

Step 2: Install the Blynk Library

1 / 2

Now, we will need to install the Blynk Library in the Arduino IDE. To do this, go to:

Sketch > Include Library > Manage Libraries

Then, all you need to do is search 'Blynk' and then Install the latest version.

Step 3: Arduino Code

Now, go to File > Examples > Blynk > Boards_USB_Serial > Arduino_Serial_USB. Check your email for the auth token you sent yourself earlier, and copy and paste it like so:

Before:

char auth[] = "YourAuthToken";

After:

char auth[] = "t1h2i3s4i5s6a7n8e9x0a1m2p3l4e";

Make sure to keep the "" marks. Once you did that, upload the sketch to the Arduino! We are almost done!

Step 4: LX Terminal

Now for the last step! All you have to do is entering the following to your LXTerminal. *** MAC / LINUX ***

1. Create a path to the folder with 'blynk-ser.sh' in it using the cd ./ command. Example:

cd ./Documents/Arduino/libraries/Blynk/scripts

2. Enter the following command:

bash ./blynk-ser.sh

3. Many different things could happen at this step, especially if you are doing this for the first time. Skip around to see what case you got.

3a

"This script uses socat utility, but could not find it"

If you get this error, you need to enter the following:

sudo port install socat

and follow along with the terminal. However, you might need to install MacPorts first.

Now, open up the Blynk app again, and hit the triangle button in the top right corner. After that, click and hold down on the button, and the LED on the board should turn on! To see this better, attach the positive end of an LED to pin 13, and the negative to GND right next to it.

For information, go to the Blynk Forum to post a question I didn't/couldn't answer! The Docs Page has a lot of good information as well to expand your projects into bigger, greater things!