Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Yuav Tsum Tau:-
- Kauj Ruam 2: Ua Caj Npab:-
- Kauj Ruam 3: Ua Kev Sib Txuas:-
- Kauj ruam 4: Coding:-
- Kauj Ruam 5: Xeem:-
Video: Yooj Yim & Ntse Robotic Arm Siv Arduino !!!: 5 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hauv cov lus qhia no kuv yuav ua caj npab yooj yim. Qhov ntawd yuav raug tswj siv tus tswv caj npab. Lub caj npab yuav nco txog kev txav chaw thiab ua si sib law liag. Lub tswv yim tsis yog qhov tshiab Kuv tau txais Lub Tswv Yim los ntawm "mini robotic arm -by Stoerpeak" Kuv xav ua qhov no tau ntev, tab sis rov qab los ces kuv tau lig noob thiab tsis muaj kev paub txog programming. Tam sim no thaum kawg kuv tab tom tsim ib qho, Khaws nws yooj yim, pheej yig thiab sib koom nrog koj txhua tus.
Yog li cia peb pib….
Kauj Ruam 1: Yam Koj Yuav Tsum Tau:-
Nov yog cov npe khoom koj yuav xav tau:-
1. Servo motors x 5 Txuas rau Asmeskas:- https://amzn.to/2OxbSH7Link rau Tebchaws Europe:-
2. Potentiometers x 5 (Kuv tau siv 100k.) Txuas rau Asmeskas:- https://amzn.to/2ROjhDMLink rau Europe:-
3. Arduino UNO. (Koj tuaj yeem siv Arduino Nano ib yam nkaus) Txuas rau Asmeskas:- https://amzn.to/2DBbENWLink rau Tebchaws Europe:-
4. Cov qhob cij. (Kuv qhia cov khoom siv no) Txuas rau Asmeskas:- https://amzn.to/2Dy86w4Link rau Tebchaws Europe:-
5. Roj teeb. (yeem, kuv siv 5v adapter)
6. Cardboard/Ntoo/Sun-board/acrylic dab tsi puas muaj los yog nrhiav tau yooj yim.
Thiab koj tseem yuav xav tau Arduino IDE teeb tsa.
Kauj Ruam 2: Ua Caj Npab:-
Ntawm no kuv tau siv Popsicle sticks los ua caj npab. Koj tuaj yeem siv cov khoom siv uas muaj rau koj. Thiab koj tuaj yeem sim sib txawv cov qauv siv los ua kom caj npab zoo dua. kuv tsim tsis ruaj khov.
Kuv tsuas yog siv daim kab xev ob tog los lo cov servos rau Popsicle lo thiab txuas lawv siv cov ntsia hlau.
Txog Tus Xib Hwb caj npab Kuv tau muab lub zog muaj zog rau popsicle sticks thiab ua caj npab.
Kev xa mus rau cov duab yuav muab rau koj Lub Tswv Yim Zoo.
Kuv tau teeb tsa txhua yam ntawm A4 daim ntawv loj canvas siv ua lub hauv paus.
Kauj Ruam 3: Ua Kev Sib Txuas:-
Hauv qib no peb yuav ua txhua qhov kev sib txuas tsim nyog, Xa mus rau cov duab saum toj no.
- Ua ntej txuas txhua qhov kev pabcuam ua haujlwm sib txuas mus rau lub zog xa khoom (Cov Hlau liab rau +ve thiab Dub lossis Xim Hlau Hlau rau Gnd)
- Tom ntej txuas cov kab hluav taws xob piv txwv li Cov Hlau lossis Txiv Kab Ntxwv rau PWM tus pin ntawm arduino.
- Tam sim no txuas cov potentiometers rau +5v thiab Gnd ntawm arduino ua ke.
- Txuas nruab nrab lub davhlau ya nyob twg rau Analog tus pin ntawm ardunio.
Ntawm no Digital Pins 3, 5, 6, 9 & 10 tau siv los tswj cov kev pabcuam
Analog Pins A0 rau A4 yog siv rau kev nkag los ntawm Potentiometers.
Cov servo txuas nrog tus pin 3 yuav raug tswj los ntawm potentiometer txuas nrog A0
Servo txuas nrog tus pin 5 yuav raug tswj los ntawm lauj kaub ntawm A1, thiab ntxiv rau….
Nco tseg:- Txawm hais tias Servos tsis siv los ntawm arduino, Nco ntsoov txuas Gnd ntawm servos rau arduino lossis lwm yam caj npab yuav tsis ua haujlwm.
Kauj ruam 4: Coding:-
Lub Logic ntawm cov cai no yooj yim yooj yim qhov txiaj ntsig ntawm potentiometers tau khaws cia hauv ib qho kab ntawv cov ntaub ntawv tom qab ntawd hla kev siv lub voj thiab cov servos ua cov kauj ruam raws li qhov muaj txiaj ntsig. Koj tuaj yeem tshawb xyuas qhov kev qhia no kuv siv rau kev siv "Arduino Potentiometer Servo Control & Memory"
Code:- (Rub tawm cov ntawv txuas nrog hauv qab no.)
Ua ntej peb yuav tshaj tawm txhua qhov kev hloov pauv tsim nyog thoob ntiaj teb yog li peb tuaj yeem siv lawv thoob plaws hauv txoj haujlwm. Tsis xav tau kev piav qhia tshwj xeeb rau qhov no
#suav nrog
// Cov Hom Phiaj Servo Servo_0; Servo Servo_1; Servo Servo_2; Servo Servo_3; Servo Servo_4; // Potentiometer Objects int Pot_0; koj Pot_1; koj Pot_2; koj Pot_3; koj Pot_4; // Hloov pauv los khaws Servo Txoj Haujlwm int Servo_0_Pos; int Servo_1_Pos; int Servo_2_Pos; int Servo_3_Pos; int Servo_4_Pos; // Hloov pauv los khaws cov haujlwm dhau los qhov tseem ceeb int Prev_0_Pos; int Prev_1_Pos; int Prev_2_Pos; int Prev_3_Pos; int Prev_4_Pos; // Hloov pauv los khaws tam sim no txoj haujlwm tseem ceeb int Current_0_Pos; int Current_1_Pos; int Tam sim no_2_Pos; int Current_3_Pos; int Tam sim no_4_Pos; int Servo_Position; // Khw lub kaum sab xis int Servo_Number; // Khw muag khoom tsis muaj servo int Cia [600]; // Array khaws cov ntaub ntawv (Ua kom loj qhov loj yuav siv ntau lub cim xeeb) int Index = 0; // Array index pib los ntawm 0 txoj haujlwm char cov ntaub ntawv = 0; // sib txawv los khaws cov ntaub ntawv los ntawm cov ntawv nkag.
Tam sim no peb yuav sau qhov teeb tsa ua haujlwm, qhov uas peb teeb tsa tus pin thiab lawv cov haujlwm. Nov yog lub luag haujlwm tseem ceeb uas ua rau ua ntej
void teeb tsa ()
{Serial.begin (9600); // Rau kev sib txuas lus sib txuas ntawm arduino thiab IDE. // Cov khoom siv Servo tau txuas rau PWM pins. Servo_0.attach (3); Servo_1.attach (5); Servo_2.attach (6); Servo_3.attach (9); Servo_4.attach (10); // Servos tau teeb tsa rau 100 txoj haujlwm ntawm qhov pib. Servo_0.write (100); Servo_1.write (100); Servo_2.write (100); Servo_3.write (100); Servo_4.write (100); Serial.println ("Nias 'R' Sau thiab 'P' los ua si"); }
Tam sim no peb yuav tsum nyeem qhov tseem ceeb ntawm cov peev txheej siv Analog Input pins thiab daim ntawv qhia lawv kom tswj tau servos. For qhov no peb yuav txhais lub luag haujlwm thiab npe nws Map_Pot ();, koj tuaj yeem sau nws txhua yam uas koj xav tau nws yog tus neeg siv txhais ua haujlwm
tsis muaj dab tsi Map_Pot ()
{ / * Cov servos tig ntawm 180 degrees tab sis siv nws rau qhov txwv tsis yog lub tswv yim zoo vim nws ua rau servos buzz tsis tu ncua uas yog kev thab plaub yog li peb txwv qhov servo txav ntawm: 1-179 * / Pot_0 = analogRead (A0); // Nyeem cov tswv yim los ntawm lub lauj kaub thiab khaws nws hauv Qhov Hloov Pauv_0. Servo_0_Pos = daim ntawv qhia (Pot_0, 0, 1023, 1, 179); // Daim ntawv qhia servos raws li tus nqi nruab nrab ntawm 0 txog 1023 Servo_0.write (Servo_0_Pos); // Tsiv lub servo mus rau txoj haujlwm ntawd. Pot_1 = analogRead (A1); Servo_1_Pos = daim ntawv qhia (Pot_1, 0, 1023, 1, 179); Servo_1.write (Servo_1_Pos); Pot_2 = analogRead (A2); Servo_2_Pos = daim ntawv qhia (Pot_2, 0, 1023, 1, 179); Servo_2.write (Servo_2_Pos); Pot_3 = analogRead (A3); Servo_3_Pos = daim ntawv qhia (Pot_3, 0, 1023, 1, 179); Servo_3.write (Servo_3_Pos); Pot_4 = analogRead (A4); Servo_4_Pos = daim ntawv qhia (Pot_4, 0, 1023, 1, 179); Servo_4.write (Servo_4_Pos); }
Tam sim no peb yuav sau ua haujlwm voj:
void lub voj ()
{Map_Pot (); // Muaj nuj nqi hu kom nyeem lub lauj kaub qhov tseem ceeb thaum (Serial.available ()> 0) {data = Serial.read (); yog (cov ntaub ntawv == 'R') Serial.println ("Cov Ntawv Teev Tseg …"); yog (cov ntaub ntawv == 'P') Serial.println ("Ua Si Cov Ntawv Sau Tseg …"); } yog (cov ntaub ntawv == 'R') // Yog tias 'R' nkag mus, pib sau cia. {// Khaws qhov tseem ceeb hauv qhov sib txawv Prev_0_Pos = Servo_0_Pos; Prev_1_Pos = Servo_1_Pos; Prev_2_Pos = Servo_2_Pos; Prev_3_Pos = Servo_3_Pos; Prev_4_Pos = Servo_4_Pos; Daim ntawv_Pot (); // Daim ntawv qhia ua haujlwm tau rov qab los rau kev sib piv yog (abs (Prev_0_Pos == Servo_0_Pos)) // qhov muaj txiaj ntsig tau los ntawm kev sib piv {Servo_0.write (Servo_0_Pos); // Yog tias qhov tseem ceeb sib xws servo tau hloov chaw yog (Current_0_Pos! = Servo_0_Pos) // Yog qhov ntsuas tsis phim {Storage [Index] = Servo_0_Pos + 0; // Tus nqi tau ntxiv rau array Index ++; // Index tus nqi nce ntxiv los ntawm 1} Current_0_Pos = Servo_0_Pos; } /* Zoo ib yam li kev sib piv tus nqi tau ua tiav rau txhua qhov kev pabcuam, +100 tau ntxiv txhua qhov rau nkag raws li tus nqi sib txawv. */ yog (abs (Prev_1_Pos == Servo_1_Pos)) {Servo_1.write (Servo_1_Pos); yog (Current_1_Pos! = Servo_1_Pos) {Storage [Index] = Servo_1_Pos + 100; Index ++; } Current_1_Pos = Servo_1_Pos; } yog (abs (Prev_2_Pos == Servo_2_Pos)) {Servo_2.write (Servo_2_Pos); yog (Current_2_Pos! = Servo_2_Pos) {Storage [Index] = Servo_2_Pos + 200; Index ++; } Current_2_Pos = Servo_2_Pos; } yog (abs (Prev_3_Pos == Servo_3_Pos)) {Servo_3.write (Servo_3_Pos); yog (Current_3_Pos! = Servo_3_Pos) {Storage [Index] = Servo_3_Pos + 300; Index ++; } Tam sim no_3_Pos = Servo_3_Pos; } yog (abs (Prev_4_Pos == Servo_4_Pos)) {Servo_4.write (Servo_4_Pos); yog (Current_4_Pos! = Servo_4_Pos) {Storage [Index] = Servo_4_Pos + 400; Index ++; } Tam sim no_4_Pos = Servo_4_Pos; } / * Qhov muaj txiaj ntsig tau luam tawm ntawm tus saib xyuas, '\ t' yog rau tso saib qhov tseem ceeb hauv daim ntawv hom * / Serial.print (Servo_0_Pos); Serial.print ("\ t"); Serial.print (Servo_1_Pos); Serial.print ("\ t"); Serial.print (Servo_2_Pos); Serial.print ("\ t"); Serial.print (Servo_3_Pos); Serial.print ("\ t"); Serial.println (Servo_4_Pos); Serial.print ("Index ="); Serial.println (Index); ncua (50); } yog (cov ntaub ntawv == 'P') // YOG 'P' nkag mus, Pib ua si kaw suab. {rau (int i = 0; i <Index; i ++) // Hla qhov array siv rau lub voj {Servo_Number = Cia /100; // Pom tus naj npawb ntawm servo Servo_Position = Cia % 100; // Pom txoj haujlwm ntawm servo hloov (Servo_Number) {rooj plaub 0: Servo_0.write (Servo_Position); tawg; rooj plaub 1: Servo_1.write (Servo_Position); tawg; rooj plaub 2: Servo_2.write (Servo_Position); tawg; rooj plaub 3: Servo_3.write (Servo_Position); tawg; rooj plaub 4: Servo_4.write (Servo_Position); tawg; } ncua (50); }}}
Thaum cov cai tau npaj tiav, Tam sim no rub nws mus rau arduino board
Ntse caj npab tau npaj ua haujlwm. Kev ua haujlwm tseem tsis tau zoo li qhov ua los ntawm Stoerpeak.
Yog tias koj tuaj yeem ua tus lej zoo dua lossis muaj lus qhia rau kuv thov qhia rau kuv paub hauv ntu lus saib.
Nrog qhov tau hais, Cia peb txav mus rau kev sim….
Kauj Ruam 5: Xeem:-
Tom qab xa cov cai mus rau pawg thawj coj ua tiav, Qhib 'Serial Monitor' koj tuaj yeem pom nws hauv Cov Cuab Yeej xaiv. Thaum Serial monitor pib lub arduino yuav rov pib dua. Tam sim no koj tuaj yeem tswj hwm caj npab neeg hlau siv tus tswv caj npab. Tab sis tsis muaj dab tsi raug kaw.
Txhawm rau pib kaw, Nkag mus rau 'R' hauv tus saib xyuas tam sim no koj tuaj yeem ua qhov txav uas koj xav sau.
Tom qab qhov kev txav mus los tiav koj yuav tsum nkag mus rau 'P' txhawm rau ua si qhov kev kaw tseg. Cov servos yuav txuas ntxiv ua qhov txav mus tsuav lub rooj tsavxwm tsis rov pib dua.
Pom zoo:
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: 4 Cov Kauj Ruam (nrog Duab)
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: Hnub no kuv xav qhia yuav ua li cas kom pom lub teeb pom kev zoo los ntawm lub zog xa hluav taws xob tsis siv hluav taws xob los ntawm tus txhuam txhuam hniav thiab lub tshuab solenoid valve coils uas tau khaws los ntawm scrapyard.Ua ntej pib, thov saib cov vis dis aus hauv qab no:
Kev Ceeb Toom Hluav Taws Xob Siv Arduino [Hauv Qhov Yooj Yim Yooj Yim Yooj Yim]: 3 Kauj Ruam
Kev Ceeb Toom Hluav Taws Xob Siv Arduino [Hauv Ob Qes Yooj Yim Yooj Yim]: Puas yog koj tab tom nrhiav kom ua txoj haujlwm yooj yim thiab nthuav nrog Arduino uas nyob rau tib lub sijhawm tuaj yeem muaj txiaj ntsig tiag tiag thiab muaj peev xwm cawm txoj sia? tej yam tshiab thiab tshiab. Hauv kab ntawv no peb mus
DIY MusiLED, Music Synchronized LEDs Nrog Ib-nias Windows & Linux Application (32-ntsis & 64-ntsis). Yooj Yim Rov Ua Dua, Siv Yooj Yim, Yooj Yim rau Chaw Nres Nkoj: 3 Kauj Ruam
DIY MusiLED, Music Synchronized LEDs Nrog Ib-nias Windows & Linux Application (32-ntsis & 64-ntsis). Yooj Yim Rov Ua Dua, Siv Yooj Yim, Yooj Yim rau Chaw Nres Nkoj: Qhov haujlwm no yuav pab koj txuas 18 LEDs (6 Liab + 6 Xiav + 6 Daj) rau koj lub Rooj Tswjhwm Saib Arduino thiab txheeb xyuas koj lub khoos phis tawj Lub Suab Suab Lub suab lub sijhawm tiag tiag thiab xa lawv mus rau cov LEDs kom pom lawv raws li qhov cuam tshuam (Snare, High Hat, Kick)
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS YOOJ YIM: 4 Cov Kauj Ruam
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS: Nyob zoo txhua tus hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas kom yooj yim " SOIL DRYNESS SENSOR ". Qhuav ntawm cov av tau txheeb xyuas siv qhov taw qhia coj. Lub teeb ci wi
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: 4 Cov Kauj Ruam
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: Nyeem … lub npe