Tabla de contenido:

Juego de brazo robótico - Controlador de teléfono inteligente: 6 pasos
Juego de brazo robótico - Controlador de teléfono inteligente: 6 pasos

Video: Juego de brazo robótico - Controlador de teléfono inteligente: 6 pasos

Video: Juego de brazo robótico - Controlador de teléfono inteligente: 6 pasos
Video: Cómo Hacer un Brazo Robótico Electrónico Casero 2024, Mes de julio
Anonim
Juego de brazo robótico - Controlador de teléfono inteligente
Juego de brazo robótico - Controlador de teléfono inteligente

Hola !

Aquí un divertido juego de verano: ¡¡El brazo robótico controlado por Smartphone !!

Como puede ver en el video, puede controlar el brazo con algunos joysticks en su teléfono inteligente.

También puede guardar un patrón, que el robot reproducirá en un bucle, para realizar algunas tareas repetitivas como ejemplo. ¡Pero este patrón es modulable como desees!

Ser creativo !

Paso 1: Materiales

Materiales
Materiales

Aquí puedes ver el material que necesitas.

Te costará alrededor de 50 € construir este brazo robótico. El software y las herramientas se pueden reemplazar, pero los usé para este proyecto.

Paso 2: Imprima en 3D el brazo robótico

Imprima en 3D el brazo robótico
Imprima en 3D el brazo robótico
Imprima en 3D el brazo robótico
Imprima en 3D el brazo robótico
Imprima en 3D el brazo robótico
Imprima en 3D el brazo robótico

El brazo robótico se imprimió en 3D (con nuestra prusa i3).

Gracias al sitio web "HowtoMechatronics.com", sus archivos STL son impresionantes para construir un brazo 3D.

Tardará alrededor de 20 horas en imprimir todas las piezas.

Paso 3: Montaje electrónico

Montaje Electrónico
Montaje Electrónico

El montaje está separado en 2 partes:

Una parte electrónica, donde el arduino está conectado a los servos por los Pines Digitales, y con el dispositivo Bluetooth (Rx, Tx).

Una parte de potencia, donde los servos se alimentan con 2 cargadores de teléfono (5 V, 2 A máx.).

Paso 4: Aplicación para smartphone

Aplicación para smartphone
Aplicación para smartphone

La aplicación se realizó en el inventor de la aplicación 2. Usamos 2 joystick para controlar 4 servos y 2 botones más para controlar el agarre final.

Conectamos Arm y Smartphone juntos mediante un módulo Bluetooth (HC-06).

Finalmente, un modo de ahorro permite al usuario guardar hasta 9 posiciones para el brazo.

El brazo pasará entonces a un modo automático, donde reproducirá las posiciones guardadas.

Paso 5: el código Arduino

El código Arduino
El código Arduino
El código Arduino
El código Arduino

// 08/19 - Brazo robótico controlado por teléfono inteligente

#include #define TRUE true #define FALSE false // ******************** DECLARACIONES ***************** ***********

representante de palabras; // mot envoyé du module Arduino au smartphone

int chiffre_final = 0; int cmd = 3; // variable commande du servo moteur (troisième fil (naranja, amarillo)) int cmd1 = 5; // servo1 int cmd2 = 9; // servo2 int cmd3 = 10; // servo3 // int cmd4 = 10; // servo4 int cmd5 = 11; // pince int activar_saving = 0; Servo motor; // en définit notre servomoteur Servo moteur1; Servo moteur2; Servo moteur3; // Servo moteur4; Servo moteur5; int step_angle_mini = 4; int step_angle = 3; int ángulo, ángulo1, ángulo3, ángulo5, ángulo2; // ángulo int pas; int r, r1, r2, r3; int enregistrer; boolean fin = FALSE; booleano fin1 = FALSE; booleano fin2 = FALSE; booleano fin3 = FALSE; booleano fin4 = FALSE; palabra w; // variable envoyé du smartphone au module Arduino int sauvegarde_positions1 [5]; int sauvegarde_positions2 [5]; int sauvegarde_positions3 [5]; int sauvegarde_positions4 [5]; int sauvegarde_positions5 [5]; int sauvegarde_positions6 [5]; int sauvegarde_positions7 [5]; int sauvegarde_positions8 [5]; int sauvegarde_positions9 [5];

// ángulo int; // ángulo de rotación (0 a 180)

