Cov txheej txheem:

Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Lub Hwj Huam Fais Fab: 3 Kauj Ruam (nrog Duab)
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Lub Hwj Huam Fais Fab: 3 Kauj Ruam (nrog Duab)

Video: Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Lub Hwj Huam Fais Fab: 3 Kauj Ruam (nrog Duab)

Video: Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Lub Hwj Huam Fais Fab: 3 Kauj Ruam (nrog Duab)
Video: Spotpear Raspberry Pi Isolated CAN Expansion HAT Dual RS485 CAN Multi Onboard Protection Circuits 2024, Hlis ntuj nqeg
Anonim
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom
Raspberry Pi Isolated GPIO Board Nrog 12-24VDC rau 5VDC Fais Fab Khoom

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

Paub meej
Paub meej
Paub meej
Paub meej
Paub meej
Paub meej
Paub meej
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

Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, khawm
Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, khawm
Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, khawm
Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, khawm
Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, khawm
Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, khawm
Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, khawm
Ribbon Cable Kev Txuas Hluav Taws Xob thiab Txuas Hluav Taws Xob, xa tawm, 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: