Fabrication industrielle
Internet des objets industriel | Matériaux industriels | Entretien et réparation d'équipement | Programmation industrielle |
home  MfgRobots >> Fabrication industrielle >  >> Manufacturing Technology >> Processus de fabrication

Bipède Arduino (bébé Dino)

Composants et fournitures

Arduino Mega 2560
× 1
Batterie 9V (générique)
× 1
Capteur à ultrasons SparkFun - HC-SR04
× 1
Micro-servomoteur SG90
× 5

À propos de ce projet

Baby Dino est un robot à deux pattes basé sur Arduino. Il utilise essentiellement cinq servomoteurs, deux pour chaque jambe et un pour la tête. Il utilise également un capteur à ultrasons pour détecter les obstacles et les éviter. Voyons maintenant comment le faire !

Étape 1 :Présentation

  • Baby Dino est un robot DIY utilisant Arduino.
  • Il est en carton.
  • Il trouvera des obstacles, puis se déplacera à gauche ou à droite.

Étape 2 : composants requis

  • 1 X Arduino Uno, Nano ou Mega
  • Servo 5 X 9g
  • 1 X capteur à ultrasons HC-SR04
  • 1 X batterie LiPo (batterie 2s ou 9v)

Étape 3 : Réparation du servo

  • Télécharger le programme
  • Télécharger sur Arduino
  • Connectez le servo selon le schéma ci-dessous
  • Réparer le palonnier du servo
  • Assurez-vous que tout est à 90 degrés
fix.ino

Étape 4 :Conception

  • Télécharger le design
  • Imprimez-le sur A4
  • Collez-le sur du carton
  • Découpez-le

Étape 5 :Étape finale

  • Fixez les servos sur du carton
  • Télécharger le programme sur Arduino
  • Connectez les servos et le capteur à ultrasons
  • Gérer le câble en tant que queue
  • Connectez la batterie

C'est ça!

uBipedino.ino

Code

  • fix.ino
  • bipède
fix.inoArduino
#include Servo s1 ; Servo s2 ; Servo s3; Servo s4 ; Servo s5; void setup() { s1.attach(8); s2.attache(9) ; s3.attacher(10) ; s4.attache(11); s5.attach(12);}boucle vide() { s1.write(90); s2.write(90); s3.write(90); s4.write(90); s5.write(90); }
bipèdeArduino
modifiez les broches servo et ultrasons selon votre souhait
#include  #include // modifiez la broche selon votre connexion#define IRsensorPin 13// si vous utilisez un capteur infrarouge au lieu de capteur à ultrasons#define TRIGGER_PIN 12 // Broche Arduino liée à la broche de déclenchement sur le capteur à ultrasons.#define ECHO_PIN 11 // Broche Arduino liée à la broche d'écho sur le capteur à ultrasons.#define LEFTLEG 7#define RIGHTLEG 10#define LEFTFOOT 8#define RIGHTFOOT 9#define HEAD 6#define MAX_DISTANCE 200 // Distance maximale pour laquelle nous voulons effectuer un ping (en centimètres). La distance maximale du capteur est évaluée à 400-500 cm. Nouveau sondeur Ping (TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // Configuration NewPing des broches et distance maximale. Servo Lleg; // crée un objet servo pour contrôler un servo Servo Rleg;Servo Lfoot;Servo Rfoot;Servo Head;int Hcenter =70; // variable pour stocker la position centrale du servo int RLcenter =100;int RFcenter =65; // variable pour stocker la position centrale du servo int LLcenter =90;int LFcenter =75;int tAngle =30; // angle d'inclinaisonint uAngle =35; // tourne angleint sAngle =35; // angle de rotationint hAngle =Hcenter; void Forward(byte Steps, byte Speed){ Serial.println("Forward"); TiltRightUp(tAngle, Vitesse); for (byte j=0; j0; i-=5){ Lfoot.write(LFcenter+i); Rfoot.write(RFcenter+i); retard(sp); }}void TiltLeftUp(byte ang, byte sp){ //inclinaison vers le haut pour (int i=0; i<=ang; i+=5){ Lfoot.write(LFcenter-i); Rfoot.write(RFcenter-i); retard(sp); }}void TiltLeftDown(byte ang, byte sp){ //inclinaison vers la gauche pour (int i=ang; i>0; i-=5){ Lfoot.write(LFcenter-i); Rfoot.write(RFcenter-i); retard(sp); }}void LeftFootUp(char ang, byte sp){ //inclinaison vers le haut pour (int i=0; i<=ang; i+=5){ Lfoot.write(LFcenter-i); retard(sp); }}void LeftFootDown(byte ang, byte sp){ //inclinaison vers la gauche pour (int i=ang; i>0; i-=5){ Lfoot.write(LFcenter-i); retard(sp); }}void RightFootUp(byte ang, byte sp){ //inclinaison vers le haut pour (int i=0; i<=ang; i+=5){ Rfoot.write(RFcenter+i); retard(sp); }}void RightFootDown(byte ang, byte sp){ //inclinaison vers le bas pour (int i=ang; i>0; i-=5){ Rfoot.write(RFcenter+i); retard(sp); }}void SwingRight(byte ang, byte sp){ //swing right for (int i=0; i<=ang; i+=5){ Lleg.write(LLcenter-i); Rleg.write(RLcenter-i); retard(sp); }}void SwingRcenter(byte ang, byte sp){ //swing r->center for (int i=ang; i>0; i-=5){ Lleg.write(LLcenter-i); Rleg.write(RLcenter-i); retard(sp); }}void SwingLeft(byte ang, byte sp){ // swing gauche pour (byte i=0; i<=ang; i=i+5){ Lleg.write(LLcenter+i); Rleg.write(RLcenter+i); retard(sp); }}void SwingLcenter(byte ang, byte sp){ //swing l->center for (byte i=ang; i>0; i=i-5){ Lleg.write(LLcenter+i); Rleg.write(RLcenter+i); retard(sp); }}void RightLegIn(byte ang, byte sp){ //swing right for (int i=0; i<=ang; i+=5){ Rleg.write(RLcenter-i); retard(sp); }}void RightLegIcenter(byte ang, byte sp){ //swing r->center for (int i=ang; i>0; i-=5){ Rleg.write(RLcenter-i); retard(sp); }}void RightLegOut(byte ang, byte sp){ //swing right for (int i=0; i<=ang; i+=5){ Rleg.write(RLcenter+i); retard(sp); }}void RightLegOcenter(byte ang, byte sp){ //swing r->center for (int i=ang; i>0; i-=5){ Rleg.write(RLcenter+i); retard(sp); }}void LeftLegIn(byte ang, byte sp){ // balancer vers la gauche pour (byte i=0; i<=ang; i=i+5){ Lleg.write(LLcenter+i); retard(sp); }}void LeftLegIcenter(byte ang, byte sp){ //swing l->center for (byte i=ang; i>0; i=i-5){ Lleg.write(LLcenter+i); retard(sp); }}void LeftLegOut(byte ang, byte sp){ // swing gauche pour (byte i=0; i<=ang; i=i+5){ Lleg.write(LLcenter-i); retard(sp); }}void LeftLegOcenter(byte ang, byte sp){ //swing l->center for (byte i=ang; i>0; i=i-5){ Lleg.write(LLcenter-i); retard(sp); }} void setup() { Serial.begin (19200); Serial.println("La configuration de Bipedino est en cours."); Lleg.attach(LEFTLEG); Rleg.attach(RIGHTLEG); Lfoot.attach(LEFTFOOT); Rfoot.attach(RIGHTFOOT); Tête.attache (TÊTE); CenterServos(); retard (500); for (int i =0; i <5; ++i) { GetSonar(); retard(1000); } Serial.println("Bipedino est prêt.");} // setup()void loop() { unsigned int cmCenter =MAX_DISTANCE; int non signé cmLeft =MAX_DISTANCE ; non signé int cmRight =MAX_DISTANCE ; HeadCenter(); cmCenter =GetSonar(); if (cmCenter <20) { HeadRight(); cmDroite =GetSonar(); HeadCenter(); if (cmRight> 20) { TurnRight(1, 30); } else { HeadLeft(); cmGauche =GetSonar(); HeadCenter(); if (cmLeft> 20) { TurnLeft(1, 30); } } } else { int nSteps =cmCenter / 5; if (nSteps> 5) { nSteps =5; } else { nÉtapes =1; } Serial.print("Étapes <"); Serial.print(nSteps); Serial.println(">"); for (int n =0; n  

Pièces et boîtiers personnalisés

Schémas


Processus de fabrication

  1. Sucette
  2. Porte-bébé
  3. lingettes pour bébé
  4. formule pour bébé
  5. Poussette pour bébé
  6. Arduino Spybot
  7. FlickMote
  8. Téléviseur maison B-Gone
  9. horloge maîtresse