Cov txheej txheem:
- Kauj Ruam 1: Xav Tau Kho Vajtse
- Kauj Ruam 2: Kev Sib Txuas Kho Vajtse
- Kauj Ruam 3: Ua Haujlwm thiab Code (Siv Java)
Video: Relay Tswj Nrog Raspberry Pi: 3 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Peb txhua tus tau ntsib teeb meem thaum raspberry pi board tsis muaj peev xwm hloov pauv ntawm ntau yam khoom siv ib txhij. Yog li txuas ntau yam khoom siv siv 26 GPIO pins tsis tuaj yeem ua tau. Ntxiv mus, nws tsis tuaj yeem txuas ntxiv mus dhau 26 yog li ntau dua 26 lub cuab yeej tsis tuaj yeem txuas nrog.
Qhov teeb meem no tuaj yeem daws tau los ntawm kev siv GPIO lub taub hau. Ntawm ib lub taub hau, peb tuaj yeem txuas Lub Rooj Sib Tham Relay nrog txog 16 Relays thiab peb tuaj yeem txuas ntxiv suav cov laug cam rau 128. Yog li, tag nrho, 128*16 cov cuab yeej tuaj yeem txuas nrog.
Cia Peb Pib!
Kauj Ruam 1: Xav Tau Kho Vajtse
Rau qhov haujlwm no, peb yuav siv:
1. Tus Tswj Tus Kheej
2. Raspberry Pi
3. I2C ntaub thaiv npog
4. 12V Lub Hwj Chim Adapter
5. I2C Txuas Txuas Cable
Koj tuaj yeem yuav cov khoom los ntawm txhaj rau lawv. Tsis tas li, koj tuaj yeem pom cov khoom zoo ntxiv ntawm Dcube Store.
Kauj Ruam 2: Kev Sib Txuas Kho Vajtse
Cov kauj ruam los txuas Raspberry Pi nrog I2C Shield/Adapter
Ua ntej, coj Raspberry Pi thiab tso I²C Shield rau nws. Nias lub Shield maj mam thiab peb tau ua tiav nrog cov kauj ruam no yooj yim li ncuav qab zib (saib daim duab #1 ).;
Kev sib txuas ntawm MCP23008 Tus Tswj Tus Kheej thiab Raspberry Pi
Siv tus I2C cable, txuas MCP23008 Txuas tus tswj mus rau Raspberry ntawm I2C txuas chaw nres nkoj ntawm I2C Shield (saib daim duab #3).
Hwj chim rau cov laug cam
Raspberry Pi tuaj yeem siv tau los ntawm ib qho Micro USB Cable. Nws ua haujlwm ntawm 5V thiab 2A. Txuas lub Micro USB cable rau hauv lub hwj chim nkaus ntawm Raspberry Pi. Tsis tas li, tsis txhob hnov qab tso lub hwj chim rau Tus Tswj Tus Kheej nrog 12V Lub Hwj Chim Adapter. Plug rau hauv thiab peb zoo mus!
Qhov kev sib txuas zaum kawg tau muab rau hauv daim duab #4.
Kauj Ruam 3: Ua Haujlwm thiab Code (Siv Java)
Peb tau khau raj lub cuab yeej nrog Linux (Raspbian). Hauv qhov no, peb tab tom siv Raspberry Pi nrog Monitor Screen
1. Nruab "pi4j library" los ntawm https://pi4j.com/install.html. Pi4j yog Java Lub Tsev Qiv Ntawv Tso Tawm/Tso Tawm rau Raspberry Pi. Ib txoj hauv kev yooj yim thiab nyiam tshaj plaws los teeb tsa "pi4j library" yog ua raws cov lus hais hauv qab no ncaj qha rau hauv koj li Raspberry Pi:
curl -s get.pi4j.com | sudo bash LOS YOG curl -s get.pi4j.com
2. Txhawm rau tsim cov ntawv tshiab uas yuav sau cov cai, cov lus txib hauv qab no yuav raug siv:
vi FILE_NAME.java
np. vi SAMPLE1.java
3. Tom qab tsim cov ntawv, peb tuaj yeem nkag mus rau tus lej hauv no. Qee qhov piv txwv java cov lej muaj nyob ntawm peb GitHub Cov Chaw Cia Khoom. Cov no tau npaj los siv yooj yim los ntawm kev luam lawv los ntawm no.
4. Txhawm rau ntxig tus lej nias "i".
5. Luam cov cai los ntawm cov chaw khaws khoom saum toj no thiab muab nws tso rau hauv cov ntawv uas koj tsim.
6. Nyem “esc” ib zaug ua tiav nrog cov cim.
7. Tom qab ntawv siv cov lus hais hauv qab no kom tawm ntawm lub qhov rai chaws:
wq: twg
Nov yog sau ntawv txiav txim kom rov qab los rau lub qhov rai qhov rai
8. Sau cov cai siv cov lus txib hauv qab no:
pi4j FILE_NAME.java
np. pi4j SAMPLE1.java
9. Yog tias tsis muaj qhov yuam kev, khiav qhov program siv cov lus hais hauv qab no:
pi4j FILE_NAME
Piv txwv pi4j SAMPLE1
Cov chaw cia khoom muaj 5 tus lej piv txwv thiab tuaj yeem tswj kev xa tawm hauv ntau qhov sib txawv ua ke. Yog li peb tau ua tiav Relay tswj nrog raspberry pi.
Cia peb pom lub suab twg koj tuaj yeem ua, kom ua las voos txuas ntxiv !!
Pom zoo:
4CH Relay-board Tswj Nrog Cov Khawm Push: 4 Cov Kauj Ruam
4CH Relay-board Tswj Nrog Push Button: Kuv lub hom phiaj yog txhawm rau txhim kho kuv Anet A8 3D-tshuab luam ntawv los ntawm kev ntxiv lub zog tswj kev tswj hwm ntawm Octoprint interface. Txawm li cas los xij, Kuv kuj xav kom tuaj yeem pib " manually " kuv lub tshuab luam ntawv 3D, lub ntsiab lus tsis siv lub web interface tab sis tsuas yog nias lub pob
Phab Ntsa Mount rau IPad Raws Li Tsev Automation Tswj Vaj Huam Sib Luag, Siv Servo Tswj Cov Hlau nplaum los Qhib Screen: 4 Cov Kauj Ruam (nrog Duab)
Phab Ntsa Mount rau IPad Raws Li Tsev Automation Tswj Vaj Huam Sib Luag, Siv Servo Tswj Cov Hlau nplaum los Qhib Screen: Tsis ntev los no kuv tau siv sijhawm qee lub sijhawm siv khoom hauv thiab ib puag ncig kuv lub tsev. Kuv tab tom siv Domoticz ua kuv daim ntawv thov Tsev Automation, saib www.domoticz.com kom paub meej. Hauv kuv tshawb nrhiav daim ntawv thov daim ntawv qhia uas qhia tag nrho Domoticz cov ntaub ntawv tog
ESP8266 RGB LED Sawb WIFI Tswj - NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi - RGB LED Sawb Smartphone Tswj: 4 Cov Kauj Ruam
ESP8266 RGB LED Sawb WIFI Tswj | NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi | RGB LED Sawb Smartphone Tswj: Nyob zoo cov neeg hauv qhov kev qhia no peb yuav kawm paub siv nodemcu lossis esp8266 li IR chaw taws teeb los tswj RGB LED sawb thiab Nodemcu yuav raug tswj los ntawm smartphone dhau wifi. Yog li hauv paus koj tuaj yeem tswj RGB LED Sawb nrog koj lub xov tooj
Yuav Ua Li Cas Tswj Cov Khoom Siv Hauv Tsev Nrog TV Chaw Taws Teeb Nrog Timer Ua Haujlwm: 7 Cov Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Tswj Cov Khoom Siv Hauv Tsev Nrog TV Chaw Taws Teeb Nrog Lub Sijhawm Ua Haujlwm: Txawm tias tom qab 25 xyoo ntawm nws qhov kev qhia rau cov neeg siv khoom lag luam, kev sib txuas lus infrared tseem muaj feem cuam tshuam nyob rau hnub tsis ntev los no. Txawm hais tias nws yog koj li 55 nti 4K TV lossis koj lub suab lub tsheb, txhua yam xav tau IR chaw taws teeb tswj los teb rau peb
Tswj Cov Khoom Siv Los Ntawm Arduino Nrog Cov Neeg Siv Khoom Hloov: 8 Cov Kauj Ruam (nrog Duab)
Kev Tswj Cov Khoom Siv Los Ntawm Arduino Nrog Kev Siv Hluav Taws Xob: Lub Arduino tuaj yeem siv los tswj cov cuab yeej los ntawm kev siv cov khoom siv yooj yim hloov pauv hloov chaw