Cov txheej txheem:
- Kauj Ruam 1: Cov Khoom Siv thiab Cov Cuab Yeej
- Kauj Ruam 2: Npaj ATTINY85
- Kauj Ruam 3: Sib dhos Circuit
- Kauj ruam 4: Xeem
- Kauj Ruam 5: Cov Kauj Ruam Tom ntej
Video: IOT123 - I2C MQ2 BRICK: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
IOT123 BRICKS yog chav DIY modular uas tuaj yeem sib xyaw nrog lwm IOT123 BRICKS, txhawm rau ntxiv kev ua haujlwm rau ntawm qhov chaw lossis hnav tau. Lawv tau ua raws li lub xwmfab nti, ob-tog protoboards nrog sib cuam tshuam los ntawm qhov.
Ib tug xov tooj ntawm cov BRICKS no yuav tsum yog nyob ntawm ntau lub node (Master MCUs - ESP8266 lossis ATTINY84) ntawm qhov chaw. MCU tsis xav tau kev paub ua ntej txog lub hom phiaj ntsuas lossis software xav tau. Nws ntsuas rau I2C cov nodes tom qab ntawv thov cov khoom pov tseg (cov ntaub ntawv sensor) los ntawm txhua tus qhev. Cov BRICKs muab 5.0V, 3.3V thiab lwm txoj kab AUX uas tuaj yeem tsim kho tau.
Qhov I2C MQ2 BRICK dumps 3 cov khoom:
LPG (Tshooj Ib lab), CO (PPM), SMOKE (PPM)
Qhov ntsuas no tau muab cov xwm txheej txaus nyiam: Nws xav tau tsawg kawg 2 feeb (txog 5 feeb) kom sov, tom qab ntawd nws yuav tsum ntsuas ntsuas li 20 vib nas this ua ntej siv. Raws li tus tswv tsev MCU tsuas yog xav paub kom tau txais lub npe/tus nqi khub (thiab txuas lus ntxiv), peb tau tshaj tawm "Npaj" cov cuab yeej. Raws li nws cov lus txuas ntxiv yog "1" (ntau ntxiv tuaj), Tus Tswv MCU yuav khaws qhov kev xaiv tsa BRICK kom txog thaum nws npaj tau. Tsis tas li nws tau pom zoo kom "Hlawv-hauv" MQ2 ua ntej siv xws li tawm mus txuas rau koj li 5V Circuit rau 24 teev.
Cov Keyes hom ntsuas cib yuav raug suav daws ua ntej vim lawv tuaj nrog cov vitamins (cov khoom siv ntxiv xav tau) suav nrog thiab yog tus cheep (Kuv yuav 37 rau 10AUD). Lwm cov laug cam/kab hluav taws xob yuav raug qhia rau I2C BRICKS.
Qhov dhau los ntawm qhov uas nyob ib sab ntawm ATTINY85 tau tso tseg tsis siv, txhawm rau ua kom tus pogo tus programmer thaum DIP8 tau muab muag rau PCB.
Ib qho kev tsis txaus ntseeg ntxiv, ntim BRICKS hauv lub tog raj kheej me uas txuas rau hauv D1M WIFI BLOCK hub, tso tus nqi rau MQTT server, tab tom tsim.
Kauj Ruam 1: Cov Khoom Siv thiab Cov Cuab Yeej
Muaj Daim Ntawv Teev Npe Tag Nrho ntawm Cov Khoom thiab Sourcing.
- MQ2 sensor cib (1)
- ATTINY85 20PU (1)
- 1 "Ob tog ob tog protoboard (1)
- Txiv neej Header 90º (3P, 3P)
- Txiv neej Header (2P, 2P)
- Jumper Shunt (1)
- Hookup hlau (~ 7)
- Cov laug thiab hlau (1)
Kauj Ruam 2: Npaj ATTINY85
AttinyCore los ntawm Tus Thawj Saib Xyuas Boards xav tau. Hlawv bootloader "EEPROM khaws cia", "8mHZ Internal" (txhua qhov teeb tsa pom saum toj no).
Siv cov peev txheej suav nrog; suav thiab ua haujlwm rau ATtiny85.
GIST nyob ntawm no:
gist.github.com/IOT-123/4c501046d365d01a60…
Koj tuaj yeem pom cov ntsiab lus ntxiv hauv cov lus qhia no:
www.instructables.com/id/Programming-the-A…
www.instructables.com/id/How-to-Program-AT…
www.instructables.com/id/How-to-program-th…
www.instructables.com/id/Programming-the-A…
www.instructables.com/id/Programming-an-At…
Qhov zoo tshaj los sim ntawm lub khob cij ua ntej txuas ntxiv.
Yog tias koj muaj ASSIMILATE SENSORS uas twb muaj lawm, xyuas kom tus qhev qhov chaw nyob sib txawv ntawm SENSOR/MCU Host ua ke piv txwv li txhua qhov ntsuas kub tuaj yeem muaj tib qhov chaw nyob yog tias koj tsuas muaj ib qho ntsuas kub ntawm MCU/ntawm qhov.
Kauj Ruam 3: Sib dhos Circuit
- Nyob rau sab xub ntiag, ntxig cov khoom ATTINY85 (1), 3P 90deg txiv neej lub taub hau (2) (3), 2P txiv neej lub taub hau (4) (5), thiab muab tso rau tom qab.
- Ntawm sab nraub qaum, taug ib txoj kab txiv kab ntxwv los ntawm ORANGE1 mus rau ORANGE2 thiab cov laug.
- Ntawm sab nraub qaum, xaim xaim xaim los ntawm BLUE1 rau BLUE2 thiab cov laug.
- Ntawm sab nraub qaum, taug ib txoj kab ntsuab los ntawm GREEN1 rau GREEN2 thiab cov laug.
- Ntawm sab nraub qaum, taug ib txoj kab liab qab ntawm SILVER1 rau SILVER2 thiab cov laug.
- Ntawm sab nraub qaum, taug ib txoj kab liab qab ntawm SILVER3 mus rau SILVER4 thiab cov laug.
- Ntawm sab nraub qaum, taug ib txoj kab dub los ntawm BLACK1 rau BLACK2 thiab cov laug.
- Ntawm sab nraub qaum, taug ib txoj kab dub los ntawm BLACK3 rau BLACK4 thiab cov laug.
- Nyob tom qab, taug ib txoj kab liab los ntawm RED1 mus rau RED2 thiab cov laug.
- Nyob tom qab, taug ib txoj kab liab los ntawm RED3 mus rau RED4 thiab cov laug.
- Sab nraub qaum, taug ib txoj kab daj los ntawm YELLOW1 mus rau YELLOW2 thiab cov laug.
Tam sim no lub ntsuas hluav taws xob tuaj yeem txuas ncaj qha los ntawm nws cov pins rau PCB lossis ntawm cov xov hlau, mus rau cov ntsiab lus pom hauv daim ntawv cog lus tus pin.
Kauj ruam 4: Xeem
Tus lej ntawm cov BRICKS no yuav tsum yog nyob ntawm ntau lub hauv paus (MCUs - ESP8266 lossis ATTINY84) hauv ib puag ncig. Nov yog qhov ntsuas ntsuas: txheeb xyuas UNO qhov kev thov/lus teb kom txog thaum tag nrho cov ntaub ntawv raug pov tseg, tom qab ntawd tsis quav ntsej I2C qhev.
- Tshaj tawm UNO code rau koj li UNO cov hlua ntsuas. Xyuas kom ADDRESS_SLAVE phim rau BRICK qhov I2C chaw nyob.
- Txuas 5.0V ntawm UNO rau VCC ntawm BRICK.
- Xyuas kom lub jumper rau tus pin ntawd nyob.
- Txuas GND ntawm UNO rau GND ntawm BRICK.
- Txuas A5 ntawm UNO rau SCL ntawm BRICK.
- Txuas A4 ntawm UNO rau SDA ntawm BRICK.
- Txuas tus 4K7 rub tawm tus tiv thaiv los ntawm SDA rau VCC.
- Txuas tus 4K7 rub tawm tus tiv thaiv los ntawm SCL rau VCC.
- Txuas koj UNO rau koj Dev PC nrog USB.
- Qhib Arduino Console. Choose 9600 baud (rov pib dua UNO thiab rov qhib lub console yog tias koj yuav tsum tau).
- Cov Khoom Npe thiab cov txiaj ntsig yuav tsum tau luam tawm rau lub console ib zaug ces lo lus pw tsaug zog tau rov ua dua.
Yog tias koj pom "teeb tsa" ces 3 kab ntawm cov khib nyiab rov ua dua koj yuav muaj koj li SDA thiab SCL kab rov qab rau pem hauv ntej.
I2C Master nkag los ntawm I2C qhev nrog cov phiaj xwm/metadata txhawb nqa
#suav nrog |
#defineADDRESS_SLAVE10 |
bool _outputPlotterOnly = tsis tseeb; |
bool _confirmedMetadata = tsis tseeb; |
int _packetSegment = 0; |
bool _i2cNodeProcessed = tsis tseeb; |
char _property [2] [24] = {"lub npe", "tus nqi"}; |
voidsetup () { |
Hlau.begin (); // koom nrog i2c npav (chaw nyob yeem rau tus tswv) |
Serial.begin (9600); // pib serial rau cov zis |
ncua (1000); |
yog (! _outputPlotterOnly) { |
Serial.println ("teeb tsa"); |
Serial.println (); |
} |
} |
voidloop () { |
yog (_i2cNodeProcessed) { |
yog (! _confirmedMetadata) {// qhia rau tus qhev paub pib xa cov ntaub ntawv sensor |
ncua (1); |
Wire.beginTransmission (ADDRESS_SLAVE); |
Hlau.write (1); |
Wire.endTransmission (); |
ncua (100); |
_confirmedMetadata = muaj tseeb; |
} |
_i2cNodeProcessed = tsis tseeb; |
yog (! _outputPlotterOnly) { |
Serial.println (); |
} |
rov qab; |
} |
Wire.requestFrom (ADDRESS_SLAVE, 16); |
_packetSegment ++; |
pob ntawv [16]; |
intindex = 0; |
bool isContinueSegment = tsis tseeb; // txuas ntxiv (ntu thib 3) 1 = ntau dua, 0 = zaum kawg |
thaum (Wire.available ()) {// qhev yuav xa tsawg dua qhov tau thov |
char c = Hlau.read (); |
pob [index] = int (c)> -1? c: ''; // hloov cov ntawv tsis raug nrog qhov chaw |
yog (_packetSegment == 3) { |
_packetSegment = 0; |
isContinueSegment = muaj tseeb; |
//Serial.println("------------- "); |
//Serial.println(int (c)); |
//Serial.println("------------- "); |
yog (int (c) == 48 || int (c) == 86) {// 0 ntawm cov khoom kawg |
_i2cNodeProcessed = tseeb; |
// xa qhov tseem ceeb rau MQTT |
tawg; |
} |
} |
index ++; |
} |
yog (! isContinueSegment) { |
yog (! _outputPlotterOnly) { |
Serial.println (pob ntawv); |
} |
strcpy (_property [_packetSegment - 1], pob ntawv); // teeb tsa lub zos var nrog lub npe/tus nqi |
lwm yam { |
yog (_outputPlotterOnly && _confirmedMetadata) { |
yog (_i2cNodeProcessed) { |
Serial.println (_ khoom [1]); |
lwm yam { |
Serial.print (_property [1]); |
Serial.print (""); |
} |
} |
} |
} |
saib rawuno_i2c_generic_sensor_test_w_plotter_v2.ino tuav nrog ❤ los ntawm GitHub
Kauj Ruam 5: Cov Kauj Ruam Tom ntej
Cov txheej txheem yooj yim ntawm Circuit Court thiab I2C txheej ntawm software yog cuam tshuam-muaj peev xwm rau ntau qhov sib txawv. Qhov tseem ceeb kom tau txais txoj cai pib nrog, yog daim ntawv cog lus ntawm tus tswv thiab qhev.
Kuv tau tshaj tawm/pib ua (3D luam tawm) ntim cov network ntawm cov ntsuas uas siv lub moj khaum no thiab yuav txuas rau nws raws li ntu tau tshaj tawm.
Qhov BLOCK no yog siv los ntawm MQ2 ASSIMILATE SENSOR.
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
IOT123 - ASSIMILATE SENSOR: MQ2: 4 Cov Kauj Ruam
IOT123 - ASSIMILATE SENSOR: MQ2: ASSIMILATE SENSORS yog ib puag ncig cov cuab yeej uas tau ntxiv cov kho vajtse thiab software rho tawm txheej, ua rau nws muaj peev xwm ua tiav yam tshiab kom ntxiv rau ASSIMILATE SENSOR HUB thiab nyeem tau tso rau hauv MQTT server yam tsis ntxiv codin
IOT123 - LIR2032 BATTERY BRICK: 4 Kauj Ruam
IOT123 - LIR2032 roj teeb lub teeb: IOT123 BRICKS yog DIY chav nyob sib dhos uas tuaj yeem sib xyaw ua ke nrog lwm IOT123 BRICKS, txhawm rau ntxiv kev ua haujlwm rau ntawm qhov chaw lossis hnav tau. Lawv tau ua raws li lub xwmfab nti, ob tog sib thooj protoboards nrog kev sib txuas sib txuas los ntawm qhov … Txawm hais tias cov lus qhia
IOT123 - 3.3V POWER BRICK: 4 Cov kauj ruam
IOT123 - 3.3V POWER BRICK: IOT123 BRICKS yog DIY chav nyob uas tuaj yeem sib xyaw nrog lwm IOT123 BRICKS, txhawm rau ntxiv kev ua haujlwm rau ntawm qhov chaw lossis hnav tau. Lawv tau ua raws li lub xwmfab nti, ob tog sib thooj protoboards nrog kev sib txuas sib txuas los ntawm qhov … Txawm hais tias cov lus qhia
IOT123 - 5PIN ATTINY85 NRF24L01 BRICK: 4 Kauj Ruam
IOT123 - 5PIN ATTINY85 NRF24L01 BRICK: Hloov tshiab: Qhov teeb tsa no yog kev kawm ntau lossis lub hauv paus rau kev sim software/fais fab mov. Txawm hais tias thaum PB5 yog neeg xiam oob qhab raws li RESET, nws tsis nyeem qhov tseem ceeb raug siv analogRead: rooj plaub siv tseem ceeb rau kev nyeem ntawv sensor. Yuav saib mus rau ATTINY84 teeb tsa