Cov txheej txheem:

Cat-a-way-Computer Vision Cat Sprinkler: 6 Cov Kauj Ruam (nrog Duab)
Cat-a-way-Computer Vision Cat Sprinkler: 6 Cov Kauj Ruam (nrog Duab)

Video: Cat-a-way-Computer Vision Cat Sprinkler: 6 Cov Kauj Ruam (nrog Duab)

Video: Cat-a-way-Computer Vision Cat Sprinkler: 6 Cov Kauj Ruam (nrog Duab)
Video: 3000+ Common English Words with Pronunciation 2024, Hlis ntuj nqeg
Anonim
Cat-a-way-Khoos phis tawj Lub Zeem Muag Cat Sprinkler
Cat-a-way-Khoos phis tawj Lub Zeem Muag Cat Sprinkler

Teeb meem - Miv siv koj lub vaj ua chav dej

Kev daws teeb meem - Siv sijhawm ntau dhau ntawm kev tsim cov tshuab txau miv nrog pib youtube upload yam ntxwv

Qhov no tsis yog ib kauj ruam zuj zus, tab sis qhia txog kev tsim kho thiab qee qhov chaws

#BeforeYouCallPETA - Cov miv zoo, nws yog lub tshuab tso dej tsis tshua zoo ib yam li los nag, kom lawv tuaj yeem nrawm dua ua ntej nws txawm piv rau lawv. Txoj haujlwm no tsis yog kom tsau tus miv, tab sis kom qhia lawv tawm ua ntej lawv pov kuv lub vaj nrog cov miv version ntawm Barkers Eggs.

Kauj Ruam 1: Cov Khoom Tseem Ceeb Yuav Tsum Tau

Cov Khoom Tseem Ceeb Yuav Tsum Tau
Cov Khoom Tseem Ceeb Yuav Tsum Tau

Raspberry Pi xoom & SD daim npav

Raspberry Pi lub koob yees duab

Relay

555 lub sijhawm…. (lossis arduino thiab lwm qhov xa tawm yog tias koj 555 lub sijhawm tsis tuaj txog)

Solenoid

Sprinkler

Qee lub tsev nyob rau cov khoom siv hluav taws xob

Kev txaus siab los ntaus tus ntsia thawv ua piv txwv nrog rau 6 tonne sledge rauj

Lub koob yees duab nrog qhov kev daws teeb meem me me koj tsis tuaj yeem pom dej, tab sis tseem tuaj yeem pom cov miv khiav rau npog

Kauj ruam 2: Qhov System

Image
Image

1, Pi lub koob yees duab pom lub miv qhov khoom txav mus rau ob peb lub koob yees duab thav duab (piav qhia nyob rau theem tom ntej)

2, Pi teeb tawm lub taub dej

3, Miv khiav rau npog

4, Cov vis dis aus tau tso rau hauv youtube kom pom kev lom zem

Kauj Ruam 3: Coding Sijhawm

Muab tso ua ke
Muab tso ua ke

Siv openCV siv cov lej rho tawm koj tuaj yeem pom thaj tsam ntawm tus ncej uas hloov pauv lub sijhawm, siv qee qhov kev ua haujlwm tsis zoo koj tuaj yeem txiav txim siab qhov kev hloov pauv loj npaum li cas thiab yog tias lawv ua rau lub sijhawm dhau mus, thiab tseem ceeb tshaj plaws yog tias lawv yog miv loj.

Muaj qee qhov kev qhia ntau ntawm cov lej rho tawm uas mus rau hauv cov ncauj lus zoo yog tias koj ua google tshawb nrawm.

Txheej txheem cej luam ntawm txoj cai ua haujlwm li cas

1, Lub koob yees duab khaws cov ntas thiab muab piv rau qhov kawg

2, Yog tias pom tus miv zoo li tus duab nws tau sau tseg

3, Yog tias tus miv qhov kev hloov pauv hloov pauv nyob ib puag ncig 4 thav duab pi siv nws GPIO los hloov lub zog pib arduino

4, Arduino xa lub teeb liab mus rau lub zog thib ob txuas rau 5 vib nas this uas qhib lub solenoid

5, Lub solenoid thaum siv hluav taws xob tso cai rau cov dej mus rau lub kais dej

6, Thaum lub kais tsuag dej ua haujlwm lub koob yees duab nres pom thiab kaw cov vis dis aus

7, Cov vis dis aus tau tso rau hauv Youtube

8, Cov kab ntawv rub tawm rau hauv lub thawv rau kev kho kom raug

Nco tseg - Vim li cas kuv thiaj li siv 2 qhov txuas thiab cov arduino tig rau solenoid li 5 vib nas this…..

1, Tus pi tsis tuaj yeem pib thiab nres lub solenoid thaum kaw cov vis dis aus raws li nab nab tso tawm ib ntus kom txog thaum cov vis dis aus tiav, yog li xav tau arduino (lossis 555 timer) tso cai rau solenoid qhib thiab kaw qhov ywj pheej rau tsab ntawv thaum video tseem kaw.

2, Thawj qhov xa tawm thiab arduino tuaj yeem hloov pauv nrog 555 lub sijhawm tab sis qhov ntawd tsis tuaj txog hauv lub sijhawm rau qhov haujlwm no, 555 yuav txuag sijhawm thiab nyiaj ntau.

3, Tus pi tsis tuaj yeem ua rau solenoid ncaj qha raws li Pi GPIO ua haujlwm ntawm 3.3v thiab 51mA max, thiab solenoid xav tau 5V thiab ntau dua 51mA los ua kom pom.

4, Txhua lub thav duab tuaj yeem raug txiav kom tshem tawm cov lus pom hauv thaj chaw tsis xav tau, xws li lub vaj neigbors. Ua tsis tiav qhov no yuav ua rau tus neeg nyob ze hais lus tsis zoo saib rau hauv koj lub vaj vim tias lub tshuab tso dej tawm mus txhua lub sijhawm nws xav nkag mus rau hauv nws lub tsev.

5, Kuv tej zaum tsis pom qee yam pom tseeb thiab nkim kuv lub sijhawm teeb tsa nws zoo li no.

Code hauv qab no

ntshuam cv2import numpy li np ntshuam argparse #cat lub sijhawm ntshuam RPi. GPIO li GPIO ntshuam os ntshuam poob ntawm picamera.array ntshuam PiRGBArray los ntawm picamera ntshuam PiCamera #------------------ ------------------------------ Upload rau youtube ----------------- ---------------------- def HDtoYoutube (): ctime = time.strftime ("_%H-%M-%S") cdate = sijhawm.strftime ("_%d-%m-%Y") vidname = ctime + cdate #Trigger relay GPIO.output (11, True) time.sleep (.5) GPIO.output (11, False) print ("Noj Video") sim: #Take Video os.system ('raspivid -w 1640 -h 922 -o vid {0}.h264 -t 15000'.format (vidname)) #Upload to youtube print ("Uploading to YouTube") os. system ('sudo youtube-upload -title = "Cat Got Wet {0}" --client-secrets = client_secret.json vid {0}.h264'.format (vidname)) #Remove video file thaum ua os.remove ('vid {0}.h264'.format (vidname)) print ("Video uploaded and removed from Pi") except: pass #-------------------- ------------------------------ Tseem tshuav qhov nco ---------------------- ---------------------- def St. illsToDropbox (): print ("Uploading Still To Dropbox Function") access_token = 'Ah ah ah, koj tsis tau hais lo lus khawv koob … Ah ah ah, koj tsis tau hais lo lus khawv koob' ctime = time.strftime (" %H:%M:%S ") cdate = time.strftime ("%d-%m-%Y ") sim: filename =" /Motion/{0}/DetectedAt_{1}.jpg".format(cdate, ctime) print (filename) client = dropbox.client. DropboxClient (access_token) duab = qhib ("ToDropbox.jpg", 'rb') client.put_file (filename, duab) image.close () os.remove ("ToDropbox-j.webp

#HowToTriggerRealProgrammersWithBadCode

Kauj Ruam 4: Muab Nws Ua Ke

Muab tso ua ke
Muab tso ua ke
Muab tso ua ke
Muab tso ua ke
Muab tso ua ke
Muab tso ua ke

Cram cov hluav taws xob mus rau hauv lub tsev tsis muaj dej, ntswj yam khoom rau hauv phab ntsa thiab siv ntau daim kab xev thiab cov kua nplaum kub

Kauj Ruam 5: Cov txiaj ntsig

Image
Image
Cov txiaj ntsig
Cov txiaj ntsig

Thaum nws ua haujlwm nws ua haujlwm

Kauj Ruam 6: Qhov Tsis Zoo

Cuav Tsis Zoo
Cuav Tsis Zoo

Thaum nws tsis nws txau cov duab ntxoov ntxoo miv, koj tus poj niam thiab koj tus ntxhais.

Pro -tip - Muab qhov hloov pauv los ntawm lub qhov rooj uas ua rau qhov ntsuas pom qhov kev pab cuam….. tom qab ntawd tsis nco qab siv nws thiab tau ntub thaum tso lub thoob.

Vam tias kuv tau ua ib tus kws tshaj lij hauv kev ua haujlwm, khoom siv hluav taws xob thiab DIY cringe nrog txhua qhov yuam kev kuv tej zaum tau ua, thiab tshwj xeeb yog vam tias koj nyiam txhua qhov kuv ua yuam kev.

Pom zoo: