Cov txheej txheem:

Arduino Nano thiab Visuino: Hloov Ua Ntej Los Ntawm Lub Cev Los Ntawm Accelerometer thiab Gyroscope MPU6050 I2C Sensor: 8 Kauj Ruam (nrog Duab)
Arduino Nano thiab Visuino: Hloov Ua Ntej Los Ntawm Lub Cev Los Ntawm Accelerometer thiab Gyroscope MPU6050 I2C Sensor: 8 Kauj Ruam (nrog Duab)

Video: Arduino Nano thiab Visuino: Hloov Ua Ntej Los Ntawm Lub Cev Los Ntawm Accelerometer thiab Gyroscope MPU6050 I2C Sensor: 8 Kauj Ruam (nrog Duab)

Video: Arduino Nano thiab Visuino: Hloov Ua Ntej Los Ntawm Lub Cev Los Ntawm Accelerometer thiab Gyroscope MPU6050 I2C Sensor: 8 Kauj Ruam (nrog Duab)
Video: Dab neeg Nkauj nraug cog lus ruaj tuag thiaj tseem nco los tos - Ghost story 2024, Hlis ntuj nqeg
Anonim
Image
Image

Ib pliag dhau los kuv tshaj tawm cov lus qhia yuav ua li cas koj tuaj yeem txuas MPU9250 Accelerometer, Gyroscope thiab Compass Sensor rau Arduino Nano thiab teeb tsa nws nrog Visuino kom xa cov ntaub ntawv pob thiab tso tawm ntawm Scope thiab Visual Instruments.

Accelerometer xa X, Y, thiab Z acceleration forces. Feem ntau txawm li cas los xij peb yuav tsum hloov cov rog mus rau X, Y, Z 3D lub kaum ntse ntse los txiav txim siab 3D Kev Taw Qhia ntawm lub ntsuas. Muaj ob peb tus neeg thov kev qhia zoo li no, thiab thaum kawg kuv tau pom lub sijhawm los ua nws.

Qee tus neeg kuj nug tias koj tuaj yeem txuas thiab siv MPU6050 Accelerometer thiab Gyroscope Sensor li cas, yog li kuv txiav txim siab siv tus qauv no rau kev qhia siv qhov nyuaj dua thiab kim MPU9250.

Hauv phau ntawv qhia no, kuv yuav qhia koj yooj yim npaum li cas txhawm rau txuas MPU6050 Accelerometer thiab Gyroscope Sensor mus rau Arduino Nano, thiab teeb tsa nws nrog Visuino txhawm rau hloov qhov nrawm rau hauv 3D X, Y, Z Angle.

Kauj Ruam 1: Cheeb Tsam

Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
  1. Ib lub rooj sib tham ntawm Arduino (Kuv siv Arduino Nano, vim tias kuv muaj ib qho, tab sis lwm qhov yuav zoo xwb)
  2. Ib MPU6050 Acceleration Gyroscope Sensor Module
  3. 4 Poj niam-Poj niam jumper xov hlau

Kauj Ruam 2: Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino

Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
Txuas MPU6050 Accelerometer thiab Gyroscope rau Arduino
  1. Txuas 5V VCC Fais Fab (Hlau liab), Hauv av (Hlau dub), SCL (Hlau xaim), thiab SDA (Ntsuab ntsuab) mus rau MPU6050 Module (Duab 1)
  2. Txuas lwm qhov kawg ntawm Cov Av Hauv av (Cov xaim dub) mus rau hauv av Pin ntawm Arduino Nano board (Daim duab 2)
  3. Txuas lwm qhov kawg ntawm 5V VCC Lub Hwj Huam Hluav Taws Xob (Hlau liab) mus rau 5V fais fab tus pin ntawm Arduino Nano board (Duab 2)
  4. Txuas lwm qhov kawg ntawm SDA xaim (Green wire) rau SDA/Analog tus pin 4 ntawm Arduino Nano board (Daim duab 3)
  5. Txuas lwm qhov kawg ntawm SCL xaim (Hlau xaim) mus rau SCL/Analog tus pin 5 ntawm Arduino Nano board (Daim duab 3)
  6. Daim duab 4 qhia qhov twg yog Av, 5V Fais Fab, SDA/Analog pin 4, thiab SCL/Analog pin 5, tus pin ntawm Arduino Nano

Kauj Ruam 3: Pib Visuino, thiab Xaiv Arduino Board Type

Pib Visuino, thiab Xaiv Arduino Board Type
Pib Visuino, thiab Xaiv Arduino Board Type
Pib Visuino, thiab Xaiv Arduino Board Type
Pib Visuino, thiab Xaiv Arduino Board Type

Txhawm rau pib ua haujlwm rau Arduino, koj yuav tsum muaj Arduino IDE teeb tsa los ntawm no:

Nco ntsoov tias koj nruab 1.6.7 lossis siab dua, txwv tsis pub Cov Lus Qhia no yuav tsis ua haujlwm!

Visuino: https://www.visuino.com kuj tseem yuav tsum tau teeb tsa.

  1. Pib Visuino raws li qhia hauv daim duab thawj
  2. Nyem rau ntawm "Cov cuab yeej" khawm ntawm Arduino tivthaiv (Daim duab 1) hauv Visuino
  3. Thaum cov lus sib tham tshwm, xaiv Arduino Nano raws li qhia hauv daim duab 2

Kauj Ruam 4: Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheebtsam

Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam
Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam
Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam
Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam
Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam
Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam
Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam
Hauv Visuino: Ntxiv thiab Txuas MPU9650 thiab Kev Nkag Mus Rau Lub Cheeb Tsam

Ua ntej peb yuav tsum tau ntxiv cov khoom siv los tswj MPU6050 Sensor, thiab hloov X, Y, Z Kev nrawm mus rau 3D X, Y, Z Lub Kaum:

  1. Ntaus "6050" hauv lub thawv lim ntawm Cov Cuab Yeej Cuab Yeej ces xaiv "Accelerometer Gyroscope MPU6000/MPU6050 I2C" tivthaiv (Daim duab 1), thiab tso nws rau hauv thaj chaw tsim (Daim duab 2)
  2. Ntaus "lub kaum sab xis" hauv lub thawv Lim ntawm Cov Ntawv Cuab Yeej Cuab Yeej ces xaiv qhov "Ua Kom Ncaj Ncees" ntu (Daim duab 2), thiab tso rau hauv thaj tsam tsim (Duab 3)
  3. Nyem rau hauv "Tawm" lub thawv ntawm "Accelerometer" lub thawv uas muaj X, Y, X Kev nrawm nrawm ntawm AccelerometerGyroscope1 tivthaiv kom pib txuas txhua tus Pin tawm ib zaug (Duab 3)
  4. Tsiv tus nas hla "X" tus lej nkag ntawm "Hauv" lub thawv ntawm AccelerationToAngle1 tivthaiv. Lub Visuino yuav cia li kis cov xov hlau kom lawv yuav txuas tau raug mus rau cov koob ntxiv (Daim duab 3)
  5. Txuas tus "Tawm" tus pin ntawm AccelerometerGyroscope1 tivthaiv mus rau "Hauv" tus pin ntawm I2C channel ntawm Arduino tivthaiv (Daim duab 4)

Kauj Ruam 5: Hauv Visuino: Ntxiv Pob Txheej Txheem thiab Teeb Tus Qauv Npe

Hauv Visuino: Ntxiv Pob Txheej Txheem thiab Teeb Tus Qauv Npe
Hauv Visuino: Ntxiv Pob Txheej Txheem thiab Teeb Tus Qauv Npe
Hauv Visuino: Ntxiv Pob Txheej Txheem thiab Teeb Tus Qauv Npe
Hauv Visuino: Ntxiv Pob Txheej Txheem thiab Teeb Tus Qauv Npe
Hauv Visuino: Ntxiv Pob Txheej Txheem thiab Teeb Tus Qauv Npe
Hauv Visuino: Ntxiv Pob Txheej Txheem thiab Teeb Tus Qauv Npe

Txhawm rau xa tag nrho cov ntaub ntawv cov ntaub ntawv hla cov chaw nres nkoj los ntawm Arduino peb tuaj yeem siv Packet tivthaiv los ntim cov channel ua ke, thiab tso saib lawv hauv Scope thiab Gauges hauv Visuino:

  1. Ntaus "pob ntawv" hauv Lub Lim Lim ntawm Lub Cuab Yeej Cuab Yeej ntawd xaiv "Sine Analog Generator" tivthaiv (Daim duab 1), thiab tso rau hauv qhov tsim
  2. Hauv Cov Khoom nthuav dav "Head Marker" cov cuab yeej (Daim duab 2)
  3. Hauv Cov Khoom Nyem rau ntawm "…" khawm (Daim duab 2)
  4. Hauv Bytes editor ntaus qee tus lej, piv txwv 55 55 (Duab 3)
  5. Nyem rau ntawm lub pob OK kom paub meej thiab kaw tus editor

Kauj Ruam 6: Hauv Visuino: Ntxiv 3 Binary Analog Elements rau Pob Ntawv Cheeb Tsam thiab Txuas Lawv

Hauv Visuino: Ntxiv 3 Binary Analog Elements rau Pob Ntawv Cheeb Tsam thiab Txuas Lawv
Hauv Visuino: Ntxiv 3 Binary Analog Elements rau Pob Ntawv Cheeb Tsam thiab Txuas Lawv
Hauv Visuino: Ntxiv 3 Binary Analog Elements rau Pob Ntawv Cheeb Tsam thiab Txuas Lawv
Hauv Visuino: Ntxiv 3 Binary Analog Elements rau Pob Ntawv Cheeb Tsam thiab Txuas Lawv
Hauv Visuino: Ntxiv 3 Binary Analog Elements rau Pob Ntawv Cheeb Tsam thiab Txuas Lawv
Hauv Visuino: Ntxiv 3 Binary Analog Elements rau Pob Ntawv Cheeb Tsam thiab Txuas Lawv
  1. Nyem rau ntawm "Cov cuab yeej" khawm ntawm Packet1 tivthaiv (Daim duab 1)
  2. Hauv "Elements" tus kws kho mob xaiv lub "Binary Analog" lub ntsiab lus, thiab tom qab ntawd nyem rau "+" khawm 3 zaug (Duab 2) ntxiv 3 lub ntsiab lus sib piv (Daim duab 3)
  3. Nyem rau hauv "Tawm" lub thawv ntawm "Accelerometer" Lub thawv uas muaj tus pin ntawm AccelerationToAngle1 tivthaiv kom pib txuas txhua tus Pin tawm ib zaug (Duab 4)
  4. Tsiv tus nas hla "Hauv" tus pin ntawm "Elements. Analog (Binary) 1" keeb kwm ntawm Packet1 tivthaiv. Lub Visuino yuav cia li kis cov xov hlau kom lawv yuav txuas kom raug mus rau cov koob ntxiv (Daim duab 4)
  5. Txuas "Out" tus pin tso tawm ntawm Packet1 tivthaiv rau "Hauv" tus pin nkag ntawm "Serial [0]" channel ntawm "Arduino" tivthaiv (Daim duab 5)

Kauj Ruam 7: Tsim, Ua Ke, thiab Tshaj Tawm Arduino Code

Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code
  1. Hauv Visuino, Nias F9 lossis nyem rau ntawm lub pob uas qhia ntawm daim duab 1 los tsim Arduino code, thiab qhib Arduino IDE
  2. Hauv Arduino IDE, nyem rau ntawm Upload khawm, txhawm rau sau thiab xa cov cai (Daim duab 2)

Kauj Ruam 8: Thiab Ua Si …

Image
Image
Thiab Ua Si …
Thiab Ua Si …
Thiab Ua Si …
Thiab Ua Si …

Koj tuaj yeem pom qhov txuas thiab khiav MPU6050 Accelerometer, thiab Gyroscope Sensor ntawm Daim Duab 1.

  1. Hauv Visuino xaiv Serial Port, thiab tom qab ntawd nyem rau ntawm "Format:" drop down box, thiab xaiv Packet1 (Daim duab 2)
  2. Nyem rau ntawm "Txuas" khawm (Daim duab 2)
  3. Yog tias koj xaiv "Scope" tab, koj yuav pom Lub Scope phiaj xwm X, Y, Z Angles dhau sijhawm (Daim duab 3)
  4. Yog tias koj xaiv lub "Ntsuas" tab, koj yuav pom Gauges qhia tib cov ntaub ntawv (Duab 4)

Koj tuaj yeem pom lub ntsuas hluav taws xob ua haujlwm ntawm Video.

Nrog koj zoo siab! Koj tau tsim Visuino txoj haujlwm hloov kho kom nrawm rau lub kaum sab xis los ntawm MPU6050 Accelerometer, thiab Gyroscope Sensor.

Ntawm daim duab 5 koj tuaj yeem pom daim duab Visuino tiav.

Kuj txuas nrog yog Visuino qhov haujlwm, uas kuv tau tsim rau qhov Qhia Qhia no. Koj tuaj yeem rub tawm thiab qhib nws hauv Visuino:

Pom zoo: