Cov txheej txheem:
- Kauj Ruam 1: BH1715 Txheej Txheem:
- Kauj Ruam 2: Yam Koj Xav Tau..
- Kauj Ruam 3: Khoos Phis Tawj Hookup:
- Kauj Ruam 4: Kev Ntsuas Kev Ntsuas Qhov Ntsuas Particle Code:
- Kauj Ruam 5: Cov ntawv thov:
Video: Kev Siv Lub Teeb Nyeem Kom Siv BH1715 thiab Particle Photon: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Nag hmo peb tau ua haujlwm ntawm LCD cov lus, thiab thaum ua haujlwm dhau ntawm lawv peb tau pom qhov tseem ceeb ntawm kev suav qhov teeb pom kev zoo. Kev siv lub teeb tsis yog tsuas yog qhov tseem ceeb hauv lub cev ntawm lub ntiaj teb no tab sis nws muaj nws lub luag haujlwm hais tau zoo hauv kev siv tshuaj lom neeg ib yam nkaus. Qhov kwv yees kwv yees ntawm lub teeb siv ua lub luag haujlwm tseem ceeb hauv peb cov txheej txheem, hauv kev loj hlob ntawm cov nroj tsuag, thiab lwm yam.
Hauv qhov kev qhia no, peb yuav los qhia txog kev ua haujlwm ntawm BH1715 nrog Particle Photon. Particle Photon yog lub rooj tsavxwm uas tuaj yeem pab txhawb kev tswj hwm ntawm txhua lub cuab yeej hauv internet.
Kho vajtse uas koj yuav xav tau rau lub hom phiaj no yog raws li hauv qab no:
1. BH1715 - Ambient Teeb Sensor
2. Particle Photon
3. I2C Cable
4. I2C Shield Rau Particle Photon
Kauj Ruam 1: BH1715 Txheej Txheem:
Ua ntej tshaj plaws peb xav paub koj nrog cov yam ntxwv tseem ceeb ntawm lub ntsuas qhov ntsuas uas yog BH1715 thiab cov txheej txheem kev sib txuas lus uas nws ua haujlwm.
BH1715 yog digital Ambient Light Sensor nrog I²C tsheb npav sib cuam tshuam. BH1715 feem ntau yog siv kom tau txais cov ntaub ntawv teeb pom kev zoo los kho LCD thiab Keypad lub teeb pom kev zoo rau lub xov tooj ntawm tes. Cov cuab yeej no muaj 16-ntsis kev daws teeb meem thiab ntsuas ntsuas tau ntau, tso cai kuaj pom los ntawm.23 txog 100, 000 lux.
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. BH1715 - Ambient Teeb Sensor
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 uas xav tau ntawm lub ntsuas cua thiab raspberry pi. 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:
BH1715 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: Kev Ntsuas Kev Ntsuas Qhov Ntsuas 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
// BH1715 I2C chaw nyob yog 0x23 (35)
#define Ntxiv 0x23
int luminance = 0;
void teeb tsa ()
{
// Teem sib txawv
Particle.variable ("i2cdevice", "BH1715");
Particle.variable ("luminance", luminance);
// 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);
// Xa lub zog ntawm kev hais kom ua
Hlau.write (0x01);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xa cov lus ntsuas ntsuas mus tas li
Hlau.write (0x10);
// Nres I2C Kev Kis
Wire.endTransmission ();
ncua (300);
}
void lub voj ()
{
unsigned int cov ntaub ntawv [2];
// Thov 2 byte ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 2);
// Nyeem 2 bytes ntawm cov ntaub ntawv
// ALS msb, ALS lsb
yog (Wire.available () == 2)
{
cov ntaub ntawv [0] = Wire.read ();
cov ntaub ntawv [1] = Wire.read ();
}
ncua (300);
// Hloov cov ntaub ntawv
luminance = ((cov ntaub ntawv [0] & 0xFF) * 256 + (cov ntaub ntawv [1] & 0xFF)) / 1.20;
// Tso tawm cov ntaub ntawv rau dashboard
Particle.publish ("Ambient Light Luminance:", Txoj hlua (luminance));
}
Kauj Ruam 5: Cov ntawv thov:
BH1715 yog lub teeb pom kev ib puag ncig lub teeb pom kev zoo uas tuaj yeem suav nrog hauv xov tooj ntawm tes, LCD TV, NCEJ PC thiab lwm yam. siv lub teeb pom kev zoo.
Pom zoo:
Cheeb Tsam Impedance Siv Cov Lej Nyeem Nyeem Nyeem Ntawv: 6 Kauj Ruam
Cheeb Tsam Impedance Siv Cov Zauv Ua Ntej: Nov yog daim ntawv thov siv ntawm cov lej ua lej sib luag.Qhov no yog qhov tseeb cov txheej txheem muaj txiaj ntsig zoo uas koj tuaj yeem siv los qhia tus yam ntxwv, lossis txawm tias lub kav hlau txais xov, ntawm qhov ua ntej ua ntej yog tias koj tau tinkering nrog hluav taws xob koj tej zaum yog fam
Kev ntsuas lub teeb pom kev zoo los ntawm kev siv BH1715 thiab Raspberry Pi: 5 Kauj Ruam
Kev ntsuas lub teeb pom kev zoo los ntawm Kev Siv BH1715 thiab Raspberry Pi: Nag hmo peb tau ua haujlwm ntawm LCD cov lus, thiab thaum ua haujlwm dhau lawv peb tau pom qhov tseem ceeb ntawm kev suav lub teeb. Kev siv lub teeb tsis yog tsuas yog qhov tseem ceeb hauv lub cev ntawm lub ntiaj teb no tab sis nws muaj nws lub luag haujlwm hais tau zoo hauv biologi
Kev Ntsuas thiab Kev Ntsuas Kub Siv HIH6130 thiab Particle Photon: 4 Cov Kauj Ruam
Kev ntsuas cov av noo thiab ntsuas kub siv HIH6130 thiab Particle Photon: HIH6130 yog qhov ntsuas cua thiab ntsuas kub nrog cov zis digital. Cov ntsuas no muab qib raug ntawm ± 4% RH. Nrog kev lag luam-ua kom muaj kev ruaj ntseg mus sij hawm ntev, qhov tseeb kub-them nyiaj digital I2C, Kev lag luam ua rau muaj kev ntseeg siab, Kev siv hluav taws xob
Kev Ntsuas thiab Kev Ntsuas Kub Siv HTS221 thiab Particle Photon: 4 Cov Kauj Ruam
Kev Ntsuas Cov Ntsuas thiab Kub Siv HTS221 thiab Particle Photon: HTS221 yog lub ntsuas hluav taws xob me me uas muaj peev xwm ntsuas tau 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
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej