Cov txheej txheem:
- Kauj Ruam 1: Yuav Tsum Kho Vajtse:
- Kauj ruam 2: Khoos phis tawj sib txuas:
- Kauj Ruam 3: Txoj Cai rau Tsab Ntawv Teev Npe:
- Kauj Ruam 4: Cov ntawv thov:
Video: Motion Tracking Siv MPU-6000 thiab Arduino Nano: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
MPU-6000 yog 6-Axis Motion Tracking Sensor uas muaj 3-Axis accelerometer thiab 3-Axis gyroscope kos rau hauv. Qhov ntsuas no muaj peev xwm taug qab qhov tseeb ntawm qhov chaw thiab qhov chaw ntawm ib yam khoom hauv lub dav hlau 3-dimensional. Nws tuaj yeem ua haujlwm hauv cov kab ke uas xav tau kev tshuaj xyuas txoj haujlwm mus rau qhov siab tshaj plaws.
Hauv qhov kev qhia no kev cuam tshuam ntawm MPU-6000 sensor module nrog arduino nano tau piav qhia. Txhawm rau nyeem qhov tseem ceeb ntawm kev nrawm thiab tig lub kaum ntse ntse, peb tau siv arduino nano nrog I2c adapter. Qhov I2C adapter ua rau kev txuas mus rau lub sensor module tau yooj yim thiab ntseeg tau ntau dua.
Kauj Ruam 1: Yuav Tsum Kho Vajtse:
Cov ntaub ntawv uas peb xav tau kom ua tiav peb lub hom phiaj suav nrog cov khoom siv hauv qab no:
1. MPU-6000
2. Arduino Nano
3. I2C Cable
4. I2C Shield rau arduino nano
Kauj ruam 2: Khoos phis tawj sib txuas:
Tshooj khoos phis tawj sib txuas ntu piav qhia qhov txuas txuas uas xav tau ntawm lub sensor thiab arduino nano. Ua kom muaj kev sib txuas raug yog qhov tseem ceeb xav tau thaum ua haujlwm ntawm ib qho system rau qhov xav tau cov zis. Yog li, qhov xav tau kev sib txuas yog raws li hauv qab no:
MPU-6000 yuav ua haujlwm dhau I2C. Nov yog qhov piv txwv kab hluav taws xob daim duab, qhia txog yuav ua li cas xaim txhua lub interface ntawm lub sensor.
Tawm-ntawm-lub thawv, lub rooj tsavxwm tau teeb tsa rau I2C interface, zoo li peb pom zoo siv qhov kev sib txuas no yog tias koj tsis ntseeg lwm yam.
Txhua yam koj xav tau yog plaub lub xov hlau! Tsuas yog plaub qhov kev sib txuas xav tau Vcc, Gnd, SCL thiab SDA tus pin thiab cov no txuas nrog kev pab ntawm I2C cable.
Cov kev sib txuas no tau qhia hauv cov duab saum toj no.
Kauj Ruam 3: Txoj Cai rau Tsab Ntawv Teev Npe:
Cia pib nrog tus lej arduino tam sim no.
Thaum siv lub ntsuas qhov ntsuas nrog arduino, peb suav nrog Wire.h lub tsev qiv ntawv. "Hlau" lub tsev qiv ntawv muaj cov haujlwm uas pab txhawb i2c kev sib txuas lus ntawm lub sensor thiab pawg thawj coj saib arduino.
Tag nrho cov cai arduino tau muab hauv qab no kom yooj yim ntawm cov neeg siv:
#suav nrog
// MPU-6000 I2C chaw nyob yog 0x68 (104)
#define Ntxiv 0x68
void teeb tsa ()
{
// Pib I2C kev sib txuas lus raws li tus Xib Hwb
Hlau.begin ();
// Initialise serial communication, teeb baud tus nqi = 9600
Serial.begin (9600);
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv lub gyroscope teeb tsa sau npe
Hlau.write (0x1B);
// Qhov ntsuas tag nrho = 2000 dps
Hlau.write (0x18);
// Nres I2C kev xa mus
Wire.endTransmission ();
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv cov ntawv teev npe kev ntsuas tus ntsuas
Hlau.write (0x1C);
// Tag nrho cov nplai ntau = +/- 16g
Hlau.write (0x18);
// Nres I2C kev xa mus
Wire.endTransmission ();
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv lub hwj chim tswj npe
Hlau.write (0x6B);
// PLL nrog xGyro siv
Hlau.write (0x01);
// Nres I2C kev xa mus
Wire.endTransmission ();
ncua (300);
}
void lub voj ()
{
unsigned int cov ntaub ntawv [6];
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv cov ntaub ntawv sau npe
Hlau.write (0x3B);
// Nres I2C kev xa mus
Wire.endTransmission ();
// Thov 6 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 6);
// Nyeem 6 byte ntawm cov ntaub ntawv
yog (Wire.available () == 6)
{
cov ntaub ntawv [0] = Wire.read ();
cov ntaub ntawv [1] = Wire.read ();
cov ntaub ntawv [2] = Wire.read ();
cov ntaub ntawv [3] = Wire.read ();
cov ntaub ntawv [4] = Wire.read ();
cov ntaub ntawv [5] = Wire.read ();
}
// Hloov cov ntaub ntawv
int xAccl = cov ntaub ntawv [0] * 256 + cov ntaub ntawv [1];
int yAccl = cov ntaub ntawv [2] * 256 + cov ntaub ntawv [3];
int zAccl = cov ntaub ntawv [4] * 256 + cov ntaub ntawv [5];
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv cov ntaub ntawv sau npe
Hlau.write (0x43);
// Nres I2C kev xa mus
Wire.endTransmission ();
// Thov 6 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 6);
// Nyeem 6 byte ntawm cov ntaub ntawv
yog (Wire.available () == 6)
{
cov ntaub ntawv [0] = Wire.read ();
cov ntaub ntawv [1] = Wire.read ();
cov ntaub ntawv [2] = Wire.read ();
cov ntaub ntawv [3] = Wire.read ();
cov ntaub ntawv [4] = Wire.read ();
cov ntaub ntawv [5] = Wire.read ();
}
// Hloov cov ntaub ntawv
int xGyro = cov ntaub ntawv [0] * 256 + cov ntaub ntawv [1];
int yGyro = cov ntaub ntawv [2] * 256 + cov ntaub ntawv [3];
int zGyro = cov ntaub ntawv [4] * 256 + cov ntaub ntawv [5];
// Cov ntaub ntawv tso tawm rau tus saib xyuas
Serial.print ("Ua kom nrawm hauv X-Axis:");
Serial.println (xAccl);
Serial.print ("Kev nrawm hauv Y-Axis:");
Serial.println (yAccl);
Serial.print ("Ua kom nrawm hauv Z-Axis:");
Serial.println (zAccl);
Serial.print ("X-Axis ntawm kev sib hloov:");
Serial.println (xGyro);
Serial.print ("Y-Axis ntawm kev sib hloov:");
Serial.println (yGyro);
Serial.print ("Z-Axis ntawm kev sib hloov:");
Serial.println (zGyro);
ncua (500);
}
Hauv cov tsev qiv ntawv xaim Wire.write () thiab Wire.read () yog siv los sau cov lus txib thiab nyeem cov ntawv tso tawm.
Serial.print () thiab Serial.println () yog siv los tso saib cov zis ntawm lub sensor ntawm cov saib xyuas ntawm Arduino IDE.
Qhov tso tawm ntawm lub ntsuas hluav taws xob tau qhia hauv daim duab saum toj no.
Kauj Ruam 4: Cov ntawv thov:
MPU-6000 yog lub suab ntsuas lub suab ntsuas, uas pom nws daim ntawv thov hauv kev sib cuam tshuam ntawm cov xov tooj ntawm tes thiab ntsiav tshuaj. Hauv cov xov tooj ntawm tes cov cuab yeej no tuaj yeem ua haujlwm hauv cov ntawv thov xws li kev hais lus taw tes rau kev siv thiab tswj lub xov tooj, txhim kho kev ua si, ua kom muaj kev muaj tiag, ua kom pom cov duab pom thiab pom, thiab taug kev thiab tsheb nqaj hlau. MotionTracking thev naus laus zis tuaj yeem hloov kho lub xov tooj thiab cov ntsiav tshuaj rau hauv cov cuab yeej ntse 3D uas tuaj yeem siv rau hauv cov ntawv thov xws li kev saib xyuas kev noj qab haus huv thiab kev tawm dag zog mus rau cov kev pabcuam raws qhov chaw.
Pom zoo:
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Siv Dua: 6 Cov Kauj Ruam
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Los Siv Rov Los: " Suab paj nruag yog cov lus thoob ntiaj teb ntawm tib neeg. Thiab qhov zoo tshaj plaws-lawv tsis tau them kuv ib dime. Txhua yam nyob rau hauv no pr
Txawb Xov Tooj Siv Yooj Yim Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: 14 Cov Kauj Ruam (nrog Duab)
Kev Siv Xov Tooj Ntawm Lub Xov Tooj Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: Koj puas tau xav tsim qhov kev ua kom txias txias? Yog tias yog, ua li cas txog kev tsim ib qho ntawm cov neeg nyiam tshaj plaws thiab txhua tus nyiam cov khoom siv xws li Lub Xov Tooj Txawb !!!. Hauv Cov Lus Qhia no, Kuv yuav qhia koj yuav tsim lub xov tooj txawb yooj yim siv STM li cas
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Nkag Mus Cov Ntaub Ntawv thiab Npaj Cov Duab Online Siv NodeMCU, MySQL, PHP thiab Chartjs.org: 4 Cov Kauj Ruam
Nkag Mus Cov Ntaub Ntawv thiab Npaj Cov Duab Online Siv NodeMCU, MySQL, PHP thiab Chartjs.org: Cov lus qhia no piav qhia yuav ua li cas peb tuaj yeem siv Node MCU pawg thawj coj los sau cov ntaub ntawv los ntawm ntau lub ntsuas, xa cov ntaub ntawv no mus rau tus tswv PHP cov ntaub ntawv uas tom qab ntawd ntxiv cov ntaub ntawv rau MySQL database. Cov ntaub ntawv tuaj yeem pom online hauv kab ntawv, siv chart.js.A ba
Cov Cuab Yeej Siv Hluav Taws Xob thiab Cov Cuam Tshuam Xov: Ua LED Zaub thiab Npuag Hluav Taws Xob uas Rolls Up: 7 Cov Kauj Ruam (nrog Duab)
Cov Cuab Yeej Siv Hluav Taws Xob thiab Cov Cuam Tshuam: Ua kom pom LED thiab Cov Khoom Siv Hluav Taws Xob uas Rolls Up: Ua rau koj tus kheej cov ntaub ua hluav taws xob, xov, kua nplaum, thiab kab xev, thiab siv lawv los ua lub zog ntsuas hluav taws xob, tiv thaiv, hloov pauv, LED cov lus qhia thiab siv hluav taws xob. thiab cov xov hluav taws xob koj tuaj yeem ua cov lus qhia LED thiab cov kab hluav taws xob ntawm ib qho ntaub uas hloov pauv tau