Cov txheej txheem:
- Kauj Ruam 1: BMG160 Txheej Txheem:
- Kauj Ruam 2: Yam Koj Xav Tau..
- Kauj Ruam 3: Khoos Phis Tawj Hookup:
- Kauj Ruam 4: 3-Axis Gyroscope Measurement Particle Code:
- Kauj Ruam 5: Cov ntawv thov:
Video: Kev cuam tshuam ntawm 3-Axis Gyroscope Sensor BMG160 Nrog Particle: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Hauv lub ntiaj teb niaj hnub no, ntau dua ib nrab ntawm cov tub ntxhais hluas thiab menyuam yaus nyiam ua si thiab txhua tus neeg uas nyiam nws, txaus siab los ntawm cov txuj ci ntawm kev ua si paub qhov tseem ceeb ntawm kev nkag siab zoo hauv qhov no. Peb kuj tseem xav tsis thoob los ntawm tib yam thiab tsuas yog coj nws mus rau ntawm cov laug cam, peb xav txog kev ua haujlwm ntawm lub ntsuas hluav taws xob ntsuas hluav taws xob uas tuaj yeem ntsuas tus nqi ib leeg ntawm ib yam khoom. Yog li, lub ntsuas ntsuas peb tau coj los daws cov haujlwm yog BMG160. BMG160 yog 16-ntsis, digital, triaxial, gyroscope sensor uas tuaj yeem ntsuas tus lej nyob hauv peb chav nyob ib puag ncig.
Hauv qhov kev qhia no, peb yuav los qhia txog kev ua haujlwm ntawm BMG160 nrog Particle Photon.
Kho vajtse uas koj yuav xav tau rau lub hom phiaj no yog raws li hauv qab no:
1. BMG160
2. Particle photon
3. I2C Cable
4. I2C Shield rau Particle Photon
Kauj Ruam 1: BMG160 Txheej Txheem:
Ua ntej tshaj plaws peb xav paub koj nrog cov yam ntxwv tseem ceeb ntawm lub ntsuas qhov ntsuas uas yog BMG160 thiab cov txheej txheem kev sib txuas lus uas nws ua haujlwm.
BMG160 yog qhov tseem ceeb 16-ntsis, digital, triaxial, gyroscope sensor uas tuaj yeem ntsuas tus nqi kaum. Nws muaj peev xwm suav tus lej nyob hauv peb chav nyob ib puag ncig, x-, y- thiab z-axis, thiab muab cov cim teeb tsa sib xws. Nws tuaj yeem sib tham nrog raspberry pi board siv I2C kev sib txuas lus raws tu qauv. Cov qauv tshwj xeeb no tau tsim los kom tau raws li qhov xav tau rau cov neeg siv khoom siv nrog rau lub hom phiaj kev lag luam.
Cov txheej txheem kev sib txuas lus uas lub sensor ua haujlwm yog I2C. I2C sawv cev rau kev sib koom ua ke. Nws yog cov txheej txheem kev sib txuas lus uas kev sib txuas lus tau tshwm sim los ntawm SDA (cov ntaub ntawv xov xwm) thiab SCL (cov xov tooj). Nws tso cai txuas ntau yam khoom siv tib lub sijhawm. Nws yog ib qho ntawm cov txheej txheem kev sib txuas lus yooj yim tshaj plaws thiab muaj txiaj ntsig tshaj plaws.
Kauj Ruam 2: Yam Koj Xav Tau..
Cov ntaub ntawv uas peb xav tau kom ua tiav peb lub hom phiaj suav nrog cov khoom siv hauv qab no:
1. BMG160
2. Particle Photon
3. I2C Cable
4. I2C Shield Rau Particle Photon
Kauj Ruam 3: Khoos Phis Tawj Hookup:
Tshooj khoos phis tawj sib txuas ntu piav qhia qhov txuas txuas txuas uas xav tau ntawm lub sensor thiab Particle. 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:
BMG160 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 4: 3-Axis Gyroscope Measurement Particle Code:
Cia peb pib nrog cov lej me me tam sim no.
Thaum siv lub ntsuas qhov ntsuas nrog arduino, peb suav nrog application.h thiab lub tsev qiv ntawv spark_wiring_i2c.h. "application.h" thiab lub tsev qiv ntawv spark_wiring_i2c.h muaj cov haujlwm uas pab txhawb kev sib txuas lus i2c ntawm lub sensor thiab cov khoom me me.
Tag nrho cov cai hauv qab no tau muab rau hauv qab no kom yooj yim ntawm tus neeg siv:
#suav nrog
#suav nrog
// BMG160 I2C chaw nyob yog 0x68 (104)
#define Ntxiv 0x68
int xGyro = 0, yGyro = 0, zGyro = 0;
void teeb tsa ()
{
// Teem sib txawv
Particle.variable ("i2cdevice", "BMG160");
Particle.variable ("xGyro", xGyro);
Particle.variable ("yGyro", yGyro);
Particle.variable ("zGyro", zGyro);
// Pib I2C kev sib txuas lus li MASTER
Hlau.begin ();
// Initialise Serial Communication
Serial.begin (9600);
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xaiv Range register
Hlau.write (0x0F);
// Kho qhov ntsuas puv 2000 dps
Hlau.write (0x80);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xaiv Bandwidth sau npe
Hlau.write (0x10);
// Teeb Bandwidth = 200 Hz
Hlau.write (0x04);
// Nres I2C Kev Kis
Wire.endTransmission ();
ncua (300);
}
void lub voj ()
{
unsigned int cov ntaub ntawv [6];
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xaiv cov ntaub ntawv sau npe
Hlau.write (0x02);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 6 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 6);
// Nyeem 6 bytes ntawm cov ntaub ntawv
// xGyro lsb, xGyro msb, yGyro lsb, yGyro msb, zGyro lsb, zGyro msb
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 ();
}
ncua (300);
// Hloov cov ntaub ntawv
xGyro = ((data [1] * 256) + data [0]);
yog (xGyro> 32767)
{
xGyro -= 65536;
}
yGyro = ((cov ntaub ntawv [3] * 256) + cov ntaub ntawv [2]);
yog (yGyro> 32767)
{
yGyro -= 65536;
}
zGyro = ((cov ntaub ntawv [5] * 256) + cov ntaub ntawv [4]);
yog (zGyro> 32767)
{
zGyro -= 65536;
}
// Tso tawm cov ntaub ntawv rau dashboard
Particle.publish ("X-Axis ntawm kev sib hloov:", Txoj hlua (xGyro));
Particle.publish ("Y-Axis ntawm kev sib hloov:", Txoj hlua (yGyro));
Particle.publish ("Z-Axis ntawm kev sib hloov:", Txoj hlua (zGyro));
ncua (1000);
}
Kauj Ruam 5: Cov ntawv thov:
BMG160 muaj ntau qhov kev thov hauv cov khoom siv xws li xov tooj ntawm tes, tib neeg siv tshuab sib txuas. Qhov ntsuas qhov ntsuas no tau tsim los kom tau raws li qhov xav tau rau cov neeg siv khoom siv xws li kev ruaj ntseg duab (DSC thiab lub koob yees duab-xov tooj), kev ua si thiab taw tes. Nws kuj tseem ua haujlwm hauv cov kab ke uas xav tau kev paub piav tes piav taw thiab cov kab ke siv hauv kev qhia sab hauv tsev.
Pom zoo:
Nagging Neeg Hlau ® - Kev cuam tshuam ntawm Kev Ceev Ntawm Lub Neej: 7 Kauj Ruam (nrog Duab)
Nagging Neeg Hlau ® | Kev cuam tshuam ntawm Kev Ceev Ntawm Lub Neej: Txoj hauv kev yooj yim tshaj plaws kom paub tseeb tias koj npau taws txhua hnub. Nagging Robot® muaj qhov kev daws teeb meem. Nagging Robot® Annooy® 900The Annooy® 900 tau ua tib zoo xeeb nrog kev txiav txim siab thev naus laus zis DIY los ua rau tib neeg ntxhov siab. los ntawm Daniel Locatelli thiab TzuYing Chen Ntau lub zog
Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom: 5 Kauj Ruam
Kev cuam tshuam txog kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom: Thaum kuv tab tom saib mus rau cuam tshuam SPS30 sensors, Kuv pom tau tias feem ntau qhov chaw yog rau Raspberry Pi tab sis tsis ntau rau Arduino. Kuv siv sijhawm me ntsis los ua lub sensor ua haujlwm nrog Arduino thiab kuv txiav txim siab tshaj tawm kuv qhov kev paub ntawm no kom nws tuaj yeem
Arduino cuam tshuam nrog Ultrasonic Sensor thiab Kev Sib Txuas Kub Kub Sensor: 8 Kauj Ruam
Arduino cuam tshuam nrog Ultrasonic Sensor thiab Kev Sib Ntsib Kub Kub Sensor: Niaj hnub no, Cov Tsim, Cov tsim tawm xav tau Arduino rau kev txhim kho sai ntawm cov qauv ntawm cov phiaj xwm. Arduino yog lub platform siv hluav taws xob qhib raws qhov yooj yim-rau-siv-kho vajtse thiab software. Arduino muaj zej zog neeg siv zoo heev. Hauv qhov haujlwm no
Kev cuam tshuam ib qho Arduino nrog Lub Xov Tooj Ntawm Tes: 6 Cov Kauj Ruam (nrog Duab)
Kev cuam tshuam ib qho Arduino Nrog Lub Xov Tooj: Thaum siv Arduino, nws yuav ua rau muaj kev thab plaub heev uas tsis tuaj yeem siv nws tsuas yog vim tias koj tsis muaj lub khoos phis tawj muaj. Tej zaum Windows lossis Mac OS tsis sib xws, koj tsis muaj lub khoos phis tawj tag nrho lossis koj tsuas yog xav tau kev ywj pheej ntau ntxiv rau
Tus Cuam Tshuam Cuam Tshuam (ntsuas phoo Cam Cuam Tshuam Cuam Tshuam): 4 Cov Kauj Ruam
Solder Saver (txhav tas Cam Cuam Tshuam Cuam Tshuam): "Yuav ua li cas kuv thiaj yuav tsum qhia ua ntej Cov Lus Qhia no?" Kuv nug kuv tus kheej. Zoo li, txij li thaum pib ntawm lub sijhawm, tus txiv neej muaj qhov xav kom lo lo rau hauv tus cwj mem thiab tshaj tawm cov duab online. Zoo, Kuv tau txiav txim siab luv luv delving rau hauv keeb kwm loj dua ntawm tus cwj mem yaj, b