Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
In partial fulfillment
of the courses
In LBYMREL EG and MIPROCB EG
Submitted by:
CASTAÑEDA, Ramon David V.
CHOA, Gabriel Kester T.
MASCARDO, Earl Joseph R.
PRESTOSA, Marianne Claire R.
ROASA, Maria Lorenza Antonette P.
Submitted to:
Engr. Rhen Anjerome R. Bedruz
Typically, robots are either programmed to be able to carry out certain and specific tasks or be
programmed to be controlled via a controller—which may or may not be directly attached to the
robot’s body itself. The idea of being able to control the robot from an external device is the main
concept of this experiment and prototype project. The researchers were able to accomplish this by
making use of a robot car build, while incorporating the use of the ESP32, which has an integrated
Wi-Fi and Bluetooth modules in its system; connecting wires; Direct Current (DC) motors; an
L293D, a motor driver which controls two DC motors simultaneously and allows them to drive in
The prototype is in the form of a tethered robot car. The ESP32 will first to connect to an accessible
and stable Wi-Fi network, and retrieve an IP Address. With the Wi-Fi connectivity, the user can
access the app that facilitates the controlling of the robot. For this prototype, the researchers made
use of an Android mobile phone and the MIT App Inventor to be able to project the desired
application interface and layout of its buttons and controls. The command for the robot is sent via
Wi-Fi connection, to which the robot is also connected to. Through the connection, the ESP32 will
get the code of command and decipher it into an action it can do.
As for the uses or application of prototypes such as that of the researchers, tethered devices or
tethered robot cars can be useful to transport objects from one point to another, given that the car’s
build can carry a certain weight. Furthermore, it can maximize the available technologies and
capabilities devices available in the market can offer. With the use of Wi-Fi and Bluetooth
modules, devices such as mobile phones can be used for more than just messaging, internet
browsing, and leisure. Especially for engineering students, this presents an opportunity to learn
WiFiServer server(80);
WiFiClient client;
String data ="";
void setup() {
pinMode(LMotorPin1, OUTPUT);
pinMode(LMotorPin2, OUTPUT);
pinMode(RMotorPin1, OUTPUT);
pinMode(RMotorPin2, OUTPUT);
pinMode(LEnablePin, OUTPUT);
pinMode(REnablePin, OUTPUT);
ledcAttachPin(LEnablePin, pwmChannel);
ledcAttachPin(REnablePin, pwmChannel1);
WiFi.begin(ssid, password);
server.begin();
void GoForward() {
// Move the DC motor forward at maximum speed
Serial.println("Moving Forward");
digitalWrite(LMotorPin1, HIGH);
digitalWrite(RMotorPin1, HIGH);
digitalWrite(LMotorPin2, LOW);
digitalWrite(RMotorPin2, LOW);
ledcWrite(pwmChannel, dutyCycle);
ledcWrite(pwmChannel1, dutyCycle);
}
void GoBackward() {
// Move the DC motor backward at maximum speed
Serial.println("Moving Backward");
digitalWrite(LMotorPin1, LOW);
digitalWrite(RMotorPin1, LOW);
digitalWrite(LMotorPin2, HIGH);
digitalWrite(RMotorPin2, HIGH);
ledcWrite(pwmChannel, dutyCycle);
ledcWrite(pwmChannel1, dutyCycle);
}
void GoRight() {
// Move the DC motor to the right at maximum speed
Serial.println("Moving Right");
digitalWrite(LMotorPin1, HIGH);
digitalWrite(RMotorPin1, LOW);
digitalWrite(LMotorPin2, LOW);
digitalWrite(RMotorPin2, HIGH);
ledcWrite(pwmChannel, dutyCycle);
ledcWrite(pwmChannel1, dutyCycle);
}
void GoLeft() {
// Move the DC motor to the right at maximum speed
Serial.println("Moving Left");
digitalWrite(LMotorPin1, LOW);
digitalWrite(RMotorPin1, HIGH);
digitalWrite(LMotorPin2, HIGH);
digitalWrite(RMotorPin2, LOW);
ledcWrite(pwmChannel, dutyCycle);
ledcWrite(pwmChannel1, dutyCycle);
}
void StopCar() {
// Stop the DC Motor
Serial.println("Motor Stopped");
digitalWrite(LMotorPin1, LOW);
digitalWrite(RMotorPin1, LOW);
digitalWrite(LMotorPin2, LOW);
digitalWrite(RMotorPin2, LOW);
}
String checkClient()
{
while(!client.available()) delay(1);
String request = client.readStringUntil('\r');
request.remove(0, 5);
request.remove(request.length()-9,9);
return request;
}
void loop()
{
client = server.available();
if (!client) return;
data = checkClient();
if (data == "Forward") GoForward();
if (data == "Backward") GoBackward();
if (data == "Left") GoLeft();
if (data == "Right") GoRight();
if (data == "Stop") StopCar();
void setup()
{
Serial.begin(115200);
connectWiFi();
server.begin();
}
void loop()
{
void connectWiFi()
{
Serial.println("Connecting to WIFI");
WiFi.begin(ssid, password);
while ((!(WiFi.status() == WL_CONNECTED)))
{
delay(300);
Serial.print("..");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("NodeMCU Local IP is : ");
Serial.print((WiFi.localIP()));
}