Cov txheej txheem:

Txuas MPU6050 Nrog ESP32: 4 Cov Kauj Ruam
Txuas MPU6050 Nrog ESP32: 4 Cov Kauj Ruam

Video: Txuas MPU6050 Nrog ESP32: 4 Cov Kauj Ruam

Video: Txuas MPU6050 Nrog ESP32: 4 Cov Kauj Ruam
Video: txuas hneev tuas qe hlau 2024, Kaum ib hlis
Anonim
Txuas MPU6050 Nrog ESP32
Txuas MPU6050 Nrog ESP32

Hauv txoj haujlwm no, kuv tab tom cuam tshuam nrog MPU6050 sensor nrog ESP32 DEVKIT V1 board.

MPU6050 tseem hu ua 6 axis sensor lossis 6 degree of freedom (DOF) sensor. Ob lub accelerometer thiab gyrometer sensors muaj nyob hauv cov qauv no. Accelerometer sensor muab cov ntawv nyeem tawm raws li qhov quab yuam siv rau ntawm qhov khoom vim lub ntiajteb txawj nqus thiab lub ntsuas hluav taws xob ntsuas lub ntsuas cua muab cov lus hais txog kev hloov pauv ntawm lub kaum ntse ntse ntawm cov khoom nyob rau hauv lub moos lossis cov lus qhia.

MPU6050 sensor siv SCL thiab SDA kab ntawm ESP32 DEVKIT V1, yog li ntawd, peb yuav siv lub tsev qiv ntawv wire.h hauv tus lej rau I2C kev sib txuas lus. Peb tuaj yeem txuas ob lub MPU6050 ntsuas nrog tib SCL thiab SDA kab ntawm chaw nyob 0x68 thiab 0x69 nrog ESP32 DEVKIT V1.

Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau

1. ESP32 DEVKIT V1 board -

2. MPU6050 sensor -

3. Jumper xov hlau -

4. Breadboard (yeem) -

5. Arduino IDE software

Teeb tsa koj Arduino IDE ua ntej xa cov cai hauv ESP32 yog qhov tseem ceeb heev:-https://www.instructables.com/id/Setting-Up-Ardui…

Kauj ruam 2: Circuit Schematic

Circuit Schematic
Circuit Schematic

Circuit Schematic yuav txawv rau ESP 32 pawg sib txawv yog li saib xyuas Pins koj tab tom txuas

ESP32 MPU6050 Pins

VIN (5V) VCC

NCO VCC

SCL (GPIO22) SCL

SDA (GPIO21) SDA

Kauj ruam 3: Code

Cov kauj ruam ua raws thaum xa cov cai hauv ESP32 pawg thawj coj

1. Nyem rau upload.

2. Yog tsis muaj qhov yuam kev. Hauv qab ntawm Arduino IDE, thaum peb tau txais cov lus Txuas …, …, 3. Nias lub pob khau raj ntawm ESP 32 pawg thawj coj kom txog thaum koj tau txais cov lus ua tiav xa tawm.

4. Tom qab koj tus lej tau xa tawm tiav. Nias pab khawm kom rov pib dua lossis pib code tso rau ntawm ESP32 pawg thawj coj.

Pom zoo: