Cov txheej txheem:

Spinning Dc Tsav Nrog Raspberry Pi: 6 Kauj Ruam
Spinning Dc Tsav Nrog Raspberry Pi: 6 Kauj Ruam

Video: Spinning Dc Tsav Nrog Raspberry Pi: 6 Kauj Ruam

Video: Spinning Dc Tsav Nrog Raspberry Pi: 6 Kauj Ruam
Video: HMONG TV: 5/7/2022 UN TAU TUAJ TOS COV PEJ XEEM HAU MARIUPOL TAWM LAWM 2024, Hlis ntuj nqeg
Anonim
Spinning Dc Tsav Nrog Raspberry Pi
Spinning Dc Tsav Nrog Raspberry Pi

Nyob zoo! Txais tos rau lub ntiaj teb vwm me ntsis ntawm kev xa tawm, lub cev muaj zog, hluav taws xob, thiab qhov zoo tshaj plaws ntawm … RASPBERRY PI!

Kuv paub qee tus ntawm koj cov neeg tsis paub dab tsi txog raspberry pi, tab sis qee tus ntawm koj tsis txawm paub tias nws muaj! Yog koj tsis paub tias nws yog dab tsi, nyem qhov no! Tam sim no koj txhua tus tau nrawm dua, QHOV TSEEB! (Yog tias koj saib kuv cov vis dis aus YouTube (@Computer Kid), cov lus no tau paub zoo heev rau koj!). Yog tias koj txaus siab rau cov khoom siv laser kos nco ntsoov mus ntsib kuv Facebook nplooj ntawv!

Khoom siv

1. Raspberry Pi (2b thiab tshiab dua kom tsis txhob qw ntawm pi vim tias qeeb npaum li cas cov qauv ua ntej yog;-)

2. Relay (Kuv siv SRD-05VDC-SL-C))

3. Tsav

4. Lub Hwj Chim Roj Teeb

5. Poj Niam Rau Poj Niam Jumper Wires

Kauj Ruam 1: Nqa Relay Mus Rau Raspberry Pi

Nqa Tus Txuas Txuas Mus Rau Raspberry Pi
Nqa Tus Txuas Txuas Mus Rau Raspberry Pi
Nqa Tus Txuas Txuas Mus Rau Raspberry Pi
Nqa Tus Txuas Txuas Mus Rau Raspberry Pi
Nqa Tus Txuas Txuas Mus Rau Raspberry Pi
Nqa Tus Txuas Txuas Mus Rau Raspberry Pi

+ mus rau 5V.

- mus rau GND.

S mus rau GPIO18

Kauj Ruam 2: Nqa Tus Tsav Tsheb mus rau Relay

Hook Up Motor mus rau Relay
Hook Up Motor mus rau Relay
Hook Up Motor mus rau Relay
Hook Up Motor mus rau Relay

Hook qhov tsis zoo ncaj qha mus rau lub cev muaj zog, zoo mus rau qhov nruab nrab ntawm kev xa xov, tom qab thaum kawg sab laug ntawm kev xa mus rau qhov zoo ntawm lub cav.

Kauj ruam 3: Code Nws

Code Nws !!
Code Nws !!

#los tsim hom ntawv no hauv lub davhlau ya nyob twg sudo nano relay.py

#kom khiav cov ntaub ntawv no khiav hauv lub davhlau ya nyob twg python3 relay.py ntshuam RPi. GPIO li GPIO los ntawm lub sijhawm ntshuam pw GPIO.setmode (GPIO. BCM) GPIO.setup (18, GPIO. OUT) thaum muaj tseeb: GPIO.output (18, Tseeb) pw tsaug zog (1) GPIO. tawm tswv yim (18, Tsis tseeb) pw tsaug zog (1)

Kauj ruam 4: Qhib Nws

Qhib Nws!
Qhib Nws!

Thawj zaug sudo reboot. Tom ntej no khiav python3 relay.py. lub cav yuav tig thiab tua!

Kauj ruam 5: Troubleshooting

Teeb meem
Teeb meem

Yog tias koj qhov RELAY/MOTOR tab tom ua haujlwm zoo hla qhov teeb meem no !

Qhov teeb meem tshwm sim 1: kev xa xov yog nyem tab sis lub cav tsis tig

Kho: txheeb xyuas koj cov xov hlau, yog tias qhov no tsis ua haujlwm xyuas seb qhov hluav taws xob koj lub cev tau ntsuas li cas thiab koj lub roj teeb ntau npaum li cas.

Qhov teeb meem tshwm sim 2: raspberry pi yuav tsis qhib.

Kho: qee qhov xov tooj yog tej zaum kov.

Tsis tshua muaj teeb meem: koj hnov tsw ntxhiab tsw ntxhiab thiab/lossis pom pa taws

Yuav ua dab tsi: ROV QAB LUB PATTERY PACK IMMEDIATLY !!!

Yog tias koj muaj teeb meem uas tsis tau teev nyob ntawm no, lossis kho tsis ua haujlwm tshaj tawm cov lus tawm!

Hmoov zoo!

Kauj Ruam 6: Vam tias Koj Zoo Siab

Vam tias koj txaus siab!
Vam tias koj txaus siab!

Vam tias koj nyiam! yog tias koj xav coj kev xa mus thiab cov motors nyob deb dua nco ntsoov txheeb xyuas kuv Tsab Ntawv Pom Zoo Nerf Phom!

Pom zoo: