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 - HTS221 Tus txheeb ze Vaum thiab Kub Sensor Tutorial: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
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 qhov sib xyaw ua ke daim ntawv thov tshwj xeeb kev sib xyaw ua ke (ASIC) los muab cov ntaub ntawv ntsuas los ntawm kev cuam tshuam digital. Kev koom ua ke nrog ntau cov yam ntxwv no yog ib qho ntawm cov ntsuas tsim nyog tshaj plaws rau qhov ntsuas qhov ntsuas cua thiab ntsuas kub. Nov yog qhov ua piv txwv nrog arduino nano.
Kauj Ruam 1: Yam Koj Xav Tau..
1. Arduino Nano
2. HTS221
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 HTS221 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 HTS221 tuaj yeem rub tawm los ntawm peb qhov chaw cia khoom github- DCUBE Community.
Nov yog qhov txuas rau tib yam:
github.com/DcubeTechVentures/HTS221/blob/master/Arduino/HTS221.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.
HWV 221
// Tus lej no yog tsim los ua haujlwm nrog HTS221_I2CS I2C Mini Module
#suav nrog
// HTS221 I2C chaw nyob yog 0x5F
#define Ntxiv 0x5F
void teeb tsa ()
{
// Pib I2C kev sib txuas lus li MASTER
Hlau.begin ();
// Initialise serial communication, teeb baud tus nqi = 9600
Serial.begin (9600);
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xaiv qhov nruab nrab teeb tsa sau npe
Hlau.write (0x10);
// Qhov ntsuas kub nruab nrab piv txwv = 256, Qhov ntsuas nruab nrab vaum = 512
Hlau.write (0x1B);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xaiv tswj npe 1
Hlau.write (0x20);
// Hwj chim ON, Hloov kho tas li, Cov ntaub ntawv tso tawm tus nqi = 1 Hz
Hlau.write (0x85);
// Nres I2C Kev Kis
Wire.endTransmission ();
ncua (300);
}
void lub voj ()
{
unsigned int cov ntaub ntawv [2];
unsigned int val [4];
unsigned int H0, H1, H2, H3, T0, T1, T2, T3, nyoos;
// Vaum qhov kev txiav txim siab qhov tseem ceeb
rau (int kuv = 0; kuv <2; kuv ++)
{
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write ((48 + i));
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
cov ntaub ntawv = Wire.read ();
}
}
// Hloov cov ntaub ntawv Vaum
H0 = cov ntaub ntawv [0] / 2;
H1 = cov ntaub ntawv [1] / 2;
rau (int kuv = 0; kuv <2; kuv ++)
{
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write ((54 + i));
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
cov ntaub ntawv = Wire.read ();
}
}
// Hloov cov ntaub ntawv Vaum
H2 = (cov ntaub ntawv [1] * 256.0) + cov ntaub ntawv [0];
rau (int kuv = 0; kuv <2; kuv ++)
{
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write ((58 + i));
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
cov ntaub ntawv = Wire.read ();
}
}
// Hloov cov ntaub ntawv Vaum
H3 = (cov ntaub ntawv [1] * 256.0) + cov ntaub ntawv [0];
// Qhov ntsuas qhov ntsuas kub
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write (0x32);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
T0 = Hlau.read ();
}
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write (0x33);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
T1 = Hlau.read ();
}
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write (0x35);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
raw = Hlau.read ();
}
raw = raw & 0x0F;
// Hloov qhov ntsuas qhov ntsuas qhov ntsuas kub mus rau 10-ntsis
T0 = ((raw & 0x03) * 256) + T0;
T1 = ((raw & 0x0C) * 64) + T1;
rau (int kuv = 0; kuv <2; kuv ++)
{
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write ((60 + i));
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
cov ntaub ntawv = Wire.read ();
}
}
// Hloov cov ntaub ntawv
T2 = (data [1] * 256.0) + data [0];
rau (int kuv = 0; kuv <2; kuv ++)
{
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Hlau.write ((62 + i));
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 1 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 1);
// Nyeem 1 byte ntawm cov ntaub ntawv
yog (Wire.available () == 1)
{
cov ntaub ntawv = Wire.read ();
}
}
// Hloov cov ntaub ntawv
T3 = (data [1] * 256.0) + data [0];
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov ntaub ntawv sau npe
Wire.write (0x28 | 0x80);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 4 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 4);
// Nyeem 4 bytes ntawm cov ntaub ntawv
// humidity msb, humidity lsb, temp msb, temp lsb
yog (Wire.available () == 4)
{
val [0] = Hlau.read ();
val [1] = Hlau.read ();
val [2] = Hlau.read ();
val [3] = Hlau.read ();
}
// Hloov cov ntaub ntawv
ntab ntub = (val [1] * 256.0) + val [0];
av noo = ((1.0 * H1) - (1.0 * H0)) * (1.0 * av noo - 1.0 * H2) / (1.0 * H3 - 1.0 * H2) + (1.0 * H0);
int temp = (nqi [3] * 256) + val [2];
ntab cTemp = (((T1 - T0) / 8.0) * (temp - T2)) / (T3 - T2) + (T0 / 8.0);
ntab fTemp = (cTemp * 1.8) + 32;
// Cov ntaub ntawv tso tawm rau tus saib xyuas
Serial.print ("Txheeb ze cov av noo:");
Serial.print (av noo);
Serial.println (" % RH");
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:
HTS221 tuaj yeem ua haujlwm hauv ntau yam khoom siv xws li huab cua ua kom txias thiab tub yees thiab lwm yam.
Pom zoo:
TouchFree: Kev Txheeb Kub Kub thiab Kev Txheeb Xyuas Lub Ntsej Muag: 5 Kauj Ruam
TouchFree: Kev Txheeb Kub Kub thiab Kev Tshawb Pom Lub Ntsej Muag Kiosk: Raws li Lub Tebchaws nyob ib puag ncig lub ntiaj teb tab tom rov qhib, nyob nrog Tus Kab Mob Tshiab Coronavirus tau dhau los ua txoj hauv kev tshiab. Tab sis kom Tsis txhob kis tus kab mob no peb yuav tsum cais cov neeg muaj tus mob coronavirus los ntawm tus so. Raws li CDC, ua npaws yog tus
Siv Raspberry Pi, Txheeb Xyuas Cov Vaum thiab Kub Nrog SI7006: 6 Cov Kauj Ruam
Siv Raspberry Pi, Txheeb Xyuas Cov Vaum thiab Kub Nrog SI7006: Ua tus txhawb siab rau Raspberry Pi, peb xav txog qee qhov kev sim zoo tshaj plaws nrog nws. SI7006, Vaum thiab Kub hnov
ARUPI - Tus Nqi Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: 8 Kauj Ruam (nrog Duab)
ARUPI - Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: Cov lus qhia no tau sau los ntawm Anthony Turner. Txoj haujlwm tau tsim los nrog ntau qhov kev pab los ntawm Shed hauv Tsev Kawm Ntawv ntawm Kev Suav, University of Kent (Mr Daniel Knox tau pab zoo!)
Yuav Ua Li Cas Siv DHT11 Kub Sensor Nrog Arduino thiab Luam Kub Kub thiab Vaum: 5 Kauj Ruam
Yuav Ua Li Cas Siv DHT11 Kub Sensor Nrog Arduino thiab Luam Kub Kub thiab Vaum: Lub DHT11 sensor tau siv los ntsuas kub thiab av noo. Lawv yog cov khoom siv hluav taws xob nrov tshaj plaws.Qhov DHT11 cov av noo thiab ntsuas kub ua rau nws yooj yim ntxiv cov av noo thiab ntsuas kub rau koj li DIY cov phiaj xwm hluav taws xob. Nws yog rau
IoT Ua Yooj Yim: Txheeb Xyuas Cov Ntaub Ntawv Huab Cua Tej Zaum: UV thiab Huab Cua Kub & Vaum: 7 Kauj Ruam
IoT Ua Yooj Yim: Txheeb Xyuas Cov Ntaub Ntawv Huab Cua Nyob deb: UV thiab Huab Cua Kub & Vaum: Ntawm qhov kev qhia no, peb yuav ntes cov ntaub ntawv nyob deb li UV (Ultra-Violet hluav taws xob), huab cua kub thiab av noo. Cov ntaub ntawv no yuav yog ib qho tseem ceeb heev thiab yuav siv rau yav tom ntej Chaw Ua Haujlwm Huab Cua.Qhov thaiv daim duab qhia tau tias peb yuav tau txais dab tsi thaum kawg