Smart Parking System Controlled by Blynk App on Arduino.

Do you know how to control three servos using Blynk app?

INTRODUCTION

Do you know how to controlled three servos using Blynk app on Arduino?? In this video, I use three servos to make a smart parking system controlled by a Blynk App on Maker UNO.

HARDWARE PREPARATION

This tutorial use :

  1. Maker UNO
  2. Cytron ESP 8266 WiFi Shield
  3. USB Micro B Cable

Software Preparation.

  1. Open the Arduino IDE. Please make sure that your Arduino IDE is version 1.6.9 and above.
  2. Then, click at the on Sketch – Include Library – Manage Libraries… Search for “blynk” and install the latest version of Blynk.
  3. Next, we need to add an additional library for Blynk. Click on this link to download the library. Watch the video on how to include the library.
  4. Then we can continue to program by edit the program from the Example file of the Blynk. (File – Examples – Blynk – Boards_WiFi – ESP8266_Shield)

Sample Code

This is the sample code used for this tutorial. Try it!

/*************************************************************
Control multiple servo using a Blynk App!
App project setup:
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Servo.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
Servo servo1;
Servo servo2;
Servo servo3;
boolean state1 = false;
boolean state2 = false;
boolean state3 = false;
BLYNK_WRITE(V1)
{
if (state1 == false) {
state1 = true;
servo1.write(0);
}
else {
state1 = false;
servo1.write(90);
}
}
BLYNK_WRITE(V2)
{
if (state2 == false) {
state2 = true;
servo2.write(0);
}
else {
state2 = false;
servo2.write(90);
}
}
BLYNK_WRITE(V3)
{
if (state3 == false) {
state3 = true;
servo3.write(0);
}
else {
state3 = false;
servo3.write(180);
}
}
void setup()
{
// Debug console
Serial.begin(9600);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
servo1.attach(11);
servo2.attach(10);
servo3.attach(9);
}
void loop()
{
Blynk.run();
}

Thank you

Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiry, please post at Cytron Technical Forum.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

BLTouch Installation for Ender 3 with 32-bit V4.2.2 Board
Pick and Send Random Meal’s Option and Locations through Telegram Bot Using Grove WiFi 8266 on micro:bit
DIY Automated Vacuum Cleaner Using REKA:BIT With Micro:bit
Rainbow Spark in Mini House using Maker Uno.
TinyML on Arduino using Edge Impulse
Tutorials of Cytron Technologies Scroll to Top