0% found this document useful (0 votes)
13 views6 pages

Lab 6

Uploaded by

Malik Yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views6 pages

Lab 6

Uploaded by

Malik Yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Control of a differential Drive Robotic Chassis Lab 6

with a Mobile App


Control of a Differential Drive Robotic Chassis with a
Mobile App
Objectives:

⮚ To familiarize participants with the ESP32 hardware and software setup, including board components and
software installation.
⮚ Tagging of ESP32 hardware pins with virtual pins of Blynk App

⮚ To teach basic ESP32 programming and GPIO control, enabling participants to blink LEDs and read digital
inputs via Blynk App.

Learn about Arduino and the Arduino UNO and how you can integrate this board into your makerspace and coding program. Make interactive makerspace projects while learning to code and problem solve.

ESP 32:
The ESP32 is a series of low-cost and low-power System on a Chip (SoC) microcontrollers developed by
Espressif that include Wi-Fi and Bluetooth wireless capabilities and dual-core processor. If you’re familiar
with the ESP8266, the ESP32 is its successor, loaded with lots of new features.

ESP32 DEVKIT DOIT


The picture below shows the ESP32 DEVKIT DOIT V1 board, version with 36 GPIO pins.

General Purpose Input Output Pins (GPIOS)


Almost all GPIOs have a number assigned and that’s how you should refer to them—by their number.

With the ESP32 you can decide which pins are UART, I2C, or SPI – you just need to set that on the code. This is
possible due to the ESP32 chip’s multiplexing feature that allows to assign multiple functions to the same pin.

If you don’t set them on the code, the pins will be configured by default as shown in the figure below (the pin location
can change depending on the manufacturer). Additionally, there are pins with specific features that make them suitable
or not for a particular project.
1
Control of a differential Drive Robotic Chassis Lab 6
with a Mobile App

The placement of the GPIOs might be different depending on your board model. However, usually, each specific
GPIO works in the same way regardless of the development board you’re using (with some exceptions). For example,
regardless of the board, usually GPIO5 is always the VSPI CS0 pin, GPIO 23 always corresponds to VSPI MOSI for
SPI communication, etc.

Blynk App:
The Blynk app is simply an open-source platform designed for iOS / Android devices to remotely control and view
hardware. It is also designed for the Internet of Things (IoT). The dashboard can be customized in a very useful way
by using various Widgets such as Buttons, Displays, Sliders included in this Blynk app. Also, this widget allows you
to turn devices on / off and view sensor values. Lastly, you can view, store and visualize data through this.

2
Control of a differential Drive Robotic Chassis Lab 6
with a Mobile App
Main Parts:
Blynk app is made up of 3 main parts. They are as follows.

1. Blynk app — Here we can customize the interface to suit our design. The Blynk app includes a number of
different widgets for this.

2. Blynk server — The Blink server is used to communicate project hardware with the Blink application
installed on the smartphone. You can use Blynk cloud for that. This is Blynk cloud open-source and can
control thousands of devices through it.

3. Blynk library — The Blynk library is used to communicate with the hardware platform Blynk server used
with the Blynk app and to process incoming and outgoing commands.

You can download this Blynk app from AppStore or Google Play Store.

Step-by-step guide to making your first project on Blynk:


Sign Up
‍ our very first step will be to create an account. You can do it by downloading our iOS, Android app or
Y
in Blynk.Console. The sign up process is pretty straightforward.

Enable Developer Mode


‍ eveloper is a special user who has access to all of the functionality required to configure the platform for the use by
D
end-users. This is usually someone who builds the hardware, develops the firmware, and does all of the device
configurations. To enable this setting in the Blynk app or in Blynk.Console

1. Navigate to My Profile / User profile in the left menu


2. Check that Developer Mode switch is set to ON
Note: Currently, only one developer is allowed per Organization to avoid sync issues. This limit can be changed
later.

3
Control of a differential Drive Robotic Chassis Lab 6
with a Mobile App
Create new Template:

Generate Datastreams:

Design Web Dashboards:

4
Control of a differential Drive Robotic Chassis Lab 6
with a Mobile App
ESP32 Code to write a value to the physical pin as well as Virtual Pin:
#define BLYNK_PRINT Serial

/* Fill in information from Blynk Device Info here */


#define BLYNK_TEMPLATE_ID "XXXXXXXXXXXX"
#define BLYNK_TEMPLATE_NAME "XXXXXXXX"
#define BLYNK_AUTH_TOKEN "XXXXXXXXXXXXXXXXXXXXXx"

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// Your WiFi credentials.


// Set password to "" for open networks.
char ssid[] = "XXXXXX";
char pass[] = "XXXXXXX";
int IN1 = 2 ;

void setup()
{
// Debug console
Serial.begin(9600);

Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);


pinMode(IN1,OUTPUT);
}
BLYNK_WRITE(V0) {
int value1 = param.asInt();
digitalWrite(IN1,value1);
}

void loop()
{
Blynk.run();
}

Configure Mobile App:


Configure your Mobile App exactly same as the Blynk Console’s Web Dashboard.

Testing the Mobile App with Web dashboard on Blynk Console.

5
Control of a differential Drive Robotic Chassis Lab 6
with a Mobile App
Lab Assignment
1. Develop a Blynk App to Control a Differential Drive Robotic Chassis.

You might also like