Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau..
- Kauj Ruam 2: Kev Sib Txuas:
- Kauj ruam 3: Code:
- Kauj Ruam 4: Cov ntawv thov:
Video: Arduino Nano - MPL3115A2 Precision Altimeter Sensor Tutorial: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
MPL3115A2 ntiav MEMS lub siab ntsuas nrog I2C interface los muab cov ntaub ntawv Siab/Qhov Siab thiab Kub. Cov txiaj ntsig sensor tau digitized los ntawm kev daws teeb meem siab 24-ntsis ADC. Kev ua haujlwm sab hauv tshem tawm cov haujlwm them nyiaj los ntawm tus tswv tsev MCU. Nws muaj peev xwm txheeb xyuas qhov hloov pauv tsuas yog 0.05 kPa uas sib npaug rau 0.3m hloov pauv qhov siab. Nov yog nws qhov ua qauv qhia nrog Arduino Nano.
Kauj Ruam 1: Yam Koj Xav Tau..
1. Arduino Nano
2. MPL3115A2
3. I²C Cable
4. I²C Shield rau Arduino Nano
Kauj Ruam 2: Kev Sib Txuas:
Siv daim I2C daim thaiv rau Arduino Nano thiab maj mam thawb nws hla tus pin ntawm Nano.
Tom qab ntawd txuas ib qho kawg ntawm I2C cable rau MPL3115A2 sensor thiab lwm qhov kawg rau I2C daim ntaub thaiv.
Kev sib txuas tau qhia hauv daim duab saum toj no.
Kauj ruam 3: Code:
Tus lej arduino rau MPL3115A2 tuaj yeem rub tawm los ntawm peb qhov chaw cia khoom github-DCUBE Store.
Nov yog qhov txuas rau tib yam:
github.com/DcubeTechVentures/MPL3115A2/blob/master/Arduino/MPL3115A2.ino
Peb suav nrog tsev qiv ntawv Wire.h los pab txhawb I2c kev sib txuas lus ntawm lub sensor nrog Arduino board.
Koj tseem tuaj yeem luam cov cai los ntawm no, nws tau muab raws li hauv qab no:
// Faib nrog daim ntawv tso cai yuav dawb.
// Siv nws txhua txoj hauv kev uas koj xav tau, muaj txiaj ntsig lossis pub dawb, muab nws haum rau hauv daim ntawv tso cai ntawm nws cov haujlwm ua haujlwm.
NPE 31115A2
// Cov cai no tau tsim los ua haujlwm nrog MPL3115A2_I2CS I2C Mini Module
#suav nrog
// MPL3115A2 I2C chaw nyob yog 0x60 (96)
#define Ntxiv 0x60
void teeb tsa ()
{
// Pib I2C kev sib txuas lus
Hlau.begin ();
// Initialise Serial Communication, teeb baud tus nqi = 9600
Serial.begin (9600);
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv tswj sau npe
Hlau.write (0x26);
// Hom ua haujlwm, OSR = 128, hom ntsuas ntsuas
Hlau.write (0xB9);
// Nres I2C kev xa mus
Wire.endTransmission ();
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv cov ntaub ntawv teeb tsa sau npe
Hlau.write (0x13);
// Cov ntaub ntawv npaj cov xwm txheej tau qhib rau qhov siab, siab, kub
Hlau.write (0x07);
// 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 tswj sau npe
Hlau.write (0x26);
// Hom ua haujlwm, OSR = 128, hom ntsuas ntsuas
Hlau.write (0xB9);
// Nres I2C kev xa mus
Wire.endTransmission ();
ncua (1000);
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv cov ntaub ntawv sau npe
Hlau.write (0x00);
// Nres I2C kev xa mus
Wire.endTransmission ();
// Thov 6 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 6);
// Nyeem 6 bytes ntawm cov ntaub ntawv los ntawm chaw nyob 0x00 (00)
// xwm txheej, tHeight msb1, tHeight msb, tHeight lsb, temp msb, tem lsb
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 mus rau 20-ntsis
int tHeight = (((ntev) (data [1] * (ntev) 65536) + (data [2] * 256) + (data [3] & 0xF0)) / 16);
int temp = ((cov ntaub ntawv [4] * 256) + (data [5] & 0xF0)) / 16;
ntab qhov siab = tHeight / 16.0;
ntab cTemp = (temp / 16.0);
ntab fTemp = cTemp * 1.8 + 32;
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv tswj sau npe
Hlau.write (0x26);
// Hom ua haujlwm, OSR = 128, hom ntsuas cua
Hlau.write (0x39);
// Nres I2C kev xa mus
Wire.endTransmission ();
ncua (1000);
// Pib I2C kis tau tus mob
Wire.beginTransmission (Addr);
// Xaiv cov ntaub ntawv sau npe
Hlau.write (0x00);
// Nres I2C kev xa mus
Wire.endTransmission ();
// Thov 4 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 4);
// Nyeem 4 bytes ntawm cov ntaub ntawv
// xwm txheej, pres msb1, pres msb, pres lsb
yog (Wire.available () == 4)
{
cov ntaub ntawv [0] = Wire.read ();
cov ntaub ntawv [1] = Wire.read ();
cov ntaub ntawv [2] = Wire.read ();
cov ntaub ntawv [3] = Wire.read ();
}
// Hloov cov ntaub ntawv mus rau 20-ntsis
ntev pres = (((ntev) cov ntaub ntawv [1] * (ntev) 65536) + (cov ntaub ntawv [2] * 256) + (cov ntaub ntawv [3] & 0xF0)) / 16;
ntab siab = (pres / 4.0) / 1000.0;
// Cov ntaub ntawv tso tawm rau tus saib xyuas
Serial.print ("Qhov siab:");
Serial.print (qhov siab);
Serial.println ("m");
Serial.print ("Siab:");
Serial.print (siab);
Serial.println ("kPa");
Serial.print ("Kub hauv Celsius:");
Serial.print (cTemp);
Serial.println ("C");
Serial.print ("Kub hauv Fahrenheit:");
Serial.print (fTemp);
Serial.println ("F");
ncua (500);
}
Kauj Ruam 4: Cov ntawv thov:
Kev siv ntau yam ntawm MPL3115A2 suav nrog Kev Raug Siab Tshaj Plaws, Smartphones/Tablets, Kev Siv Hluav Taws Xob Tus Kheej thiab lwm yam.
Pom zoo:
RC Dav Hlau Altimeter (sib xws nrog Spektrum Telemetry): 7 Kauj Ruam
RC Dav Hlau Altimeter (sib xws nrog Spektrum Telemetry): Kuv tau ua qhov ntsuas siab no kom tus kws tsav dav hlau tuaj yeem paub tias lawv nyob qis dua 400 ko taw txwv ntawm RC dav hlau hauv Asmeskas. Kuv tus phooj ywg tau txhawj xeeb txij li nws tsis tuaj yeem hais meej tias nws ib txwm nyob qis dua 400 ft, thiab xav tau kev lees paub ntxiv tias lub sensor wi
Altimeter (ntsuas qhov siab) Raws li Huab Cua Siab: 7 Kauj Ruam (nrog Duab)
Altimeter (ntsuas qhov siab) Raws li Huab Cua Siab: [Hloov Kho]; Saib version 2 hauv qib 6 nrog rau tus kheej lub hauv paus qhov siab nkag qhov no yog qhov kev piav qhia lub tsev ntawm Altimeter (Qhov Siab Tshaj Meter) raws li Arduino Nano thiab Bosch BMP180 qhov ntsuas cua huab cua.Qhov tsim yog yooj yim tab sis ntsuas
Arduino Nano - HTS221 Tus txheeb ze Vaum thiab Kub Sensor Tutorial: 4 Kauj Ruam
Arduino Nano - HTS221 Txheeb Ze Cov Vaum thiab Kub Sensor Tutorial: HTS221 yog lub ntsuas hluav taws xob me me uas muaj peev xwm ntsuas tau rau qhov txheeb ze thiab qhov kub thiab txias. Nws suav nrog lub hauv paus ntsiab lus thiab cov teeb liab sib xyaw daim ntawv thov tshwj xeeb kev sib txuas (ASIC) los muab cov ntaub ntawv ntsuas los ntawm cov lej
Raspberry Pi A1332 Precision Hall - Effect Angle Sensor Java Qhia: 4 Kauj Ruam
Raspberry Pi A1332 Precision Hall - Effect Angle Sensor Java Qhia: A1332 yog 360 ° tsis muaj kev sib cuag siab daws teeb meem programmable sib nqus lub ntsej muag txoj haujlwm sensor. Nws yog tsim los rau cov tshuab siv I2C interface. Nws tau tsim los ntawm Lub Vertical Hall (CVH) thev naus laus zis thiab cov txheej txheem microprocessor uas tuaj yeem tsim tau
Arduino Altimeter Siv BMP thiab SPI lossis I2C OLED: 5 Kauj Ruam
Arduino Altimeter Siv BMP thiab SPI lossis I2C OLED: Tau ntev kuv tau tshawb nrhiav qhov ntsuas kub thiab ntsuas kub siv tus ntsuas ib leeg thiab nthuav tawm nws rau SPI raws li OLED. Raws li kuv nrhiav tsis tau ib yam meej, xav tias kuv yuav tsim kuv tus kheej siv U8glib lub tsev qiv ntawv. Muaj ib qho kev qhia hauv youtub