Cov txheej txheem:
- Kauj Ruam 1: Sau Cov Khoom
- Kauj Ruam 2: Txuas lub PIR Motion Sensor
- Kauj Ruam 3: Txuas cov LEDs thiab Cov Tiv Thaiv
- Kauj Ruam 4: Txuas PiCamera
- Kauj Ruam 5: Teeb Tus Hais Lus
- Kauj Ruam 6: Coding Txoj Haujlwm
- Kauj Ruam 7: Kuaj Kawg
Video: SanityForce (Tswb System- Rpi): 7 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Tam sim no muaj ntau txoj hauv kev kom koj cov khoom muaj kev nyab xeeb, lossis tsuas yog khaws koj cov nus muag tawm ntawm koj chav, xws li muab xauv rau nws lossis tsuas yog ua kom lwm tus neeg mus txog. Yuav ua li cas yog tias kuv hais rau koj tias koj tsis tas yuav ua txhua yam yooj yim tab sis tuaj yeem tig koj li Raspberry Pi rau hauv koj lub tswb ceeb toom tus kheej! Tam sim no koj yuav xav tias qhov no ua tsis tau lossis tsuas yog qhov tsis tseem ceeb, koj tuaj yeem cia li kaw lub qhov rooj ntawm koj lub qhov rooj kom koj tus tij laug tawm. Tab sis, koj tus tij laug tuaj yeem pom tus yuam sij rau lub xauv thiab tsuas yog nkag mus rau hauv koj chav, tab sis nrog lub tswb nrov no, thaum koj qhib nws, nws tsis tuaj yeem xiam kom txog thaum koj mus thiab tua nws ntawm txoj cai. Yog tias koj tus nus txawm tuaj txog ib lub 'meter' ze ntawm koj lub qhov rooj, lub tswb yuav tawm mus qhia rau txhua tus hauv koj lub tsev tias ib tus neeg tau sim ua phem rau koj tus kheej. Tom qab ntawd thaum ib tus neeg paub nws sim ua phem rau koj tus kheej, lawv yuav tuaj thiab nres nws. Txhawm rau hloov koj tus Pi rau hauv lub tswb ceeb toom hu ua SanityForce, koj yuav tsum tau ua raws ob peb kauj ruam yooj yim thiab yuav xav tau qee qhov ntxiv rau koj Pi. Txhua kauj ruam thiab cov ntaub ntawv koj yuav xav tau muaj npe hauv qab no. Hmoov zoo, thiab Thov kom SanityForce nyob nrog koj!
Kauj Ruam 1: Sau Cov Khoom
Tam sim no rau txoj haujlwm no koj yuav xav tau ob peb daim ntxiv rau koj Raspberry Pi. Ua ntej pib tsim txoj haujlwm, thov xyuas kom koj muaj tag nrho cov ntaub ntawv uas tau teev tseg hauv qab no.
- 1 x Raspberry Pi
- 1 x Breadboard
- 1x Pair Tus Hais Lus
- 1 x PiCamera
- 10x Liab LEDs
- 1 x PIR Motion Sensor
- 3x Poj niam-Txiv neej Xov
- 10 x 330 Resistors
- 10x ntawm Blue Jumper Cables
- 2x ntawm Dub Jumper Cables
Kauj Ruam 2: Txuas lub PIR Motion Sensor
Ua ntej txuas tag nrho lwm cov LEDs thiab cov hais lus, koj xav txuas lub suab sensor uas yog pob txha nraub qaum ntawm koj txoj haujlwm. Txog kev txuas lub suab ntsuas, koj yuav tsum tau ceev faj txuas tus poj niam-txiv neej xaim mus rau GPIO pins thiab GND pins. Kuv yuav siv daim duab saum toj no ua piv txwv qhia tias lub xov tooj yuav mus qhov twg. Hauv qhov piv txwv muaj 3 lub xov hlau txuas nrog lub ntsuas hluav taws xob, ib qho ntsuab, ib qho ntshav, thiab ib qho xiav, nyob rau qhov kev txiav txim los ntawm sab xis mus rau sab laug. Cov hlau ntsuab yuav txuas rau GND tus pin hauv koj lub rooj noj mov, raws li koj tuaj yeem pom hauv qhov piv txwv saum toj no. Cov xaim hluav taws xob yuav txuas rau 5 volts fais fab fais fab tus pin hauv lub rooj noj mov, koj tuaj yeem pom qhov no hauv daim duab saum toj no. Qhov xov tooj thib peb thiab zaum kawg, ib qho xiav nkag mus rau GPIO tus pin ntawm koj lub rooj noj mov, uas GPIO tus pin nws mus yog qhov koj xaiv.
Kauj Ruam 3: Txuas cov LEDs thiab Cov Tiv Thaiv
Yog li ntawm cov LEDs thiab cov tiv thaiv, txuas cov no yog qhov yooj yim heev, tsuas yog nco ntsoov tias cov ceg ntev (anode) ntawm LED txuas nrog lub jumper cable uas txuas nrog GPIO tus pin. Cov ceg luv (cathode) ntawm LED txuas nrog 330 resistor uas txuas nrog GND tus pin. Ua ntej teeb tsa LEDs ntawm lub rooj tsavxwm, sib txuas ob lub xov tooj cua dub uas yuav txuas los ntawm tus lej GND mus rau GND kev tsheb nqaj hlau ntawm lub rooj tsavxwm. Koj tuaj yeem nthuav tawm LEDs nyob txhua qhov chaw ntawm lub rooj noj mov, hauv txhua qhov qauv koj nyiam. Nco ntsoov ua raws li yam kuv tau hais los saum no thiab koj cov LEDs yuav tsum pom thaum peb tso cov cai hauv thiab sim lawv. Tsis tas li, GPIO tus pin koj txuas cov LEDs tsis muaj teeb meem, uas tuaj yeem yog qhov koj xaiv.
Kauj Ruam 4: Txuas PiCamera
Tam sim no txuas rau PiCamera yog txoj haujlwm yooj yim, tab sis ceev faj thaum txuas nws uas koj tsis ua rau lub koob ntawm lub koob yees duab puas tsuaj hauv cov txheej txheem cog rau hauv Pi. Muaj koj yuav qhib lub qhov dub dub ntawm lub bar, thiab tsuas yog ntxig rau Pi lub koob yees duab rau hauv, nco ntsoov thawb lub bar rov qab thaum lub koob yees duab nyob hauv qhov chaw. Tom qab ua qhov ntawd koj xav nias lub Raspberry Pi khawm rau hauv qab kab ntawm Pi interface, cov ntawv qhia zaub mov yuav tshwm sim. Tom qab ntawd koj yuav nyem rau "Nyiam", thiab nqis mus rau "Raspberry Pi Configuration", thaum koj tau nyem rau ntawm qhov ntawd koj yuav tau txais cov ntawv qhia zaub mov nyob rau ntawm koj lub vijtsam. Muaj koj yuav nyem rau ntawm "Interfaces", muaj nyem rau ntawm lub pob kom pab tau rau lub koob yees duab xaiv. Yog tias lub koob yees duab twb tau qhib lawm, xiam nws thiab tom qab ntawd qhib nws. Thaum koj tau qhib lub koob yees duab, rov pib dua koj Pi thiab koj lub koob yees duab yuav pib ua haujlwm thaum Pi tau rov pib dua.
Kauj Ruam 5: Teeb Tus Hais Lus
Tam sim no rau Pi koj tuaj yeem siv ib tus neeg hais lus uas koj nyiam, tab sis kuv xav kom koj siv cov neeg hais lus uas muaj lub mloog pob ntseg qhov hluav taws xob uas koj tuaj yeem txuas rau Pi lub mloog pob ntseg. Tam sim no teeb tsa cov neeg hais lus yog qhov yooj yim tshaj plaws ntawm kev tsim txoj haujlwm no, txhua yam koj yuav tsum tau ua yog ntsaws lub mloog pob ntseg lub mloog pob ntseg tso rau hauv Pi lub mloog pob ntseg. Tom qab ntawd koj yuav txuas tus hais lus USB A cable rau hauv Pi's USB A chaw. Koj tsuas yog qhib koj tus neeg hais lus thiab koj yuav tsum tau nce thiab khiav. Tsuas yog thaum koj tus neeg hais lus tsis ua haujlwm tom qab ntsaws lawv, sim coj lawv tawm thiab tso lawv rov qab los, lossis tig koj Pi tawm thiab rov ua dua!
Kauj Ruam 6: Coding Txoj Haujlwm
Yog li tam sim no tom qab koj tau sib sau ua ke txhua yam ntawm koj Pi, koj tau npaj rau code hauv Python, yog li nws yuav ua haujlwm tiag tiag. Hauv qab no yog cov cai uas yuav ua kom txhua yam ua haujlwm, koj tsuas yog siv qhov ntawd, tab sis nco ntsoov hloov pauv txhua tus lej GPIO tus lej rau tus lej tus lej tshwj xeeb rau koj lub rooj noj mov. Koj tseem yuav tau hloov lub npe nkauj lub npe uas kuv tau teeb tsa hauv txoj cai, hloov lub npe mus rau lub npe ntawm daim nplaub tshev twg los xij hauv koj lub khoos phis tawj. Hauv qab yog daim duab ntawm yuav ua li cas koj cov cai yuav tsum saib ntawm Python, tsuas yog rub tawm cov ntawv thiab saib.
los ntawm gpiozero ntshuam MotionSensor los ntawm gpiozero ntshuam LED
los ntawm lub sijhawm ntshuam pw
los ntawm picamera ntshuam PiCamera
ntshuam pygame
lub koob yees duab = PiCamera ()
pir = MotionSensor (4)
tswb 1 = LED (21)
tswb 2 = LED (24)
tswb 3 = LED (20)
tswb 4 = LED (19)
tswb 5 = LED (16)
tswb 6 = LED (5)
tswb 7 = LED (12)
tswb 8 = LED (13)
tswb 9 = LED (25)
tswb 10 = LED (22)
def so (): cov
pygame.init ()
pygame.mixer.music.load ("LA LA LA.mp3")
pygame.mixer.music.play (-1)
thaum Muaj Tseeb:
pir.wait_for_motion ()
yog pir.motion_detected:
camera.start_preview ()
tsaug zog (0.1)
camera.capture ('/tsev/pi/Desktop/capture.jpg')
camera.stop_preview ()
so ()
print ("INTRUDER ALERT !!!!")
tswb 1.on ()
tswb 2.on ()
tsaug zog (0.4)
tswb 1.off ()
tswb2.off ()
tswb 3.on ()
tswb4.on ()
tsaug zog (0.5)
tswb3.off ()
tswb4.off ()
tswb5.on ()
tswb 6.on ()
tsaug zog (0.4)
tswb 5. tawm ()
tswb6.off ()
tswb 7.on ()
tswb8.on ()
tsaug zog (0.4)
tswb7.off ()
tswb8.off ()
tswb 9.on ()
tswb 10.on ()
tsaug zog (0.4)
tswb9.off ()
tswb10.off ()
tswb 10.on ()
tswb 9.on ()
tsaug zog (0.4)
tswb10.off ()
tswb9.off ()
tswb8.on ()
tswb 7.on ()
tsaug zog (0.4)
tswb8.off ()
tswb7.off ()
tswb 6.on ()
tswb5.on ()
tsaug zog (0.4)
tswb6.off ()
tswb 5. tawm ()
tswb4.on ()
tswb 3.on ()
tsaug zog (0.4)
tswb4.off ()
tswb3.off ()
tswb 2.on ()
tswb 1.on ()
tsaug zog (0.4)
tswb2.off ()
tswb 1.off ()
lwm tus:
tswb 1.off ()
tswb2.off ()
tswb3.off ()
tswb4.off ()
tswb 5. tawm ()
tswb6.off ()
tswb7.off ()
tswb8.off ()
tswb9.off ()
tswb10.off ()
Kauj Ruam 7: Kuaj Kawg
Tam sim no koj tau tso koj cov cai rau hauv nab hab sej, nws yog lub sijhawm los muab txhua yam ua ke thiab saib yog tias koj txoj haujlwm tau ua tiav! Hauv qab no yog cov vis dis aus ntawm yuav ua li cas koj txoj haujlwm yuav tsum ua haujlwm, tsis quav ntsej qee tus neeg tham tom qab, Kuv tsis nyob hauv qhov chaw ntsiag to! Cia siab tias koj kev rau siab ua SanityForce: Lub Tswb Tswb tau ua tiav, thiab tam sim no koj muaj qee yam txias uas yuav pab koj kom koj cov nus muag tawm ntawm koj chav.
Ua tsaug rau koj ua raws cov lus qhia no, thiab kuv vam tias koj tau kawm ib lossis ob yam! Tsis txhob hnov qab tawm koj cov kev xav hauv cov lus hauv qab no! Muaj kev lom zem nrog koj SanityForce!
Pom zoo:
Tswb Tswb Tswb Tswb Los Ntawm Dej Sawv Cev: 7 Kauj Ruam (nrog Duab)
Twin Bell Alarm Clock From Soda Cans: Phau ntawv qhia no qhia koj yuav ua li cas thiaj ua tau lub tswb nrov tswb tswb moos los ntawm cov kaus poom dej qab.Qhov haujlwm no siv cov kaus poom dej qab zib uas tshem tus number case tawm (Txuas: Tshem Tawm Dej Los ntawm Dej Sawv Daws). Txhawm rau ua lub tswb moos no ua haujlwm tau zoo DIY Quartz moos module tau sib koom ua ke
Tswb Tswb Tswb Tswb Tswb: 3 Kauj Ruam
Lub Tswb Tswb Tswb Tswb: Kuv yog menyuam kawm ntawv 13 xyoos hauv Taiwan.Kuv ua yam nrog Arduino thawj zaug yog tias koj tuaj yeem qhia kuv yuav ua li cas txhim kho txoj haujlwm no, thov tawm lus rau kuv kom kuv tuaj yeem ua qhov zoo dua. (Ua tsaug ) Lub moos no tuaj yeem tsa koj thaum koj tsaug zog, tab sis kuv
Tswb Tswb Tswb Tswb Tswb Ntse Teeb: 8 Kauj Ruam (nrog Duab)
Tswb Tswb Tswb Tswb Tswb Lub Teeb: Hauv qhov haujlwm no kuv tau siv lub tshuab cua-tsoo lub tswb tawg tag. Lub ntsej muag ntawm lub moos tau hloov pauv los ntawm 12 LEDs, teeb pom kev los ntawm LED kab ib ncig ntawm ntug ntawm lub moos. 12 LEDs qhia lub sijhawm thiab cov hlua LED tau teeb tsa los ua lub tswb, tig
Arduino Push Alerts rau Lub Tswb, Tswb Tswb, Tswb Tswb Tswb Thiab Lwm Yam: 8 Kauj Ruam
Arduino Push Alerts rau Tswb, Tswb Tswb, Tswb Tswb Tswb thiab lwm yam: IoT Cov Ntawv Ceeb Toom los ntawm koj lub Tswb, Tswb Tswb, Tswb Tswb thiab lwm yam siv Arduino Uno thiab Ethernet Shield. Cov ncauj lus kom ntxaws ntawm kuv lub vev xaib ntawm no Hais txog Arduino Push Alert Box Siv Arduino Uno thiab Ethernet Shield raws li Wiznet W5100 nti rau
LED Tswb Tswb Tswb Tswb Tswb Tswb Tsa Tswm Tsa: 7 Kauj Ruam (nrog Duab)
LED Tswb Tswb Tswb Tswb Tswb Tswb Tsa Tswm Tsa Tswm Tswm: Tsa Kuv Lub Caij Ntuj No Lub caij ntuj no kuv tus hluas nkauj muaj teeb meem sawv thaum sawv ntxov thiab zoo li raug kev txom nyem los ntawm SAD (Lub Caij Caij Nyoog Muaj Teeb Meem). Kuv txawm pom tias nyuaj npaum li cas kom sawv thaum lub caij ntuj no vim lub hnub tsis tuaj