Easy to Assemble Bluetooth Controlled Robot With L293d

by CarlosVoltT in Circuits > Arduino

369 Views, 1 Favorites, 0 Comments

Easy to Assemble Bluetooth Controlled Robot With L293d

Imagen1-820x461.png

Video Tutorial

In this video tutorial we will see how to build a bluetooth controller robot, the l293d driver, an arduino mini pro, and the hc-05 module. The printed circuit is included to arm the power stage with the l293d integrated circuit, we will also see the source code and how to create the application with the inventor app.

Materials

  • 2 Gearmotors
  • 1 Module hc-05
  • 1 Arduino mini
  • 1 Buzzer2 led diodes
  • 2 150 ohm resistors
  • 1 regulator 7805
  • 1 Batería de 9 voltios recargable
  • 1 printed circuit
  • 1 Protoboard
  • 1 Crazy Wheel
  • 1 l293d integrated circuit
  • 10 Male Pins

Circuit

circuito-1024x870.jpg

Source Code

//Robot controlado por bluetooth
//Más proyectos en http://www.rogerbit.com
//Suscribete en http://www.youtube.com/user/carlosvolt?sub_confirmation=1
//Grupo en Facebook https://www.facebook.com/groups/RogerBit/
//declaración de variables
String cadena;
int pin2 = 2;    
int pin3 = 3;    
int pin4 = 4;    
int pin5 = 5;    
int luz = 9;    
int buzzer = 11;
void setup () {
    Serial.begin(9600);// setea la velocidad del puerto serial según la velocidad del módulo bluetooth bluetooth
    //Pines  declaraods como salidas
    pinMode(pin2, OUTPUT);
    pinMode(pin3, OUTPUT);
    pinMode(pin4, OUTPUT);
    pinMode(pin5, OUTPUT);
    pinMode(luz, OUTPUT);
    pinMode(buzzer, OUTPUT);
   }
void loop () {
  //lee las cadenas que ingresan al puerto serie
  if (Serial.available())  {
    cadena = String("");
    while (Serial.available()) {
      cadena = cadena + char(Serial.read());
      delay(1);
    }
  Serial.print(cadena);    
    if (cadena == "avanzar") {//compara el valor de la cadena obetinada
    //Enciende dos motores en la misma dirección para avanzar
digitalWrite(pin2,HIGH);
digitalWrite(pin3,LOW);
digitalWrite(pin4,HIGH);
digitalWrite(pin5,LOW);

    }

 if (cadena == "retroceder") {//compara el valor de la cadena obetinada
  //Enciende dos motores en la misma dirección para retroceder
digitalWrite(pin2,LOW);
digitalWrite(pin3,HIGH);
digitalWrite(pin4,LOW);
digitalWrite(pin5,HIGH); 
    }    
    
 if (cadena == "izquierda") {//compara el valor de la cadena obetinada
  //Enciende dos motores en distinta dirección para ir hacia la izquierda
digitalWrite(pin2,LOW);
digitalWrite(pin3,HIGH);
digitalWrite(pin4,HIGH);
digitalWrite(pin5,LOW);
    }

 if (cadena == "derecha") {//compara el valor de la cadena obetinada
  //Enciende dos motores en distinta dirección para ir hacia la derecha
digitalWrite(pin2,HIGH);
digitalWrite(pin3,LOW);
digitalWrite(pin4,LOW);
digitalWrite(pin5,HIGH);
    }

 if (cadena == "parar") {//compara el valor de la cadena obetinada
  //Detiene ambos motores cuando soltamos el botón
digitalWrite(pin2,LOW);
digitalWrite(pin3,LOW);
digitalWrite(pin4,LOW);
digitalWrite(pin5,LOW);
    }
   //Activa la bocina
 if (cadena == "claxon") {
digitalWrite(buzzer,HIGH);
    }
   //Desactiva la bocina
 if (cadena == "claxoff") {
digitalWrite(buzzer,LOW);
    }
   //Enciende la luz
 if (cadena == "luzon") {
digitalWrite(luz,HIGH);
    }
  //Apaga la luz
 if (cadena == "luzoff") {
digitalWrite(luz,LOW);
    }
  }
}

Arduino Mini Pro

arduino_mini_pro.jpg

The Arduino Pro Mini is a microcontroller board based on the ATmega328.

It has 14 digital input / output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a built-in resonator, a reset button, and holes for mounting pin headers. A six-pin header can be connected to an FTDI cable or Sparkfun patch board to provide USB power and communication to the board. The Arduino Pro Mini is designed for semi-permanent installation on objects or exhibitions. The board comes without pre-assembled headers, allowing the use of various types of connectors or direct soldering of cables. The pin design is compatible with the Arduino Mini. There are two versions of the Pro Mini. One runs at 3.3V and 8 MHz, the other at 5V and 16 MHz.

HC-05 Bluetooth Module

modulo-hc-05-1-600x600.jpg

Specs

  • Frequency: 2.4 GHz ISM band
  • Modulation: GFSK
  • USB protocol: USB v1.1 / 2.0
  • Sensitivity: Less than -84dBm at 0.1% BER
  • Transmission power: less than 4dBm, Class 2.
  • Asynchronous ratio: 2.1Mbps (Max) / 160 kbps.
  • Synchronous: 1Mbps / 1Mbps
  • Support profiles: Bluetooth serial port (master and slave)
  • Power supply: + 3.3VDC 50mA. (supports 3.3 to 6V)
  • Working temperature: -5 ° C to 45 ° C.

Gearmotor

Motorreducto.jpg

Description

  • With EMC, strong anti-interference, no SMC interference.
  • Operating voltage: DC 3V-12V (3V-6V suggested)
  • Maximum torque: 800gf cm min
  • No-load speed: 1:48
  • Charging current: 70 mA (250 mA MAX)
  • Engine speed: 130 rpm
  • Length: Approx.65mm / 2.56 "
  • Height: Approx.23mm / 0.9 "
  • Thickness: Approx.18mm / 0.71 «
  • Main Color: Yellow
  • Axis flat, has 1.9mm inner hole, can insert the car shaft 2mm closely

LM7805

lm7805.jpg

An LM7805 voltage regulator is a voltage regulator that generates +5 volts.

An easy way to remember the voltage output of a series of LM78XX voltage regulators is the last two digits of the number. An LM7805 ends with "05"; Therefore, it emits 5 volts. The "78" part is just the convention that chipmakers use to denote the series of regulators that produce positive voltage.

Application in Inventor and Source App

Screenshot_20200715-020443-439x1024.png

PCB

pcb.png