Manufactura industrial
Internet industrial de las cosas | Materiales industriales | Mantenimiento y reparación de equipos | Programación industrial |
home  MfgRobots >> Manufactura industrial >  >> Manufacturing Technology >> Proceso de manufactura

Construye un Robot Bípede Arduino: Guía DIY Baby Dino

Componentes y materiales

Componente Cantidad
Arduino Mega 2560 (también sirve Uno o Nano) 1
Batería 9V (o LiPo 2S) 1
Sensor ultrasónico HC-SR04 1
Micro-servos SG90 9g 5

Sobre el proyecto

Baby Dino es un robot bípedo basado en Arduino. Usa 5 servos: dos por pierna (cadera y tobillo) y uno para la cabeza. Incluye sensor ultrasónico para detectar y esquivar obstáculos. ¡Vamos a construirlo!

Paso 1: Introducción

Paso 2: Componentes requeridos

Paso 3: Calibrar servos (fix.ino)

  1. Descarga y sube el programa fix.ino.
  2. Conecta servos según esquema.
  3. Coloca los cuernos de servo a 90° (posición central).
#include <Servo.h>
Servo s1, s2, s3, s4, s5;
void setup() {
  s1.attach(8); s2.attach(9); s3.attach(10); s4.attach(11); s5.attach(12);
}
void loop() {
  s1.write(90); s2.write(90); s3.write(90); s4.write(90); s5.write(90);
}

Paso 4: Diseño y corte

Paso 5: Montaje final

  1. Fija servos al cartón.
  2. Sube el programa principal biped.ino (uBipedino.ino).
  3. Conecta servos y sensor ultrasónico según esquema.
  4. Organiza cables como "cola".
  5. Conecta batería.

Código principal (biped.ino / uBipedino.ino)

Edita los pines de servos y ultrasónico según tu cableado.

#include <Servo.h>
#include <NewPing.h>

// Pines (ajusta a tu conexión)
#define IRsensorPin 13       // Si usas sensor IR en lugar de ultrasónico
#define TRIGGER_PIN 12
#define ECHO_PIN 11
#define LEFTLEG 7
#define RIGHTLEG 10
#define LEFTFOOT 8
#define RIGHTFOOT 9
#define HEAD 6
#define MAX_DISTANCE 200

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

Servo Lleg, Rleg, Lfoot, Rfoot, Head;

int Hcenter = 70;
int RLcenter = 100, RFcenter = 65;
int LLcenter = 90, LFcenter = 75;
int tAngle = 30, uAngle = 35, sAngle = 35;
int hAngle = Hcenter;

void Forward(byte Steps, byte Speed) {
  Serial.println("Forward");
  TiltRightUp(tAngle, Speed);
  for (byte j = 0; j < Steps; ++j) {
    SwingRight(sAngle, Speed);
    TiltRightDown(tAngle, Speed);
    TiltLeftUp(tAngle, Speed);
    SwingRcenter(sAngle, Speed);
    SwingLeft(sAngle, Speed);
    TiltLeftDown(tAngle, Speed);
    TiltRightUp(tAngle, Speed);
    SwingLcenter(sAngle, Speed);
  }
  TiltRightDown(tAngle, Speed);
}

void TurnLeft(byte Steps, byte Speed) {
  Serial.println("TurnLeft");
  TiltLeftUp(uAngle, Speed); delay(20);
  for (byte j = 0; j < Steps; ++j) {
    LeftLegIn(sAngle, Speed);
    TiltLeftDown(uAngle, Speed);
    TiltRightUp(uAngle, Speed); delay(20);
    LeftLegIcenter(sAngle, Speed);
    RightLegOut(sAngle, Speed);
    TiltRightDown(uAngle, Speed);
    TiltLeftUp(uAngle, Speed); delay(20);
    RightLegOcenter(sAngle, Speed);
  }
  TiltLeftDown(uAngle, Speed);
}

void TurnRight(byte Stps, byte Speed) {
  Serial.println("TurnRight");
  TiltRightUp(uAngle, Speed); delay(20);
  for (byte f = 0; f <= Stps; ++f) {
    RightLegIn(sAngle, Speed);
    TiltRightDown(uAngle, Speed);
    TiltLeftUp(uAngle, Speed); delay(20);
    RightLegIcenter(sAngle, Speed);
    LeftLegOut(sAngle, Speed);
    TiltLeftDown(uAngle, Speed);
    TiltRightUp(uAngle, Speed); delay(20);
    LeftLegOcenter(sAngle, Speed);
  }
  TiltRightDown(uAngle, Speed);
}

void HeadRight() { Serial.println("HeadRight"); Head.write(Hcenter - 105); delay(1000); }
void HeadLeft()  { Serial.println("HeadLeft");  Head.write(Hcenter + 105); delay(1000); }
void HeadCenter(){ Serial.println("HeadCenter"); Head.write(Hcenter); delay(1000); }

void TiltRightUp(byte ang, byte sp)  { for (int i=0;i<=ang;i+=5){ Lfoot.write(LFcenter+i); Rfoot.write(RFcenter+i); delay(sp);} }
void TiltRightDown(byte ang, byte sp){ for (int i=ang;i>0;i-=5){ Lfoot.write(LFcenter+i); Rfoot.write(RFcenter+i); delay(sp);} }
void TiltLeftUp(byte ang, byte sp)   { for (int i=0;i<=ang;i+=5){ Lfoot.write(LFcenter-i); Rfoot.write(RFcenter-i); delay(sp);} }
void TiltLeftDown(byte ang, byte sp) { for (int i=ang;i>0;i-=5){ Lfoot.write(LFcenter-i); Rfoot.write(RFcenter-i); delay(sp);} }

void SwingRight(byte ang, byte sp)   { for (int i=0;i<=ang;i+=5){ Lleg.write(LLcenter-i); Rleg.write(RLcenter-i); delay(sp);} }
void SwingRcenter(byte ang, byte sp) { for (int i=ang;i>0;i-=5){ Lleg.write(LLcenter-i); Rleg.write(RLcenter-i); delay(sp);} }
void SwingLeft(byte ang, byte sp)    { for (byte i=0;i<=ang;i+=5){ Lleg.write(LLcenter+i); Rleg.write(RLcenter+i); delay(sp);} }
void SwingLcenter(byte ang, byte sp) { for (byte i=ang;i>0;i-=5){ Lleg.write(LLcenter+i); Rleg.write(RLcenter+i); delay(sp);} }

void RightLegIn(byte ang, byte sp)     { for (int i=0;i<=ang;i+=5){ Rleg.write(RLcenter-i); delay(sp);} }
void RightLegIcenter(byte ang, byte sp){ for (int i=ang;i>0;i-=5){ Rleg.write(RLcenter-i); delay(sp);} }
void RightLegOut(byte ang, byte sp)    { for (int i=0;i<=ang;i+=5){ Rleg.write(RLcenter+i); delay(sp);} }
void RightLegOcenter(byte ang, byte sp){ for (int i=ang;i>0;i-=5){ Rleg.write(RLcenter+i); delay(sp);} }

void LeftLegIn(byte ang, byte sp)      { for (byte i=0;i<=ang;i+=5){ Lleg.write(LLcenter+i); delay(sp);} }
void LeftLegIcenter(byte ang, byte sp) { for (byte i=ang;i>0;i-=5){ Lleg.write(LLcenter+i); delay(sp);} }
void LeftLegOut(byte ang, byte sp)     { for (byte i=0;i<=ang;i+=5){ Lleg.write(LLcenter-i); delay(sp);} }
void LeftLegOcenter(byte ang, byte sp) { for (byte i=ang;i>0;i-=5){ Lleg.write(LLcenter-i); delay(sp);} }

void setup() {
  Serial.begin(19200);
  Serial.println("Bipedino setup is running.");
  Lleg.attach(LEFTLEG); Rleg.attach(RIGHTLEG);
  Lfoot.attach(LEFTFOOT); Rfoot.attach(RIGHTFOOT);
  Head.attach(HEAD);
  CenterServos(); delay(500);
  for (int i=0;i<5;++i){ GetSonar(); delay(1000); }
  Serial.println("Bipedino is ready.");
}

void loop() {
  unsigned int cmCenter = MAX_DISTANCE, cmLeft = MAX_DISTANCE, cmRight = MAX_DISTANCE;
  HeadCenter(); cmCenter = GetSonar();
  if (cmCenter < 20) {
    HeadRight(); cmRight = GetSonar(); HeadCenter();
    if (cmRight > 20) { TurnRight(1, 30); }
    else {
      HeadLeft(); cmLeft = GetSonar(); HeadCenter();
      if (cmLeft > 20) { TurnLeft(1, 30); }
    }
  } else {
    int nSteps = cmCenter / 5;
    if (nSteps > 5) nSteps = 5;
    else nSteps = 1;
    Serial.print("Steps <"); Serial.print(nSteps); Serial.println(">");
    for (int n=0; n

Esquemático de conexiones

Ver imagen en sección "Schematics". Conexiones típicas: servos en pines 6-11, ultrasónico Trig 12 / Echo 11, alimentación 9V a Vin/GND.

Proceso de manufactura

  1. Chupete: Diseño, Normas de Seguridad y Perspectivas de Fabricación
  2. Portabebés: Historia, diseño y seguridad de los portabebés infantiles
  3. La ciencia y mercado de las toallitas para bebé: Materiales, fabricación y tendencias futuras
  4. Fórmula Infantil: Ciencia, Producción y Perspectivas Futuras
  5. La Evolución y Fabricación de Cochecitos de Bebé: De Cunas Portátiles a Coches Modernos
  6. Construye un Spybot controlado por Bluetooth con Arduino
  7. FlickMote: Mando IR por gestos para Smart Home
  8. TV‑B‑Gone DIY con Arduino: Mando universal para apagar cualquier TV
  9. Construye un Reloj Maestro LED Personalizado con Alarma – Visible desde 12 Metros
  10. Robot evasor de obstáculos con servo: Construcción con Arduino y HC-SR04
  11. Find Me: Localizador Inteligente de Objetos con Arduino y Bluetooth