Cov txheej txheem:

Raspberry Pi ATX PSU Hloov Tswj Cov Qauv: 3 Kauj Ruam
Raspberry Pi ATX PSU Hloov Tswj Cov Qauv: 3 Kauj Ruam

Video: Raspberry Pi ATX PSU Hloov Tswj Cov Qauv: 3 Kauj Ruam

Video: Raspberry Pi ATX PSU Hloov Tswj Cov Qauv: 3 Kauj Ruam
Video: How to power raspberry pi with ATX PSU 2024, Kaum ib hlis
Anonim
Raspberry Pi ATX PSU Hloov Tswj Cov Qauv
Raspberry Pi ATX PSU Hloov Tswj Cov Qauv

Hauv cov txheej txheem tsim los ntawm RaspberryPi siv los ntawm ATX lub zog siv hluav taws xob, lub hom phiaj ntawm qhov kev sib tw no yog tso cai rau qhib lub zog lossis tshem tawm cov kab ke nrog ib zaug nias lub pob.

Cov ntawv qhia no tau tsim los ntawm sitelec.org.

Kauj Ruam 1: Kev nthuav qhia muaj nuj nqi

Kev nthuav qhia muaj nuj nqi
Kev nthuav qhia muaj nuj nqi

Hauv qab no yog cov ncauj lus kom ntxaws txog kev ua haujlwm ntawm Circuit.

Thov xa mus rau daim duab schematic txuas thiab simulation daim duab:

X: 2s / div, Y: 0.5v / divATX_PS-ON (daj) (ntsuas) PWR_SW (reg) (simulation) RPI_GPIO (xiav) (ntsuas) RPI_UART0-TXD (ntsuab) (simulation)

Hwj chim rau

Lub voj voog no ua haujlwm ntawm ATX_PS-ON ATX PSU tus pin kom ua rau nws lub zog qhib lossis lub zog tua. Los ntawm lub neej ntawd, tus pin no tau teeb tsa rau 5V, uas txhais tau tias PSU raug tso tseg. Txhawm rau lub zog ntawm PSU, lub Circuit Court yuav tsum teeb ATX_PS-ON rau hauv av. Thaum lub laub khawm tau qhib, Q2 transistor teeb tsa ATX_PS-ON rau hauv av, uas ua rau PSU lub zog qhib thiab RaspberryPi pib.

Kev khiav haujlwm

Thaum pib, RaspberryPi teeb tsa nws RPI_UART0-TXD tus pin rau 3.3V, ua haujlwm ntawm Q1 transistor uas ua rau PSU ua haujlwm los ntawm kev ua ATX_PS-ON rau hauv av. Txawm li cas los xij, nws yuav siv qee lub sijhawm ua ntej RPI_UART0-TXD mus rau 3.3V (2.6 vib nas this ntawm RaspberryPi 3). RC sub-Circuit ntawm Q2 lub hauv paus tau tsim los tswj lub transistor kom txaus sijhawm txaus. C1 lub tshuab hluav taws xob nqus cov hluav taws xob hloov pauv ntawm RPI_UART0-TXD tus pin, uas muaj txiaj ntsig yog tias RaspberryPi UART raug siv vim nws ua rau lub zog ua haujlwm.

Kaw qhov system

Kev nias tshiab ntawm lub laub khawm tau pom los ntawm software ntawm RaspberryPi los ntawm kev nyeem cov ntawv nkag GPIO tus pin, lub kaw lus tuaj yeem ua tiav. Thaum RaspberryPi raug tso tseg, nws PCB tseem siv tau tab sis RPI_UART0-TXD tus pin mus rau hauv av, Q1 yog tom qab txiav tawm thiab PSU nres.

Kauj ruam 2: RaspberryPi Chaw

RPI_UART0-TXD tus pin teeb tsa rau 3.3V thaum khiav

Los ntawm tus neeg siv SSH, nkag mus rau koj li RaspberryPi.

Ua ntej, teeb tsa RaspberryPi kom teeb tsa RPI_UART0-TXD rau 3.3V thaum khiav, kom PSU ua haujlwm. Txhawm rau ua qhov no, kho /boot/config.txt thiab ntxiv qhov kawg:

enable_uart = 1

RaspberryPi nres tshwm sim los ntawm GPIO

Txhawm rau tso lub laub khawm kom ua rau RaspberryPi kaw, lub Circuit Court yuav tsum txuas nrog GPIO.

Rub cov ntawv txuas txuas rpi_shutdown.py.

Koj tuaj yeem kho nws kom hloov cov txiaj ntsig hauv qab no:

  • HOLD_TIME: lub sijhawm ua kom lub pob nyem txhawm rau ua kom kaw (tus nqi no tau hloov pauv los ntawm C2 uas ua rau qib nyob ib ntus tom qab lub pob raug tso tawm)
  • PIN_NB: Tus lej GPIO siv

Luam tsab ntawv mus rau/usr/local/bin thiab ua kom nws ua tiav:

sudo chmod +x /usr/local/bin/rpi_shutdown.py

Nruab nws qhov kev cia siab, zoo li gpiozero:

sudo apt-tau -y nruab python3-gpiozero python3-pkg-resources

Pab kom nws thaum pib qhov system:

sudo crontab -e

ntxiv cov hauv qab no hauv cov ntawv qhib:

@reboot /usr/local/bin/rpi_shutdown.py &

Tsab ntawv no tau sau raws li cov ntaub ntawv hauv qab no:

Kom rov pib dua koj li RaspberryPi:

sudo rov pib dua

Tam sim no koj tuaj yeem txuas lub Circuit Court mus rau RaspberryPi thiab rau PSU thiab sim cov hauv qab no:

  • PSU tau ua haujlwm zoo raws li xav tau los ntawm RPI_UART0-TXD RaspberryPi tus pin
  • nias lub pob ua rau RaspberryPi kaw, uas nres PSU

Kauj Ruam 3: Cov Kev Pab Ntxiv

Cov peev txheej ntsig txog tuaj yeem nrhiav tau los ntawm sitelec.org:

  • Kev qhia lus Askiv suav nrog qhov tshiab FreeCad project thiab simulation ib puag ncig
  • Fabkis txoj kev qhia suav nrog kev hloov kho FreeCad qhov project tshiab thiab simulation ib puag ncig
  • Fab Kis FreeCad kev sim ua pib qhia, raws li daim ntawv simulation sib cais

Pom zoo: