Cov txheej txheem:
- Kauj ruam 1: Paub meej
- Kauj Ruam 2: Ribbon Cable Kev Sib Txuas thiab Txuas ntawm Cov Kws Tshaj Lij, xa rov qab, khawm
- Kauj Ruam 3: Daim vis dis aus ntawm Daim Ntawv Thov
Video: Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Lub Hwj Huam Fais Fab: 3 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Cov lus qhia-rooj no yuav pab koj teeb tsa Raspberry Pi nrog Isolated GPIO Board.
Cov yam ntxwv ntawm pawg thawj coj yog
1) 12 txog 24V kev tawm tswv yim thiab tso tawm (cov qauv kev lag luam).
2) Raspberry Pi tus pin rau tus pin sib txuam Headers kom koj tuaj yeem teeb nws ntawm Pi.
3) Plaub Lub Tswv Yim thiab Plaub Qhov Chaw Tawm Tsam.
4) Ib qho Av Hauv Ntej Terminal Thaiv rau sensor Hauv av txuas.
5) Ntawm lub nkoj 24V rau 5V hloov pauv rau lub zog ntawm pi ncaj qha.
Kauj ruam 1: Paub meej
Saum toj no duab 1 qhia cov tswv yim txuas hluav taws xob txuas, tus tuav fuse, P1 lub taub hau rau txuas rau raspberry pi thiab cov tswv yim, cov txuas txuas tawm. IN1, IN2, IN3, thiab IN4 yog cov tswv yim (24V). OUT1, OUT2, OUT3 thiab OUT4 yog cov zis (24V). OUT_GND1 thaj av ib puag ncig, P1 qhia pom raspberry pi ib rau ib qho ua piv txwv.
Saum toj no duab 2 Qhia P1 header pinout. We tau siv yim gpio's rau plaub lub tswv yim thiab plaub qhov tso tawm los ntawm raspberry pi header. Ntawm cais pawg gpio cais, Plaub nkag gpios yog:
Gpio6 --- Pin No.31 --- IN4
Gpio13 --- Pin No.33 --- IN3
Gpio19 --- Pin No.35 --- IN2
Gpio26 --- Pin No.37 --- IN1
thiab Plaub qhov tso tawm yog
Gpio4 --- Pin No.7 --- OUT4
Gpio17 --- Pin No.11 --- OUT3
Gpio27 --- Pin No.13 --- OUT2
Gpio22 --- Pin No.15 --- OUT1
DIN yog tso tawm los ntawm lub ntsuas pa/khawm thiab nkag mus rau lub rooj tsavxwm.
Kauj Ruam 2: Ribbon Cable Kev Sib Txuas thiab Txuas ntawm Cov Kws Tshaj Lij, xa rov qab, khawm
Xa daim duab 1 rau FRC kev sib txuas
Daim duab 2 qhia pom qhov thaiv ntawm lub ntsuas cua, lub khawm thawb thiab xa tawm.
1] Sensor Ib qho peb-xaim sensor muaj 3 xaim tam sim no. Ob lub xov tooj hluav taws xob thiab ib lub xaim thauj khoom. Cov xov hluav taws xob yuav txuas rau lub zog siv hluav taws xob thiab cov hlau txuas rau qee yam kev thauj khoom. Lub nra yog cov cuab yeej uas raug tswj los ntawm lub ntsuas. Raspberry pi cais tawm gpio board cov tswv yim yog ob lub dav hlau thaiv qhov uas peb txuas cov kab hluav taws xob ob lub xov hlau, ib qho yog lub zog ntawm lub ntsuas hluav taws xob thiab lwm qhov yog tso tawm ntawm lub ntsuas cua, 3 rd hlau yog txuas hauv av. Xa daim duab saum toj no.
2] Push Button Push button muaj plaub lub ntsiab lus txuas ob rau kev nkag mus rau lwm ob rau rau qhov tso tawm, daim duab saum toj no qhia txog kev sib txuas ntawm cov tswv yim thiab tso tawm ntawm lub laub khawm. Xa daim duab saum toj no.
3] Kev Tshaj Tawm Sab saum toj daim duab qhia qhov txuas txuas ntawm kev xa tawm, peb tuaj yeem tsav lub cav los ntawm kev xa rov qab, kev sib txuas ntawm kev xa tawm thiab lub cev muaj zog qhia hauv daim duab, COM yuav tsum txuas 12/24V (nyob ntawm kev xa tawm) lub zog xa khoom.
Tsis tas li Yog tias koj xav tau kev ua kom tiav hauv av thiab tsis xav siv 12/24VDC rau 5V DC ntawm pawg tswj hwm lub zog koj tuaj yeem ua qhov no los ntawm kev tshem tawm tus tiv thaiv R32, J1. Qhov no muaj txiaj ntsig yog tias qee qhov emi los ntawm kev ua haujlwm tau ua rau Pi
Kauj Ruam 3: Daim vis dis aus ntawm Daim Ntawv Thov
Thawj Yeeb Yaj Kiab yog daim ntawv thov siv ob lub 24VDC khawm, Ib qho rau Reboot thiab lwm qhov rau Shutdown
Rau Reboot Code
Rau Shutdown Code
Ob leeg yuav tsum tau khiav thaum khau raj. Qhov no tuaj yeem ua tiav los ntawm kev khiav lub plhaub ntawv ntawm khau raj (siv rc.local).
Nov yog qhov piv txwv ntawm tsab ntawv lub npe "start_python.sh"
#!/bin/sh# launcher.sh
# mus rau phau ntawv teev npe hauv tsev, tom qab ntawv mus rau cov npe no, tom qab ntawd ua kab ntawv nab hab sej
#/bin/ID nkag mus -f hauv paus
cd / cov
cd/hauv paus/Desktop/pib
loj 30
nab hab sej /root/Desktop/startup/reboot.py &
nab hab sej /root/Desktop/startup/shutdown.py &
Luam qhov saum toj no ntawm start_python.sh cov ntaub ntawv thiab teeb tsa kev tso cai siv chmod.eg
chmod 755/hauv paus/Desktop/pib/pib/pib_python.sh
tom qab no mus rau
nano /etc/rc.local
thiab ntxiv qhov no hauv qab
sh /root/Desktop/startup/start_python.sh
Video thib ob Kuv tsuas yog ua rau txhua qhov kev tso tawm hauv ib ntu zuj zus thiab tau txuas rau lub teeb nyem rov qab.
Nov yog Txoj Cai
kom khiav cov cai koj yuav tsum qhib davhlau ya nyob twg thiab ntaus
python npe file
cov ntaub ntawv npe ntawm no yuav yog lub npe ntawm tsab ntawv nab nab
Pom zoo:
2x 48V 5A Lub Rooj Sab Laj Lub Hwj Huam Fais Fab: 7 Kauj Ruam (nrog Duab)
2x 48V 5A Lub Rooj Sab Laj Lub Hwj Huam Fais Fab: Qhov no yog kev qhia rau teeb tsa lub rooj zaum saum lub zog. Tsis txhob cia siab tias yuav muaj kev txhim kho hluav taws xob lossis ntau ntau ntawm qhov muag, Kuv tsuas yog xaj qee qhov ntawm AliExpress thiab muab tso rau hauv ib lub thawv. Thov ceev faj tias kuv tau ua qee qhov kev hloov me me ntawm cov ntawv tshaj tawm
Kev Saib Xyuas Lub Hwj Chim Nyob Nrawm thiab Kev Tshaj Tawm ntawm Lub Hnub Ci Raws Lub Hwj Huam Fais Fab: 10 Kauj Ruam
Kev Saib Xyuas Lub Hwj Chim Nyob Nrawm thiab Kev Tshaj Tawm ntawm Lub Hnub Ci Raws Lub Hwj Huam Fais Fab: Lub hom phiaj ntawm txoj haujlwm no yog txhawm rau saib xyuas thiab faib cov khoom siv hluav taws xob hauv lub tshuab hluav taws xob (hnub ci zog). Kev tsim qauv ntawm cov txheej txheem no tau piav qhia hauv cov ntsiab lus raws li hauv qab no. Lub kaw lus muaj ntau daim phiaj nrog kwv yees li 2 lub hnub ci ci nyob hauv
Yuav Ua Li Cas Tsim Lub Rooj Zaum-Lub Hwj Huam Fais Fab: 9 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Tsim Lub Rooj Zaum-Lub Hwj Huam Fais Fab: Ib qho tseem ceeb ntawm txhua qhov haujlwm hluav taws xob yog hluav taws xob. Koj tuaj yeem siv cov roj teeb tsis muaj qhov kawg, lossis siv lub zog yooj yim, muab lub zog kom muaj zog tag nrho koj cov phiaj xwm hluav taws xob. Nov yog qhov pib ua haujlwm zoo hluav taws xob rau cov uas tsuas yog
Hloov Belkin FM Transmitter Los Ntawm Lub Hwj Huam Lub Hwj Chim rau Lub Hwj Chim Tsheb: 8 Kauj Ruam
Hloov Belkin FM Transmitter Los Ntawm Roj Teeb Hluav Taws Xob rau Lub Tsheb Fais Fab: Kuv muaj ib tus thawj Belkin Tunecast FM transmitters rau kuv iPod. Tom qab kuv pub nws ib khub AA roj teeb kuv txiav txim siab kuv xav tau txoj hauv kev zoo dua. Yog li, ntawm no yog yuav ua li cas kuv hloov lub tsheb luam yeeb lub teeb txawb lub xov tooj ntawm tes rau hauv ib txoj hauv kev los txhawb kuv lub tsheb
Tshem Tawm Lub Hwj Huam Standby Nrog Lub Hwj Huam Desktop Hloov!: 7 Cov Kauj Ruam (nrog Duab)
Tshem Tawm Lub Hwj Chim Standby Nrog Lub Hwj Huam Desktop Hloov!: Peb txhua tus paub tias nws tau tshwm sim. Txawm tias thaum koj cov cuab yeej siv (TV, khoos phis tawj, hais lus, sab nraud nyuaj tsav, saib, thiab lwm yam) tau tig " OFF, " lawv tseem ua tau tiag tiag, nyob rau hauv hom standby, nkim lub zog. Qee lub TV TV ntshav siv lub zog ntau dua hauv