Cov txheej txheem:
- Kauj ruam 1: Wirering
- Kauj Ruam 2: Piv Cai Yooj Yim:
- Kauj Ruam 3: Plaub Relay Test Code
- Kauj ruam 4: Kuv Qhov Project
- Kauj Ruam 5: Hu Xov Tooj Relay Nrog Ib Qhov Lus txib
Video: I2C Relay ntsib Arduino IDE: 5 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Kuv xaj cov ntawv xa xov zoo tab sis tsis muaj kev qhia ArduinoIDE, tsuas yog Raspberry Pi e.o. Kuv pom yuav siv nws nrog Arduino thiab xav qhia nws kom koj tuaj yeem txuag lub sijhawm ntawd.
Thawj RaspberryPi piv txwv:
wiki.52pi.com/index.php/DockerPi_4_Channel_Relay_SKU:_EP-0099
Qhov zoo yog tias koj tuaj yeem sib sau tau txog 4 daim txiag. Yog li koj tuaj yeem siv max. 4 x 4 = 16 tus xa tawm ntawm ib lub tsheb npav I2C.
Tseem muaj qee qhov tsis zoo:
- terminas me me, tsis haum 1 mm2 xaim
- koj tsis tuaj yeem hloov txoj hlua ntawm cov txuas hauv qab thaum lawv tau teeb ua ke
Tab sis tseem siv tau cov board.
Kauj ruam 1: Wirering
Hauv cov duab koj tuaj yeem pom cov xov hlau.
52Pi xav tau ob qho tib si 5V (rau relay's) en 3.3V (I2C chip).
Yog li 5 xaim xav tau:
- GND to CSY
- 5v rau 5v
- 3.3 V rau 3.3 V
- SLA to SWV
- SCL to CSY
Yog tias koj siv Arduino UNO lossis lwm 5 V yog cov khoom siv ntawm qhov siab tshaj 3, 6 V los ntawm I2C maub los! Siv cov tshuaj tiv thaiv lossis lwm yam kom txo 5 V tawm ntawm Arduino PIN's!
Kauj Ruam 2: Piv Cai Yooj Yim:
/* Arduino IDE (ESP) piv txwv rau I2C relaisboard.
* Los ntawm Laurens Korste www.boktorrobotica.nl * siv dawb. */ #include // rau I2C kev sib txuas lus tsis muaj teeb meem () {// txoj cai no tsis yog rau UNO lossis cov laug cam uas mob siab rau I2C pins Wire.begin (D1, D2); // koom nrog i2c npav nrog SDA = D1 thiab SCL = D2 rau NodeMCU} void loop () {Wire.beginTransmission (0x10);/ * pib kis mus rau I2C chaw nyob 10 (kom hloov mus rau 11, 12 lossis 13) */ Hlau.write (0x01); / * xaiv relais 1 (tawm ntawm 4) ntawm board 10 (tseem 0x02, 0x03, 0x04) */ Wire.write (0xFF); /* teeb tsa relais 1 ntawm board 10 rau ON. txhua tus lej> 0 yuav ua li ntawd */ Wire.endTransmission (); / * nres kev xa xov */ ncua (3000); Wire.beginTransmission (0x10); / * */ Wire.write (0x01); Hlau.write (0x00); / * teeb tsa relais 1 ntawm board 10 rau OFF */ Wire.endTransmission (); / * nres kev xa xov */ ncua (3000); }
Kauj Ruam 3: Plaub Relay Test Code
/* kos duab los ntawm Laurens Korste rau Arduino (ESP / NodeMCU)
* Tab sis lwm cov laug cam tseem yuav ua tau * www.boktorrobotica.nl * Hauv qhov no skeych al 4 relay's yuav tau qhib ua kom tsis ua haujlwm */ #include // rau I2C kev sib txuas lus tsis muaj teeb tsa () {Serial.begin (115200); // pib serial rau debug (9600 rau UNO) Wire.begin (D1, D2); // koom nrog i2c tsheb npav nrog SDA = D1 thiab SCL = D2 ntawm NodeMCU tsis xav tau UNO} void loop () {rau (int i = 1; i <= 4; i ++) {Wire.beginTransmission (0x10); // pib nrog ntaus ntawv chaw nyob Wire.write (i); // xaiv qhov relais Wire.write (0xFF); // xa tus lej "ntawm" code FF (txhua qhov suav los ntawm 01 rau FF yuav ua) Wire.endTransmission (); // nres kis Serial.write (i); Serial.println ("aan"); ncua (1000); Wire.beginTransmission (0x10); // pib nrog ntaus ntawv chaw nyob Wire.write (i); Hlau.write (0x00); // Xa qhov "tawm" code Wire.endTransmission (); // nres kis Serial.write (i); Serial.println ("ua"); ncua (1000); }}
Kauj ruam 4: Kuv Qhov Project
Kuv tau sau ib txoj cai los ua haujlwm kuv 3 lub qhov rooj qhov no tuaj yeem ua tiav nrog cov hloov pauv tab sis kuj tseem nrog BLYNK app, Saib duab.
- Ib qho xovxwm luv luv yuav pib txav ib lub shutter (lossis nres nws thaum nws txav mus).
- Ib lub xovxwm ntev thiab tag nrho peb lub qhov rooj qhib (lossis kaw lossis nres).
- Ob chav siab: lub qhov rooj mus rau qhov "qhov" txoj haujlwm.
Raws li tuaj yeem pom hauv daim duab, Kuv kuj suav nrog ntsuas kub thiab lub teeb pom kev zoo.
Tam sim no txhua yam ntawm lub hauv paus PCB zoo thiab ua kom zoo nyob hauv ib lub thawv.
Kauj Ruam 5: Hu Xov Tooj Relay Nrog Ib Qhov Lus txib
Nws muaj txiaj ntsig yog tias koj tsuas yog xav tau ib lo lus txib kom qhib lossis ua kom tsis txhob rov ua haujlwm dua. Hauv qab no yog lub luag haujlwm uas tuaj yeem ua qhov no (nrog lowbyte thiab highbyte).
/ * kos duab los ntawm Laurens Korste rau Arduino (ESP/NodeMCU) nrog I2C relaysboard * Tab sis lwm cov laug cam tseem yuav ua * href = https://www.boktorrobotica.nl; www.boktorrobotica.nl * https://wiki.52pi.com/index.php/DockerPi_4_Channel_Relay_SKU: _EP-0099; www.boktorrobotica.nl * Hauv daim duab qhia no, kev xa xov yuav raug qhib los ntawm ib qho hu; * // #include // rau I2C kev sib txuas lus // Tshaj tawm tshaj tawm. 4 PCB's Per PCB 4 qhov hloov pauv tau. Hauv qhov kos duab no tsuas yog ob lub PCB // PCB thiab kev xa tawm tau koom ua ke kom lawv tuaj yeem hu nrog ib qho lus txib const byte PutOn = 0xFF; // hais kom hloov ntawm const byte PutOff = 0x00; // comand kom hloov tawm const lo lus Relay1bord1 = 0x1001; // koj tuaj yeem muaj lub npe los ntawm qhov piv txwv Relay1 const lo lus Relay2bord1 = 0x1002; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay2 const lo lus Relay3bord1 = 0x1003; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay3 const lo lus Relay4bord1 = 0x1004; // koj tuaj yeem muaj lub npe los ntawm qhov piv txwv Relay4 const lo lus Relay1bord2 = 0x1101; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay5 const w ord Relay2bord2 = 0x1102; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay6 const lo lus Relay3bord2 = 0x1103; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay7 const lo lus Relay4bord2 = 0x1104; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay8 const lo lus Relay1bord3 = 0x1201; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay9 const lo lus Relay2bord4 = 0x1302; // koj tuaj yeem muaj sijhawm los ntawm cov npe piv txwv Relay14 tsis muaj teeb meem teeb tsa () {Serial.begin (115200); // pib serial rau debug (9600 rau UNO) Wire.begin (D1, D2); // koom nrog i2c npav nrog SDA = D1 thiab SCL = D2 ntawm NodeMCU tsis xav tau UNO} void loop () {// los hloov relay 4 ntawm PCB 2 ntawm RelayActie (Relay4bord2, PutOn); ncua (1000); // txhawm rau hloov relay 4 ntawm PCB 2 tawm RelayActie (Relay4bord2, PutOff); ncua (1000); } void RelayActie (lo lus Relay, byte OnOrOff) {Wire.beginTransmission (highByte (Relay)); Wire.write (lowByte (Relay)); Wire.write (OnOrOff); Wire.endTransmission (); }
Pom zoo:
Ntsib Twinky Cutest Arduino Robot: 7 Cov Kauj Ruam (nrog Duab)
Ntsib Twinky Cutest Arduino Robot: Nyob Zoo, Hauv cov lus qhia no kuv yuav qhia koj li cas kuv tau ua kuv tus kheej "Jibo" tab sis hu ua "Twinky" Kuv xav kom tshem tawm qhov no … Qhov no tsis yog COPY! Kuv tau tsim tsa ob leeg thiab tom qab ntawd kuv lees paub tias qee yam zoo li qhov no tseem muaj nyob: nws muaj
Paws los Ntxuav - Miv Ntsib Covid Txoj Haujlwm Kev Ntxuav Tes: 5 Kauj Ruam (nrog Duab)
Paws Kom Ntxhua - Miv Ua Tau Raws Li Qhov Kev Ntxuav Tes: Vim tias peb txhua tus nyob deb ntawm tsev, Paws rau Ntxhua yog DIY qhov haujlwm uas coj cov niam txiv thiab menyuam los ntawm cov txheej txheem tsim lub ntsej muag ntxim nyiam lub sijhawm nrog lub tswb miv txhawm rau txhawb kev noj zaub mov kom huv. Hauv lub sijhawm Covid-19, ntxuav tes kom huv
Kev Sib Ntsib Cov Lus Sib Tham Ua Ke: 6 Kauj Ruam (nrog Duab)
Sociable Syllables Activity Pad: The Sociable Syllables Activity Pad tau tsim los ua Kev Pab Cuam Qhia Txuj Ci rau Kev Nyuaj Siab ntawm cov tub ntxhais kawm. Hauv kuv qhov kev kawm hauv chav kawm thiab tom qab sib tham nrog Hard of Hearing Consultants, 3 lub tswv yim los rau hauv siab hauv kev tsim cov
Dawb Oak Ntsib Cov Neeg Hais Lus Muaj Hwjchim Loj: 16 Cov Kauj Ruam (nrog Duab)
Dawb Oak Ntsib Lub Hwj Chim Passive Hais Lus: Qhov no yog kuv qhov kev hais lus thib peb thiab txawv kiag li rau yav dhau los! Lub sijhawm no kuv yuav ua qee qhov loj, muaj zog thiab zoo saib mus rau hauv kuv chav suab! Kuv muaj qee qhov haujlwm hauv Instagram, thov txheeb xyuas lawv! Kuv ets
Pomodoro Timer Ntsib LED Ntiv Nplhaib: 5 Kauj Ruam
Pomodoro Timer ntsib LED Nplhaib: Voor het ITTT-project heb ik een variatie op een Pomodoro timer gemaakt. De Pomodoro "thev naus laus zis" yog een tijdmanagementmethode tuag gebruikers kan helpen om grote projecten hauv kleine stappen te verdelen en regelmatig pauze te houden. Hierbij… nyeem ntxiv