GENIUS KIDS
GENIUS KIDS
2 PROYECTO DE ROBOTICA
GENIUS KIDS
ARMADO DE CHASIS 4WD
En este proyecto veremos como armar un choche inteligente con Arduino vasado en tus
conocimientos de ROBOTICA 1 Y ROBOTICA 3.
¿Qué significa 4WD?
Es tracción en las 4 ruedas (4WD)
Conocido en inglés como Four Wheel Drive, esta tracción 4x4
Esto quiere decir que nuestro proyecto será todo terreno podrá entrar en todos lugares
como agua y tierra no tendrá problema de atascarse.
A continuación, se presentará las imágenes para que puedas armar tu proyecto
Colocaras las petallas de esta manera en las ranuras
Colocaras los motorreductores teniendo con los tornillos
GENIUS KIDS
De esta manera colocas los tornillos para que los motorreductores no se muevan
Colocaras las llantas de manera adecuada como lo muestra la imagen
Por último, pondrás la tapa de arriba de tu chasis atornillándola
GENIUS KIDS
L298N (Puente H doble)
¿Qué es el L298N?
Este módulo posee dos puentes H que permiten controlar 2 motores el módulo permite controlar
el sentido de giro y velocidad mediante señales TTL que se pueden obtener de tarjetas de desarrollo
como Arduino. Tiene integrado un regulador de voltaje de 5V encargado de alimentar la parte lógica
del L298N, el uso de este regulador se hace a través de un Jumper y se puede usar para alimentar la
etapa de control.
Características del L298N.
1- Chip: L298N
2- Canales: 2 (soporta 2 motores DC)
3- Voltaje lógico: 5V
4- Voltaje de Operación: 5V-35V
5- Consumo de corriente (Digital): 0 a 36mA
L298N Físico
GENIUS KIDS
Circuito
Armado del L298N
Armado del Circuito Arduino
GENIUS KIDS
Codigo Arduino.
int ENA = 10; // MCU PWM Pin 10 to ENA on L298n Board
int IN1 = 9; // MCU Digital Pin 9 to IN1 on L298n Board
int IN2 = 8; // MCU Digital Pin 8 to IN2 on L298n Board
int ENB = 5; // MCU PWM Pin 5 to ENB on L298n Board
int IN3 = 7; // MCU Digital pin 7 to IN3 on L298n Board
int IN4 = 6; // MCU Digital pin 6 to IN4 on L298n Board
void setup()
pinMode(ENA, OUTPUT); //Set all the L298n Pin to output
pinMode(ENB, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
void DRIVEONE()
// Run the motors on both direction at fixed speed
digitalWrite(IN1, HIGH); // Turn HIGH motor A
digitalWrite(IN2, LOW);
analogWrite(ENA, 200); // TO set the turning speed to 200 out of possible range 0 to 255
digitalWrite(IN3, HIGH); // turn HIGH motor B
GENIUS KIDS
digitalWrite(IN4, LOW); // To set the turning speed to 200 out of possible range 0 to 255
analogWrite(ENB, 200);
delay(2000); // Delay to 2 seconds
// Changing the direction of the motor
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
delay(2000); // Delay to 2 seconds
digitalWrite(IN1, LOW); // Turn the motor off
digitalWrite(IN2, LOW); // Turn the motor off
digitalWrite(IN3, LOW); // Turn the motor off
digitalWrite(IN4, LOW); // Turn the motor off
void DRIVETWO()
/*
These function will turn the motors on the possible speeds, the maximum speed turns is
determined
by the motor specs and the operating voltage. The PWM(Pulse with modulation values will
sent
by analogWrite() function to drive the maxim speed.
*/
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
GENIUS KIDS
digitalWrite(IN4, HIGH);
for (int x = 0; x < 256; x++) // Motor will accelerate from 0 to maximum speed
analogWrite(ENA, x);
analogWrite(ENB, x);
delay(20);
for (int y = 255; y >= 0; --y) // Motor will decelerate from maximum speed to 0
analogWrite(ENA, y);
analogWrite(ENB, y);
delay(20);
digitalWrite(IN1, LOW); // Tun Off All the Motors
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
void loop()
DRIVEONE();
delay(1000);
DRIVETWO();
delay(1000);