Cov txheej txheem:

Tab rau Tsiaj: 7 Kauj Ruam
Tab rau Tsiaj: 7 Kauj Ruam

Video: Tab rau Tsiaj: 7 Kauj Ruam

Video: Tab rau Tsiaj: 7 Kauj Ruam
Video: Yim laus yim do hau _phees lauj _fullmusic MV 2023 2024, Hlis ntuj nqeg
Anonim
Tab rau Tsiaj
Tab rau Tsiaj
Tab rau Tsiaj
Tab rau Tsiaj

Nyob zoo! Zoo siab txais tos rau qhov qhia paub ntawm Tab Rau Cov Tsiaj.

Tab Rau Tsiaj Tsiaj lub hom phiaj rau:

- Khaws koj tus tsiaj tsis khoom thaum koj tsis nyob;

- Ua kom koj tus tsiaj nkag siab ua tsaug rau kev ua si nyuaj;

- Muab cov vis dis aus lom zem ntawm koj tus tsiaj ua si ua si.

Cov khoom kawg yog 1 ntsiav tshuaj + 1 lub tshuab xa khoom. Ntawm lub ntsiav tshuaj daim ntawv thov tau khiav, thiab thaum koj tus tsiaj yeej qhov kev ua si HTTP POST thov raug xa mus rau lub chaw xa khoom. Qhov kev thov no qhib lub servomotor kom cov zaub mov tuaj yeem poob rau tus neeg muab khoom noj. Ib qho ntxiv, tus neeg tua tsiaj ultrasonic yuav nkag siab thaum koj tus tsiaj nyob ze ntawm lub ntsiav tshuaj thiab nws yuav qhib lub koob yees duab, yog li koj tuaj yeem muaj vis dis aus ntawm koj tus tsiaj ua si hauv lub ntsiav tshuaj. Cov duab ntawm architecture piav qhia nws ua haujlwm li cas.

Peb tsis tau sim nws vim tias peb tsis muaj tsiaj, thiab muaj tseeb qee yam los hloov kho kom muaj txiaj ntsig. Yog li tsis txhob ntshai thiab hloov kho/txhim kho nws.:)

Cov Nqi Khoom:

- Raspberry Pi 3 B+

- Ultrasonic Ranging Module HC-SR04

- DF Neeg Hlau Micro Servo 9g DF9GMS

Raspberry Pi NoIR Lub Koob Yees Duab V2

- Ntsuab LED

-330 Ohms Resistor

- 3D Tshuab Luam Ntawv

- Ntsiav Tshuaj (Los yog lub xov tooj) (Peb siv lub xov tooj smartphone rau peb tus qauv, tab sis peb pom zoo kom siv lub ntsiav tshuaj tsim los rau tsiaj vim tias cov cuab yeej siv tshuaj ntsuam tsis siv rau tsiaj).

Software:

- Kev sib haum xeeb

LUS QHIA:

Koj xav tau tus as khauj ntawm Cloudinary, txij li cov yeeb yaj kiab tau ncaj qha rub tawm ntawm lub platform

Kauj Ruam 1: Teeb RPi

Ua ntej, peb yuav tsum thauj tus nab npawb nab npawb code hauv RPi. Txhawm rau ua qhov ntawd, peb pom zoo siv lub vijtsam, nas thiab keyboard, thiab tau kawg yog lub txuas HDMI txuas RPi rau lub vijtsam. Koj yuav tsum muaj internet txuas ib yam nkaus.

Tom qab khau raj, Nkag mus rau:

/tsev/

thiab tsim daim nplaub tshev:

mkdir TabForPets || cd TabForPets

Ntawm no, koj ntxiv cov ntaub ntawv nab nab: serveurMotorCamControl.py

Tom qab ntawd koj yuav tsum teeb tsa txhua pob khoom xav tau.

pip nruab Flask

pip nruab cloudinary sudo apt-tau nruab -y gpac sudo apt-tau nruab xterm

Tam sim no, koj yuav tsum ntxiv cov ntawv teeb tsa, yog li tsim cov ntawv config.ini, thiab sau cov hauv qab no:

['DEFAULT']

CLOUD_NAME = your-cloudinary-name API_KEY = your-api-key API_SECRET = koj-api-secret

Hloov dab tsi tom qab "=" nrog koj lub npe huab, qhov tseem ceeb, thiab zais cia.

Kauj ruam 2: Teeb Wifi

Peb pom zoo siv kev mob siab rau wifi channel. Ua li no, ntawm Raspberry Pi, sau:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Ntxiv cov kab hauv qab no hauv nws:

network = {

ssid = "Tab4Pets" psk = "password" key_mgmt = WPA-PSK}

Koj tuaj yeem hloov kho qhov ntsuas raws li koj xav tau: Ntxiv lwm lub network, …

Kauj Ruam 3: Teeb Lub Koob Yees Duab, Sensor, Servomotor

Teeb lub koob yees duab, Sensor, Servomotor
Teeb lub koob yees duab, Sensor, Servomotor

Saib cov phiaj xwm rau kev sib txuas.

Lub Koob Yees Duab:

Koj yuav tsum tau pab kom lub koob yees duab interface. Txhawm rau ua qhov no, ntaus:

sudo raspi-teeb tsa

Mus rau Interfacing Options, tom qab ntawd Lub Koob Yees Duab, xaiv Yog, thiab xaiv Yog kom rov pib dua.

Los ntsuas seb lub koob yees duab puas pab tau:

vcgencmd get_camera

Koj yuav tsum muaj kab txhawb nqa = 1 kuaj pom = 1, yog tias tsis sim hloov tshiab:

sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab

Kauj ruam 4: Teeb Khiav ntawm Startup

Koj yuav tsum ntxiv cov ntaub ntawv lxterm-autostart.desktop uas peb muab, hauv /home/pi/.config/autostart directory

Cov ntaub ntawv no muaj:

[Desktop nkag] Nkag = UTF -8 Lub Npe = Terminal autostart Tawm tswv yim = pib lub davhlau ya nyob twg Exec = qhov chaw/tsev/pi/TabForPets/env/bin/qhib qhib Exec =/usr/bin/lxterm -hold -e "pw 10; FLASK_APP =/home/pi/TabForPets/serveurMotorCamControl.py flask khiav --host = 0.0.0.0"

Kauj ruam 5: Luam lub Dispenser

Luam lub Dispenser
Luam lub Dispenser
Luam lub Dispenser
Luam lub Dispenser
Luam lub Dispenser
Luam lub Dispenser

Tau txais cov ntaub ntawv stl hauv cov ntawv txuas, thiab siv nws los luam cov dispenser thiab lwm qhov ua tsaug rau koj lub tshuab luam ntawv 3D.

Koj yuav tsum muaj: 1 lub tshuab xa khoom, 1 lub ntsia hlau, 2 lub tog raj kheej kheej kheej (ib qho rau lub cev muaj zog thiab ib qho rau cov ntsia hlau), thiab 3 cov khoom sib dhos.

Kauj Ruam 6: Loading Daim Ntawv Thov hauv Tablet

Cias txuas koj lub ntsiav tshuaj lossis smartphone rau koj lub PC, thiab thauj cov ntaub ntawv iot.apk uas peb muab.

Tom qab ntawd, ntawm koj lub ntsiav tshuaj lossis smartphone, nruab apk.

Kauj Ruam 7: Siv TabForPets

Fais fab RPI thiab tos kom Ntsuab LED ci.

TabForPets tau npaj txhij siv.

Pom zoo: