Cov txheej txheem:
- Kauj Ruam 1: Yuav Tsum Kho Vajtse:
- Kauj ruam 2: Khoos phis tawj sib txuas:
- Kauj Ruam 3: Txoj Cai Los Ntsuas Kev Sib Nqus Sib Nqus:
- Kauj Ruam 4: Cov ntawv thov:
Video: Kev Ntsuas Hluav Taws Xob Siv HMC5883 thiab Particle Photon: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
HMC5883 yog lub ntsuas hluav taws xob digital tsim los rau kev tshawb fawb qis hauv ntiaj teb. Cov cuab yeej no muaj ntau yam sib nqus sib nqus ntawm +/- 8 Oe thiab qhov tso tawm ntawm 160 Hz. HMC5883 lub ntsuas suav nrog kev siv lub pluaj tsis siv neeg lub pluaj tsav tsheb, tshem tawm kev tshem tawm, thiab 12-ntsis ADC uas ua rau 1 ° txog 2 ° ntsuas qhov ntsuas qhov tseeb. Txhua I²C Mini Modules tau tsim los ua haujlwm ntawm 5VDC.
Hauv qhov kev qhia no, peb tab tom yuav piav qhia ntxaws txog kev ua haujlwm ntawm HMC5883 nrog cov duab me me. Particle photon yog pawg thawj coj saib xyuas uas xa thiab txais cov ntaub ntawv los ntawm lub vev xaib, uas txhawb nqa qhov tseem ceeb tshaj plaws ntawm Internet Ntawm Yam (IoT).
Kauj Ruam 1: Yuav Tsum Kho Vajtse:
Cov ntaub ntawv uas peb xav tau kom ua tiav peb lub hom phiaj suav nrog cov khoom siv hauv qab no:
1. HMC5883
2. Particle Photon
3. I2C Cable
4. I2C Shield rau Particle Photon
Kauj ruam 2: Khoos phis tawj sib txuas:
Tshooj khoos phis tawj sib txuas ntu piav qhia qhov txuas txuas txuas uas xav tau ntawm lub sensor thiab cov duab photon. 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:
HMC5883 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 3: Txoj Cai Los Ntsuas Kev Sib Nqus Sib Nqus:
Cia peb pib nrog cov lej me me tam sim no.
Thaum siv lub ntsuas 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
// HMC5883 I2C chaw nyob yog 0x1E (30)
#define Ntxiv 0x1E
int xMag = 0, yMag = 0, zMag = 0;
void teeb tsa ()
{
// Teem sib txawv
Particle.variable ("i2cdevice", "HMC5883");
Particle.variable ("xMag", xMag);
Particle.variable ("yMag", yMag);
Particle.variable ("zMag", zMag);
// 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 configure register A.
Hlau.write (0x00);
// Teeb tsa kev ntsuas ntsuas ib txwm muaj, cov ntaub ntawv tso tawm tus nqi = 0.75Hz
Hlau.write (0x60);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Pib I2C Kev Kis
Wire.beginTransmission (Addr);
// Xaiv hom sau npe
Hlau.write (0x02);
// Teeb ntsuas ntsuas tas mus li
Hlau.write (0x00);
// 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 (0x03);
// Nres I2C Kev Kis
Wire.endTransmission ();
// Thov 6 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 6);
// Nyeem 6 bytes ntawm cov ntaub ntawv
// xMag msb, xMag lsb, zMag msb, zMag lsb, yMag msb, yMag 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 ();
}
ncua (300);
// Hloov cov ntaub ntawv
xMag = ((data [0] * 256) + data [1]);
yog (xMag> 32767)
{
xMag -= 65536;
}
zMag = ((cov ntaub ntawv [2] * 256) + cov ntaub ntawv [3]);
yog (zMag> 32767)
{
zMag -= 65536;
}
yMag = ((data [4] * 256) + data [5]);
yog (yMag> 32767)
{
yMag -= 65536;
}
// Tso tawm cov ntaub ntawv rau dashboard
Particle.publish ("Magnetic Field in X-Axis:", String (xMag));
ncua (1000);
Particle.publish ("Magnetic Field in Y-Axis:", String (yMag));
ncua (1000);
Particle.publish ("Magnetic Field in Z-Axis:", String (zMag));
ncua (1000);
}
Particle.variable () muaj nuj nqi tsim cov kev hloov pauv kom khaws cov zis tawm ntawm lub sensor thiab Particle.publish () muaj nuj nqi qhia cov zis ntawm lub dashboard ntawm lub xaib.
Cov zis sensor tau pom hauv daim duab saum toj no rau koj siv.
Kauj Ruam 4: Cov ntawv thov:
HMC5883 yog qhov ua haujlwm saum npoo av, ntau txheej txheej tsim rau kev sib nqus hauv ntiaj teb pom nrog lub ntsej muag digital rau cov ntawv thov xws li tus nqi qis thiab kev ntsuas hluav taws xob. Nws ib txog rau ob qib qib qib raug thiab qhov tseeb ua rau Cov Neeg taug Kev Taw Qhia thiab LBS Cov Ntawv Thov.
Pom zoo:
Kev Tau Txais, Kev Loj Hlob, thiab Kev Tshawb Fawb Circuit Court ntawm Kev Siv Hluav Taws Xob Hluav Taws Xob: 6 Kauj Ruam
Kev Tau Txais, Kev Txhim Kho, thiab Kev Tshawb Fawb Circuit Court ntawm Kev Siv Hluav Taws Xob Hluav Taws Xob: Txhawm rau ua kom tiav cov lus qhia no, tsuas yog yam xav tau yog lub khoos phis tawj, nkag tau internet, thiab qee qhov simulation software. Rau lub hom phiaj ntawm kev tsim qauv no, txhua qhov kev sib tw thiab kev sim yuav raug ua ntawm LTspice XVII. Qhov simulation software no muaj
Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Igniter: 6 Kauj Ruam (nrog Duab)
Cov Hluav Taws Xob Bluetooth Hluav Taws Xob Igniter: Puas yog nws zoo rau taws ntau dua ib lub foob pob hluav taws tib lub sijhawm? Lossis txawm tias muaj kev nyab xeeb nyob deb rau qhov phom sij txaus ntshai. Hauv qhov haujlwm no kuv yuav qhia koj yuav tsim lub Circuit Court uas tuaj yeem ua tau li cas nrog kev pab ntawm Bluetooth ua haujlwm
Yuav Ua Li Cas Tswj DC Gear Motor los ntawm Kev Siv 160A Txhuam Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob thiab Servo Tester: 3 Cov Kauj Ruam
Yuav Ua Li Cas Tswj DC Gear Motor los ntawm Kev Siv 160A Txhuam Cov Hluav Taws Xob Hluav Taws Xob thiab Cov Kev Pabcuam Servo: Kev Qhia Tshwj Xeeb: Voltage: 2-3S Lipo lossis 6-9 NiMH Nruam tam sim no: 35A Tam sim no tawg: 160A BEC: 5V / 1A, tawm qauv: 1. pem hauv ntej & thim rov qab; 2. mus &nres; 3. rau pem hauv ntej & nres & thim rov qab: 34g Loj: 42*28*17mm
Ib Leeg Hluav Taws Xob Hluav Taws Xob / Hluav Taws Xob Hluav Taws Xob: 6 Cov Kauj Ruam
Ib Leeg Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob / Hluav Taws Xob Hluav Taws Xob: Hauv qhov haujlwm no peb tab tom ua kom muaj Ib lub kauj induction lub cev Muaj zog, thiab ntau yam piav qhia ntxiv, cov qauv ntawm lub tshuab hluav taws xob no tau siv ntau yam khoom siv tam sim no. Peb lub cav tsis muaj lub zog loj, nws yog ntau ntxiv txog kev ua haujlwm
Yuav Ua Li Cas Siv Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Module: 6 Kauj Ruam
Yuav Ua Li Cas Siv Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Module: Nco tseg thiab ceev faj: CFL muaj cov mercury uas yog cov khoom phom sij, yog li nws yuav tsum tau ua raws li feem ntau CFL cov teeb, hluav taws xob hluav taws xob tau ua haujlwm zoo thiab tseem siv tau, tsuas yog lub teeb mus tsis zoo. CFL Circuit Court ntawm 18-24 Watts yog