//********************CONFIGURACIÓN*************************** ******** configuración vacía () {sauvegarde_positions1 [0] = sauvegarde_positions1 [1] = sauvegarde_positions1 [2] = sauvegarde_positions1 [3] = sauvegarde_positions1 [4] = 0; sauvegarde_positions2 [0] = sauvegarde_positions2 [1] = sauvegarde_positions2 [2] = sauvegarde_positions2 [3] = sauvegarde_positions2 [4] = 0; sauvegarde_positions3 [0] = sauvegarde_positions3 [1] = sauvegarde_positions3 [2] = sauvegarde_positions3 [3] = sauvegarde_positions3 [4] = 0; sauvegarde_positions4 [0] = sauvegarde_positions4 [1] = sauvegarde_positions4 [2] = sauvegarde_positions4 [3] = sauvegarde_positions4 [4] = 0; sauvegarde_positions5 [0] = sauvegarde_positions5 [1] = sauvegarde_positions5 [2] = sauvegarde_positions5 [3] = sauvegarde_positions5 [4] = 0; sauvegarde_positions6 [0] = sauvegarde_positions6 [1] = sauvegarde_positions6 [2] = sauvegarde_positions6 [3] = sauvegarde_positions6 [4] = 0; sauvegarde_positions7 [0] = sauvegarde_positions7 [1] = sauvegarde_positions7 [2] = sauvegarde_positions7 [3] = sauvegarde_positions7 [4] = 0; sauvegarde_positions8 [0] = sauvegarde_positions8 [1] = sauvegarde_positions8 [2] = sauvegarde_positions8 [3] = sauvegarde_positions8 [4] = 0; sauvegarde_positions9 [0] = sauvegarde_positions9 [1] = sauvegarde_positions9 [2] = sauvegarde_positions9 [3] = sauvegarde_positions9 [4] = 0; moteur.attach (cmd); // en relie l'objet au pin de commande moteur1.attach (cmd1); moteur2.attach (cmd2); moteur3.attach (cmd3); // moteur4.attach (cmd4); moteur5.attach (cmd5); moteur.write (6); ángulo = 6; moteur1.write (100); ángulo1 = 100; moteur2.write (90); moteur3.write (90); //moteur4.write(12); moteur5.write (90); ángulo = 6; ángulo1 = 100; ángulo2 = 90; ángulo3 = 90; ángulo5 = 90; Serial.begin (9600); // permettra de communiquer au module Bluetooth} // ******************** BOUCLE ****************** ***************** bucle vacío () {

// Serial.print ("ángulo");

//Serial.print(angle);Serial.print ("\ t"); Serial.print (ángulo1); Serial.print ("\ t"); Serial.print (ángulo2); Serial.print ("\ t "); Serial.print (ángulo3); Serial.print (" / t "); Serial.print (ángulo5); Serial.print (" / n ");

//Serial.print("angle ");

int i; w = depósito (); // en un receptor de información de un teléfono inteligente, la variable w switch (w) {caso 1: TouchDown_Release (); break; caso 2: TouchDown_Grab (); romper; caso 3: Base_Rotation (); romper; caso 4: Base_AntiRotation (); romper; caso 5: Rotación_cintura (); descanso; caso 6: Waist_AntiRotation (); romper; caso 7: Third_Arm_Rotation (); romper; caso 8: Third_Arm_AntiRotation (); romper; caso 9: Fourth_Arm_Rotation (); romper; caso 10: Fourth_Arm_AntiRotation (); romper; // caso 11: Fifth_Arm_Rotation (); break; // caso 12: Fifth_Arm_AntiRotation (); break; caso 21: Serial.print ("botón de caso 1"); chiffre_final = 1; sauvegarde_positions1 [0] = ángulo; sauvegarde_positions1 [1] = ángulo1; sauvegarde_positions1 [2] = ángulo2; sauvegarde_positions1 [3] = ángulo3; sauvegarde_positions1 [4] = ángulo5; Serial.println (sauvegarde_positions1 [1]); Serial.println (sauvegarde_positions1 [2]); Serial.println (sauvegarde_positions1 [3]); Serial.println (sauvegarde_positions1 [4]); rotura; caso 22: chiffre_final = 2; sauvegarde_positions2 [0] = ángulo; sauvegarde_positions2 [1] = ángulo1; sauvegarde_positions2 [2] = ángulo2; sauvegarde_positions2 [3] = ángulo3; sauvegarde_positions2 [4] = ángulo5; rotura; caso 23: chiffre_final = 3; sauvegarde_positions3 [0] = ángulo; sauvegarde_positions3 [1] = ángulo1; sauvegarde_positions3 [2] = ángulo2; sauvegarde_positions3 [3] = ángulo3; sauvegarde_positions3 [4] = ángulo5; romper; caso 24: chiffre_final = 4; sauvegarde_positions4 [0] = ángulo; sauvegarde_positions4 [1] = ángulo1; sauvegarde_positions4 [2] = ángulo2; sauvegarde_positions4 [3] = ángulo3; sauvegarde_positions4 [4] = ángulo5; rotura; caso 25: chiffre_final = 5; sauvegarde_positions5 [0] = ángulo; sauvegarde_positions5 [1] = ángulo1; sauvegarde_positions5 [2] = ángulo2; sauvegarde_positions5 [3] = ángulo3; sauvegarde_positions5 [4] = ángulo5; rotura; caso 26: chiffre_final = 6; sauvegarde_positions6 [0] = ángulo; sauvegarde_positions6 [1] = ángulo1; sauvegarde_positions6 [2] = ángulo2; sauvegarde_positions6 [3] = ángulo3; sauvegarde_positions6 [4] = ángulo5; rotura; caso 27: chiffre_final = 7; sauvegarde_positions7 [0] = ángulo; sauvegarde_positions7 [1] = ángulo1; sauvegarde_positions7 [2] = ángulo2; sauvegarde_positions7 [3] = ángulo3; sauvegarde_positions7 [4] = ángulo5; rotura; caso 28: chiffre_final = 8; sauvegarde_positions8 [0] = ángulo; sauvegarde_positions8 [1] = ángulo1; sauvegarde_positions8 [2] = ángulo2; sauvegarde_positions8 [3] = ángulo3; sauvegarde_positions8 [4] = ángulo5; rotura; caso 29: chiffre_final = 9; sauvegarde_positions9 [0] = ángulo; sauvegarde_positions9 [1] = ángulo1; sauvegarde_positions9 [2] = ángulo2; sauvegarde_positions9 [3] = ángulo3; sauvegarde_positions9 [4] = ángulo5; rotura;

caso 31: Serial.print ("31"); active_saving = 1; chiffre_final = 0; romper; // COMIENZO

caso 33: Serial.print ("33"); active_saving = 0; break; // BUTTON SAVE default: break; } if (w == 32) {Serial.print ("\ nReproduce / nChiffre final:"); Serial.print (chiffre_final); Serial.print ("\ n Sauvegarde posición 1: / n"); for (i = 0; i <5; i ++) {Serial.print (sauvegarde_positions1 ); Serial.print ("\ t");} Serial.print ("\ n Sauvegarde posición 2: / n"); for (i = 0; i <5; i ++) {Serial.print (sauvegarde_positions2 ); Serial.print ("\ t");} Serial.print ("\ n Sauvegarde posición 3: / n"); for (i = 0; i <5; i ++) {Serial.print (sauvegarde_positions3 ); Serial.print ("\ t");} for (i = 1; i <= chiffre_final; i ++) {Serial. print ("\ n / n COMIENZO / nEn bucle:"); Serial.print (i); Serial.print ("\ n"); switch (i) {caso 1: goto_moteur (* (sauvegarde_positions1)); delay (200); goto_moteur1 (* (sauvegarde_positions1 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions1 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions1 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions1 + 4)); retraso (200); rotura; caso 2: goto_moteur (* (sauvegarde_positions2)); retraso (200); goto_moteur1 (* (sauvegarde_positions2 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions2 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions2 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions2 + 4)); retraso (200); rotura; caso 3: goto_moteur (* (sauvegarde_positions3)); retraso (200); goto_moteur1 (* (sauvegarde_positions3 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions3 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions3 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions3 + 4)); retraso (200); rotura; caso 4: goto_moteur (* (sauvegarde_positions4)); retraso (200); goto_moteur1 (* (sauvegarde_positions4 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions4 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions4 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions4 + 4)); retraso (200); rotura; caso 5: goto_moteur (* (sauvegarde_positions5)); retraso (200); goto_moteur1 (* (sauvegarde_positions5 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions5 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions5 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions5 + 4)); retraso (200); rotura; caso 6: goto_moteur (* (sauvegarde_positions6)); retraso (200); goto_moteur1 (* (sauvegarde_positions6 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions6 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions6 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions6 + 4)); retraso (200); rotura; caso 7: goto_moteur (* (sauvegarde_positions7)); retraso (200); goto_moteur1 (* (sauvegarde_positions7 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions7 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions7 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions7 + 4)); retraso (200); rotura; caso 8: goto_moteur (* (sauvegarde_positions8)); retraso (200); goto_moteur1 (* (sauvegarde_positions8 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions8 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions8 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions8 + 4)); retraso (200); rotura; caso 9: goto_moteur (* (sauvegarde_positions9)); retraso (200); goto_moteur1 (* (sauvegarde_positions9 + 1)); retraso (200); goto_moteur2 (* (sauvegarde_positions9 + 2)); retraso (200); goto_moteur3 (* (sauvegarde_positions9 + 3)); retraso (200); goto_moteur5 (* (sauvegarde_positions9 + 4)); retraso (200); rotura; } Serial.print ("\ n *********************** FIN REPRODUCIR ***************** / n "); retraso (500); }} /*Serial.print ("debut / n"); Serial.print (sauvegarde_positions1 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [4]); Serial.print ("\ n"); Serial.print (sauvegarde_positions2 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [4]); Serial.print ("\ n"); Serial.print (sauvegarde_positions3 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [4]); Serial.print ("\ n"); Serial.print (sauvegarde_positions4 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [4]); Serial.print ("\ n");

Serial.print ("\ nfin / n"); * /

retraso (100); } // **************************** FONCIONES ****************** ******************

word recevoir () {// función permanente del recevoir l'information du smartphone

if (Serial.available ()) {w = Serial.read ();

Serial.flush ();

return w; }}

void goto_moteur (int angle_destination)

{while (angle_destination angle + step_angle) {Serial.print ("\ n -------------- * * * * * * -------------- ----\norte"); Serial.print ("angle_destination = / t"); Serial.print (angle_destination); Serial.print ("\ n angle1 = / t"); Serial.print (ángulo); if (angle_destination angle + step_angle) {ángulo = ángulo + step_angle; moteur.write (ángulo);} retardo (100); } moteur.write (ángulo_destino); } void goto_moteur1 (int angle_destination) {while (angle_destination angle1 + step_angle) {Serial.print ("\ n -------------- * * * * * * ------- -----------\norte"); Serial.print ("angle_destination = / t"); Serial.print (angle_destination); Serial.print ("\ n ángulo2 = / t"); Serial.print (ángulo1); if (angle_destination angle1 + step_angle) {angle1 + = step_angle; moteur1.write (ángulo1);;} retraso (100); } moteur1.write (ángulo_destino); } void goto_moteur2 (int angle_destination) {

while (angle_destination angle2 + step_angle)

{Serial.print ("\ n -------------- * * * * * * ------------------ / n"); Serial.print ("angle_destination = / t"); Serial.print (ángulo_destino); Serial.print ("\ n ángulo3 = / t"); Serial.print (ángulo2); if (angle_destination angle2 + step_angle) {angle2 + = step_angle; moteur2.write (ángulo2);} retardo (100); } moteur2.write (ángulo_destino); } void goto_moteur3 (int angle_destination) {

while (angle_destination angle3 + step_angle)

{Serial.print ("\ n -------------- * * * * * * ------------------ / n"); Serial.print ("angle_destination = / t"); Serial.print (angle_destination); Serial.print ("\ n angle4 = / t"); Serial.print (angle3); if (angle_destination angle3 + step_angle) {angle3 + = step_angle; moteur3.write (ángulo3);} retardo (100); } moteur3.write (ángulo_destino); } void goto_moteur5 (int angle_destination) {

while (angle_destination angle5 + step_angle)

{Serial.print ("\ n -------------- * * * * * * ------------------ / n"); Serial.print ("angle_destination = / t"); Serial.print (angle_destination); Serial.print ("\ n angle5 = / t"); Serial.print (angle5); if (angle_destination angle5 + step_angle) {angle5 + = step_angle; moteur5.write (angle5);} retardo (100); } moteur5.write (ángulo_destino); }

void TouchDown_Release () // Liberación del botón TouchDown

{if (angle5 <180) {angle5 = angle5 + step_angle_mini; } moteur5.write (ángulo5); }

void TouchDown_Grab () // Botón de agarre TouchDown

{if (angle5> 0) {angle5 = angle5-step_angle_mini; } moteur5.write (ángulo5); } void Base_Rotation () {if (ángulo 0) {ángulo = ángulo-ángulo_paso; } más ángulo = 0; moteur.write (ángulo); } void Waist_Rotation () {if (ángulo1 20) {ángulo1 = ángulo1-ángulo_paso; } más ángulo1 = 20; moteur1.write (ángulo1); } void Third_Arm_Rotation () {if (ángulo2 0) {ángulo2 = ángulo2-ángulo_paso; } moteur2.write (ángulo2); } void Fourth_Arm_Rotation () {if (angle3 = 0) {angle3 = angle3-step_angle_mini; } moteur3.write (ángulo3); }

Paso 6: ¡Eso es

Gracias por vernos, espero que lo hayan apreciado.

Si te gustó este Instructable, ¡seguro que puedes visitarnos para obtener más información! =)

Recomendado: