Mục lục:

Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn): 5 bước
Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn): 5 bước

Video: Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn): 5 bước

Video: Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn): 5 bước
Video: 3 TÍNH NĂNG phải bật ngay trên iPhone 14 Pro #shorts 2024, Tháng bảy
Anonim
Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn)
Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn)
Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn)
Cánh tay điều khiển bằng điện thoại thông minh giá rẻ (+ Vị trí lưu tùy chọn)

Dự án

Lái một cánh tay robot được điều khiển bằng điện thoại thông minh sử dụng thiết bị bluetooth.

Phần thưởng chế độ: chúng tôi có một nút cho phép arduino ghi nhớ một vị trí. Bất cứ khi nào chúng ta muốn, chúng ta có thể đến vị trí đã lưu này bằng một nút khác.

NS

LE PROJET

Commander un bras robotisé construit à partir de carton et de servo-moteurs.

Le bras sera consué d'une pince qui doit pouvoir prendre et poser un objet.

Trên commandera le bras par smartphone qui Communiquera en bluetooth à l'arduino.

Chế độ thưởng: Áo ngực Un bouton nous permettra de sauvegarder. Lorsque l'on le souhaitera, nous pourrons retourner à la position sauvegardée.

Bước 1: Vật liệu bạn cần

Vật liệu bạn cần
Vật liệu bạn cần

EN

1 Arduino UNO

4 động cơ servo SG90 (9g, mô-men xoắn: 1kg.cm)

1 Động cơ bước 5V 24BYJ48 (mô-men xoắn: 39mN.m)

1 trình điều khiển cho động cơ bước DRV8825

1 báo động 9V + 6V cho động cơ

1 mô-đun Bluetooth HC-06

Keo súng lục, thùng carton, dây, elasctic

NS

1 mô-đun Arduino Uno

4 servo-moteurs SG90 9g (cặp đôi: 1kg.cm)

1 moteur pas-à-pas 5V (39mN.m) 24BYJ48

1 trình điều khiển moteur pap DRV8825

1 alimentation 9V pour l'arduino et 6V pour les moteurs

1 mô-đun Bluetooth HC-06 Pistolet à colle, thùng carton, kết nối fils, élastique

Bước 2: THIẾT LẬP

CÀI ĐẶT
CÀI ĐẶT

NS

ETAPE 1: Mô-đun Bluetooth Le mô-đun bluetooth (HC-06) est connecté de la manière suivante:

Rx Tx

Tx Rx

GND GND

VCC + 5V

Il va permettre d'établir la Communication entre l'Arduino et le smartphone, qua la voie Série (9600).

ETAPE 2: Le moteur pas à pas 24BYJ48

Nous avons connecté le moteur bipolaire pas à pas 24BYJ48 à con trai lái xe liên kết cạnh tranh le mạch ULN2003. I đủ điều kiện để kết nối les đầu vào INx (x = 1, 2, 3, 4) aux sorties digitales de l'arduino. Trên trình điều khiển alimentera le en + 5V.

Pour coder, nous useiserons la bibliothèque Stepper.h, ce qui nous permet de Commander facilement le moteur en lui donnant la vitesse: nom.setSpeed (vitesse), ainsi que le pas désiré: nom.step (+ ou- pas)

ETAPE 3: Les servo-moteurs SG90

Les servos moteurs se commandent facilement. I’m de brancher le fil rouge au + 5V, le noir à la masse et le fil restant à une sortie PWM de l'arduino. Trên choisira ensuite l'angle du servo qua la PWM (0 à 255).

Nous useiserons la bibliothèque servo.h pour chỉ huy facilement le servo. Tout d'abord, trên Initialera le servo par son nom: Servo nom_servo, puis on luireekachera la commande PWM: nom_servo.attach (pin choisi). Enfin, trên commandera l'angle voulu: nom_servo.write (angle de 0 à 180).

ETAPE 4: Fabriquer le support Le support à été fabriqué en carton. Tháng tư, éalisé la base sur laquelle va tourner le bras et ou sera mis le moteur pas à pas, nous avons collé les servos moteurs à du carton pour donner la forme final. La pince à été créée à partir de bâton de glace et fonctionne avec un élastique

