Robot with WiFi control and servos driven by ESP32
More info and updates in https://rogerbit.com/wprb/2023/07/robot-wifi/
A robot controlled by Wi-Fi, servos and ESP32 is a robotization system that uses a combination of technologies to enable wireless communication and control of a robot. This type of robot is based on servomotors to control movements, and uses an ESP32 module for communication and remote control.
The ESP32 is a low-cost, low-power microcontroller that features Wi-Fi and Bluetooth connectivity capabilities. Provides a wireless interface that allows two-way communication between the robot and a remote device, such as a smartphone, computer, or tablet.
Servomotors are devices used to precisely control and position the different moving components of a robot, such as arms, wheels or head. These servos connect to the ESP32 and receive control signals to determine position and speed of movement.
Control of the robot is achieved by sending commands over the Wi-Fi connection from the remote device to the ESP32. This can be achieved through a specific application or software that allows movement instructions to be sent to the robot. The ESP32 receives these commands, processes them and transmits them to the corresponding servomotors to execute the desired movements.
Once the ESP32 receives the commands, it can use algorithms and programmed logic to control the robot's sequence of movements. This allows the robot to perform a wide variety of tasks, such as moving, manipulating objects, or interacting with its environment.
Wireless communication over Wi-Fi provides flexibility and mobility since the remote device does not need to be physically connected to the robot. This allows the robot to be controlled from a considerable distance and provides the ability to monitor and control multiple robots at once.
This circuit works with 5 Volts direct current.
Electronic components
An Esp32
female pins
Pines macho
PCB
Four servomotors (with accessories)
The mg995 – 360°, is a continuous rotation servo (360°) is a variant of normal servos, in which the signal we send to the servo controls the rotation speed , instead of the angular position as occurs in servos. conventional.
This continuous rotation servo is a simple way to get a motor with speed control, without having to add additional devices such as controllers or encoders as is the case with DC or stepper motors, since the control is integrated on the servo itself.
Specifications
Gear Material: Metal
Swivel range: 360°
Operating voltage: 3 V to 7.2 V
No-load operation speed: 0.17 seconds / 60 degrees (4.8V); 0.13 seconds / 60 degrees (6.0V)
Torque: 15 kg / cm
Working temperature: -30°C to 60°C
Cable length: 310 mm
Weight: 55g
Dimensions: 40.7mm x 19.7mm x 42.9mm
Includes:
1 Tower Pro Mg995 servomotor, continuous rotation.
3 Screws for assembly.
3 Coples (horns).
Four wheels
STL files
Download –> https://rogerbit.com/wprb/wp-content/uploads/2021/02/stl_auto_con_servos.zip
Source code
#include <WiFi.h>
#include <Servo.h>
const char* ssid = "xxxxxxxx";//Clave wifi
const char* password = "xxxxxxxx";//Contraseña wifi
WiFiServer server(80);
Servo servoPin12;
Servo servoPin14;
Servo servoPin27;
Servo servoPin26;
int pin2 = 2;
void setup()
{
Serial.begin(115200);
// Pines de control servo y led onboard esp32
servoPin12.attach(12);
servoPin14.attach(14);
servoPin27.attach(27);
servoPin26.attach(26);
pinMode(pin2, OUTPUT);
digitalWrite(pin2, LOW);
delay(10);
// Comenzamos conectándonos a una red WiFi
Serial.println();
Serial.println();
Serial.print("Conectando a ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("Conectado a red Wifi.");
Serial.println("Dirección IP ");
Serial.println(WiFi.localIP());
server.begin();
digitalWrite(pin2, HIGH);
}
int value = 0;
void loop(){
WiFiClient client = server.available(); // Escuchando a los clientes entrantes
if (client) { // Si hay un cliente,
Serial.println("Nuevo cliente"); // Imprime un mensaje en el puerto serie
String currentLine = ""; // String para contener datos entrantes del cliente
while (client.connected()) { // Bucle mientras el cliente está conectado
if (client.available()) { // Si hay bytes para leer del cliente,
char c = client.read(); // Lee un caracter
Serial.write(c); // Lo imprimimos en el monitor serial
if (c == '\n') { // Si el byte es un carácter de nueva línea
if (currentLine.length() == 0) {
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println();
// Contenido HTML
client.print("Click <a href=\"/avanzar\">Avanzar</a> Para Avanzar.<br>");//Avanzar
client.print("Click <a href=\"/atras\">Retroceder</a> Para Retroceder.<br>");//Retroceder
client.print("Click <a href=\"/derecha\">Derecha</a> Para ir a la derecha.<br>");//Avanzar
client.print("Click <a href=\"/izquierda\">Izquierda</a> Para ir a la Izquierda.<br>");//Izquierda
client.print("Click <a href=\"/parar\">Parar</a> Para Detener.<br>");//Parar
client.println();
// Salir del ciclo while:
break;
} else { // si tienes una nueva línea, borra currentLine:
currentLine = "";
}
} else if (c != '\r') {
currentLine += c;
}
//Avanzar
if (currentLine.endsWith("GET /avanzar")) {
servoPin12.write(0);//
servoPin14.write(180);//
servoPin27.write(0);//
servoPin26.write(180);//
}
//----Atrás----
if (currentLine.endsWith("GET /atras")) {
servoPin12.write(180);//
servoPin14.write(0);//
servoPin27.write(180);//
servoPin26.write(0);//
}
//----Gira a la derecha---
if (currentLine.endsWith("GET /derecha")) {
servoPin12.write(180);//
servoPin14.write(180);//
servoPin27.write(180);//
servoPin26.write(180);//
}
//----Girar en la izquierda----
if (currentLine.endsWith("GET /izquierda")) {
servoPin12.write(0);
servoPin14.write(0);
servoPin27.write(0);
servoPin26.write(0);
}
//----Parar----
if (currentLine.endsWith("GET /parar")) {
servoPin12.write(90);
servoPin14.write(90);
servoPin27.write(90);
servoPin26.write(90);
}
}
}
// Cierra la conexión
client.stop();
Serial.println("Cliente desconectado");
}
}
Robot with WiFi control and servos driven by ESP32
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(2)
- Engineer Jul 02,2024
- CarlosVolt Tutoriales Jun 18,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by CarlosVolt Tutoriales
- Infrared stepper motor control with speed control More info and updates https://rogerbit.com/wprb/2024/09/motor-paso-a-paso-x-infrarrojo/In this proje...
- Uploading BME280 Sensor Data to ThingSpeak Using ESP32 In this tutorial, we will show you how to connect a BME280 sensor to an ESP32 to read temperature, h...
- Water pump control for irrigation via telegram and esp32 Water Pump Control by Telegram and ESP32 is an automated system that allows you to remotely control ...
- Air conditioning on/off control via telegram and esp32 In this tutorial we will see how to control an air conditioner, with an esp32 and the telegram appli...
- 35 watt stereo amplifier In this video we will see how to build an audio amplifier, with the TDA7377 integrated circuit, and ...
- Laser alarm with RFID module More info and updates in https://rogerbit.com/wprb/2024/08/alarma-laser-rfid/In this project, we bui...
- Control lights by voice commands and keys In this tutorial we will see how to create a device to control lights by voice commands, with a modu...
- Stepper motor control x bluetooth and app In this tutorial we will see a circuit, which controls a stepper motor, with an application made in ...
- DFplayermini x bluetooth mp3 player control More info and updates in https://rogerbit.com/wprb/2022/12/dfplayermini-x-bluetooth/In this tutorial...
- Robot with WiFi control and servos driven by ESP32 More info and updates in https://rogerbit.com/wprb/2023/07/robot-wifi/A robot controlled by Wi-Fi, s...
- How to make a water level meter with uln2803 In this tutorial we will see how to make a water level meter circuit with the built-in uln2803.The p...
- Color Detector with Arduino and OLED display In this tutorial we will show you how to build a color detector using the TCS3200 sensor and an SH11...
- DTMF decoder for handy with arduino, control over several kilometers In this tutorial we will see how to make a circuit to connect to our handy, in this case a Baofeng U...
- Turn on light from thindspeak with esp32 In this tutorial, we will show you how to control lights over the Internet using an ESP32 and the Th...
- MP3 player control with webserver using ESP32 WIFI In this tutorial, you will learn how to build a web server using the ESP32 to control the YX5300 mod...
- Time clock with fingerprint IoT module, uploading data to thingspeak More info in and updates in https://rogerbit.com/wprb/2022/07/reloj-de-control-fingerprint/In this t...
- Make your own logic tip (includes printed circuit board) In this video tutorial we will see how to make a logic tip, on a printed circuit, with the integrate...
- Coil or inductor meter with Arduino and OLED display More info and updates in https://rogerbit.com/wprb/2022/06/medidor-inductores/In this tutorial we wi...
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
120 0 0 -
DIY Laser Power Meter with Arduino
170 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
157 0 2 -