Blynk is an IoT cloud platform which supports many kinds of low cost open-source hardware such as Arduino, ESP8266, Raspberry Pi etc. It makes complex IoT technology simple and easy. Blynk is free for individual developers and this feature makes it the most popular IoT programming learning platform for school students and IoT beginners.
In this Lesson, we will teach students how to install Blynk APP and use this APP to control our 4 DOF robot arm. Actually you understand the principle of this lesson, you can easily use Blynk APP to control 16 or even more DOF robot arm
Blynk is designed for the Internet of Things. It can control hardware remotely, it can display sensor data, it can store data, vizualize it and do many other cool things.
There are three major components in the platform:
Blynk App – allows to you create amazing interfaces for your projects using various widgets we provide.
Blynk Server – responsible for all the communications between the smartphone and hardware. You can use our Blynk Cloud or run your private Blynk server locally. It’s open-source, could easily handle thousands of devices and can even be launched on a Raspberry Pi.
Blynk Libraries – for all the popular hardware platforms – enable communication with the server and process all the incoming and outcoming commands.
Software Requirements:
If you haven’t installed Arduino IDE in your PC, please read following article to install the IDE
https://osoyoo.com/2017/05/08/download-and-install-arduino-ide/
You can click Sketch ->Include Library ->Manager Libraries, then search Blynk install the library file.
If you haven’t installed PCA9685 library, please download it from https://osoyoo.com/driver/wifi-robot-arm/Adafruit-PWM-Servo-Driver-Library-master.zip and Install above zip file in Sketch ->Include Library ->Add .ZIP Library.
If you haven’t installeded v, Please download and Install BlynkESP8266_Lib library from:
https://osoyoo.com/driver/blynk/BlynkESP8266_Lib.zip
After you download the Blynk App, you’ll need to create a New Blynk account. This account is separate from the accounts used for the Blynk Forums, in case you already have one.
We recommend using a real email address because it will simplify things later.
An account is needed to save your projects and have access to them from multiple devices from anywhere. It’s also a security measure.
You can always set up your own Private Blynk Server and have full control.
After you’ve successfully logged into your account, click New Project.
Change your hardware from ESP8266 to Arduino UNO, Project name as osoyoo arm and create Project as following:
After you pressed Create button, system will remind you that Authentication token will be sent to your email. Click OK!
Auth Token is a unique identifier which is needed to connect your hardware to your smartphone. Every new project you create will have its own Auth Token. You’ll get Auth Token automatically on your email after project creation. You can also copy it manually. Click on devices section :
Now your APP will go to a new UI page as following, click + icon to add a new Widget (sensor, actuator etc):
Now you will see a Widget Box, Click Slider, you will add a Slider widget on to your APP. click the Slider and set its property as following:
After above steps, you will see a finger Slider bar showed in above picture. This slider will control our Arduino Servo for robot finger. Programming virtual port is V1 and moving range is from 0 to 180. You might be curious what is virtual pin V1. We will take this topic in Arduino Sketch section.
Now repeat above procedure, add another three Sliders called wrist, arm, base .
After adding above 4 sliders, your APP UI will look like following picture:
Hardware Connection:
Download Blynk-lesson1 Arduino sketch from https://osoyoo.com/driver/wifi-robot-arm/blynk-robot-arm.zip, unzip the file you will see blink-robot-arm folder. Please enter the folder and open blink-robot-arm.ino file into your Arduino IDE.
You need replace line 25 with your own Blynk token and Line 29,30 with your own wifi ssid and password.
char auth[] = "***"; //replace *** with your blynk token ... char ssid[] = "***"; //replace *** with your wifi ssid char pass[] = "***"; //replace *** with your wifi password
After changing the token and wifi password, upload code to Arduino and open your Serial monitor as following:
If your Wifi Password and Blynk token setting is correct, you will see your Arduino IP address. The last line will show “Ready” which means your Arduino has connected to Blynk Cloud Server.
Now go back to APP , click the ►Play button, your UI will go to running status. In the upper-right corner, you can find an Arduino board icon (see blue circle area), this means your Arduino has been detected by Blynk cloud server. If Arduino failed to connect Blynk, this icon will show some alert sign.
Now you can move each of the 4 Sliders from 0 to 180 degree. This will rotate the corresponding servo and therefore control you robot arm actions.
Q: How to use local Blynk server instead of Blynk Cloud to control OSOYOO 4 DOF robot arm?
Using local Blynk Server can make your IoT project much faster and permanently free of charge. So it is a good idea to install local Blynk Server instead of using Blynk Cloud.
In order to use local Blynk Server, you need finish following tasks:
java -jar ./blynk-server.jar -dataFolder ./Blynk &
//Blynk.begin(auth, wifi, ssid, pass);
Then enable line 60 by removing comment sign in line 59 and line 61
Blynk.begin(auth, wifi, ssid, pass,"192.168.0.37",8080); // change 192.168.0.37 in above line to your local Blynk Server IP
For more information about how to install local Blynk Server, read our sample tutorial
DownLoad Url osoyoo.com