Bước 3: Mã

Mật mã
Mật mã

// 2017-02-24 - Chương trình C - Commande de plusieurs servo moteurs dynamiciques par smartphone, qua bluetooth - Nhà phát minh ứng dụng 2 useisé - Carte Arduino (ici UNO), mô-đun Bluetooth // Ce chương trình a pour objectif de: //// Le moteur (fils 1 2 3 4) est branché sur les sorties 8 12 10 11 de l'Arduino (et sur GND, + V) Stepper small_stepper (STEPS, 8, 10, 12, 11); // ******************** KHAI BÁO *************************** * đại diện từ; // mot envoyé du module Arduino au smartphone int cmd = 3; // biến commande du servo moteur (troisième fil (cam, jaune)) Servo moteur; // trên définit notre servomoteur int cmd1 = 5; Servo moteur1; Servo moteur2; Servo moteur3; int cmd2 = 9; int cmd3 = 6; int angle2, angle3; góc int; int góc1; int pas; int r, r1, r2, r3; int enregistrer; từ w; // biến envoyé du smartphone au module Arduino int angle; // góc quay (0 a 180) // ******************** CÀI ĐẶT ***************** ****************** void setup () {moteur.attach (cmd); // vào giải phóng l'objet au pin de commande moteur1.attach (cmd1); moteur2.attach (cmd2); moteur3.attach (cmd3); moteur.write (12); moteur1.write (23); Serial.begin (9600); // permettra de Communiquer au module Bluetooth} // ******************** BOUCLE ****************** ***************** void loop () {Collectvoir (); // trên varisvoir une information du smartphone, la variable w if (w == 206) reproduire (); // va nous permettre de reproduire la position enregistrée if (w == 205) enregistrer = 1; // va nous permettre d'enregistrer la valeur des servos moteurs lorsque l'on apuiera sur un bouton if (w == 204) enregistrer = 0; for (int k = 100; k <151; k ++) {if (w == k) {angle2 = map (k, 100, 150, 0, 180); moteur2.write (angle2); if (enregistrer == 1) r2 = angle2; }} for (int j = 151; j <201; j ++) {if (w == j) {angle3 = map (j, 151, 200, 0, 150); moteur3.write (angle3); if (enregistrer == 1) r3 = angle3; }} for (int i = 0; i <34; i ++) {if (w == i) {angle = map (i, 0, 34, 0, 70); moteur.write (góc); if (enregistrer == 1) r = angle; }} for (int l = 34; l <= 66; l ++) {if (w == l) {angle1 = map (l, 34, 66, 90, 0); moteur1.write (angle1); if (enregistrer == 1) r1 = angle1; }} for (int m = 67; m <= 99; m ++) {if (w == m) {if (w86) {small_stepper.setSpeed (80); small_stepper.step (-5);} else small_stepper.step (0); }}} // **************************** CÁC PHÂN TÍCH **************** ******************** void reproduire () // fonction permettant de reproduire la position sauvegardée {moteur2.write (r2); moteur.write (r); moteur1. ghi (r1); moteur3.write (r3); } void refvoir () {// fonction permettant de Revenuevoir l'information du smartphone if (Serial.available ()) {w = Serial.read (); Serial.flush (); }} - Connecter le Servo moteur + module bluetooth au module arduino // - Envoyer un mot / cluster / nombre au smartphone // - Recevoir une commande qua smartphone // Program réalisé par Techno_Fabrik // ********* *********** BIBLIOTHEQUES **************************** #include # include // bibliothèque permettant d ' useiser les commandes pour servomoteurs facilement #include

Bước 4: ỨNG DỤNG trên điện thoại thông minh (Được tạo trên APP Inventor 2)

ỨNG DỤNG dành cho điện thoại thông minh (Được tạo trên APP Inventor 2)
ỨNG DỤNG dành cho điện thoại thông minh (Được tạo trên APP Inventor 2)

Bước 5: Hiện thực hóa video

Cảm ơn bạn đã xem.!

Để biết thêm, hãy xem trang web của chúng tôi:

Hoặc theo dõi chúng tôi trên Google +:

Cảm ơn !

Đề xuất: