Cov txheej txheem:

Ntse Tswb Tswb: Ntse Tswb Tswb Ua Nrog Raspberry Pi: 10 Kauj Ruam (nrog Duab)
Ntse Tswb Tswb: Ntse Tswb Tswb Ua Nrog Raspberry Pi: 10 Kauj Ruam (nrog Duab)

Video: Ntse Tswb Tswb: Ntse Tswb Tswb Ua Nrog Raspberry Pi: 10 Kauj Ruam (nrog Duab)

Video: Ntse Tswb Tswb: Ntse Tswb Tswb Ua Nrog Raspberry Pi: 10 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Ntse Tswb Tswb: Ntse Tswb Tswb Ua Nrog Raspberry Pi
Ntse Tswb Tswb: Ntse Tswb Tswb Ua Nrog Raspberry Pi

Koj puas tau xav tau lub moos ntse? Yog tias yog, qhov no yog kev daws teeb meem rau koj!

Kuv tau ua Smart Alarm Clock, qhov no yog lub moos uas koj tuaj yeem hloov lub tswb ceeb toom raws li lub vev xaib. Thaum lub tswb nrov tawm, yuav muaj lub suab (buzzer) thiab 2 lub teeb yuav teeb (2 LEDs). Cov LEDs yuav tsuas pom thaum tsaus ntuj (lub teeb pom kev zoo). Cov LEDs ua kom ntseeg tau tias chav nyob tau ci ntsa iab kom koj tuaj yeem sawv ntsug ib txwm. Txhawm rau ua kom lub tswb nrov, nyem lub pob. Thaum koj xav siv qhov kev ua haujlwm snooze (+5min), koj yuav tsum tuav koj txhais tes ua ntej ntawm lub ntsuas ultrasonic. Yog tias pom cov lus tsa suab (ultrasonic sensor), cov xwm txheej ntawm LCD yuav hloov.

Cov xwm txheej ntawm LCD:

  1. IP-chaw nyob ntawm lub vev xaib
  2. Moos / hnub tim
  3. Lub sijhawm ceeb toom tom ntej
  4. Kub thiab av noo

Nov yog kuv thawj qhov haujlwm hauv kuv qhov kev kawm: Multimedia thiab kev sib txuas lus thev naus laus zis (MCT) ntawm Howest (Kortrijk belgium).

Kauj Ruam 1: Cov Khoom Siv thiab Cov Khoom

Cheebtsam thiab Khoom
Cheebtsam thiab Khoom
Cheebtsam thiab Khoom
Cheebtsam thiab Khoom
Cheebtsam thiab Khoom
Cheebtsam thiab Khoom

Txog kuv qhov haujlwm kuv siv ntau qhov uas kuv yuav teev hauv qab no, Kuv tseem yuav ntxiv cov ntawv ua tau zoo nrog txhua tus nqi sib xws ntawm cov khoom ib yam li cov vev xaib uas kuv tau xaj lawv.

Cheebtsam

  • Raspberry Pi 3 qauv B+
  • Raspberry Pi fais fab mov
  • Lcd zaub
  • Buzzer
  • LDR
  • 2 Ledas
  • TSH-11
  • HC-SR04 Ultrasonic nrug deb sensor
  • Khawm
  • Trimmer

Cov ntaub ntawv:

  • Ntoo 7 hli
  • Ntoo 2cm
  • Cling zaj duab xis

Cov Cuab Yeej:

  • Soldering
  • Super kua nplaum
  • Pom
  • Ntsia Hlau
  • Laum

Hauv daim ntawv PDF hauv qab no koj tuaj yeem pom daim ntawv teev nqi tiav.

Kauj Ruam 2: Muab Hardware Ua Ke

Muab Hardware Ua Ke
Muab Hardware Ua Ke
Muab Hardware Ua Ke
Muab Hardware Ua Ke

Kuv tau tsim kuv qhov Circuit los ntawm kev ua raws kuv cov phiaj xwm Fritzing uas kuv tau ua, kuv tau tshaj tawm cov phiaj xwm hauv qab no. Lub Circuit Court muaj ntau lub ntsuas cua thiab tus actuator uas ua haujlwm ua ke ua ib qho. Kuv yuav teev cov kab hluav taws xob sib txawv twg, koj yuav xav tau txuas li cas koj tuaj yeem pom hauv cov phiaj xwm.

  1. Muaj lub ntsuas hluav taws xob nrug deb deb uas pom qhov txav ntawm qhov deb ntawm 15 cm (tus lej cim tus kheej nrug) thiab nws hloov qhov xwm txheej ntawm lcd tab sis yog tias lub tswb tau qhib, nws tswb lub tswb rau 5 min.
  2. Muaj lub vijtsam LCD uas qhia txog 4 yam xwm txheej (ip-address, date/time, tswb tom ntej, temp/hum)
  3. A dht11 uas ntsuas qhov kub thiab txias ntawm huab cua
  4. Ib lub pob kom kaw lub tswb lossis yog koj nias ntev dua 3 vib nas this rpi yuav kaw
  5. Lub suab nrov los ua suab nrov yog tias lub tswb teeb tsa tau ua tiav lub sijhawm tam sim no
  6. LDR sensor los ntsuas lub teeb hauv chav
  7. 2 Coj kom ci ntsa iab hauv chav yog tias nws tsaus ntuj -> LDR

Kauj ruam 3: Database Model (mySQL)

Database Qauv (mySQL)
Database Qauv (mySQL)

Koj tuaj yeem pom kuv daim duab ERD saum toj no, Kuv tseem yuav txuas cov ntaub ntawv pov tseg kom koj tuaj yeem nqa cov ntaub ntawv khaws cia rau koj tus kheej.

Nrog rau cov ntaub ntawv no koj yuav tuaj yeem qhia ntau yam xws li:

  • Qhov kub
  • Vaum
  • Teeb tus nqi
  • Teeb tsa/xiam oob qhab/ncua sijhawm tswb
  • Yog tias buzzer ua haujlwm
  • Yog hais tias lub teeb nyob rau

Yog tias koj xav rov tsim cov ntaub ntawv no koj yuav tsum tau ua tus siv tshiab yog li koj tuaj yeem txuas rau koj li Raspberry Pi.

Kauj Ruam 4: Kev Txuas Nrog Raspberry Pi

Kev Txuas Nrog Raspberry Pi
Kev Txuas Nrog Raspberry Pi

Ua ntej tshaj plaws koj yuav tsum rub tawm Putty, muaj qhov pub dawb muaj nyob hauv lawv lub vev xaib. Koj tseem yuav xav tau Raspbian uas koj tuaj yeem rub tawm ntawm no.

Thaum koj qhib Putty koj yuav tsum nyem rau 'ntu'. Thaum koj tau ua tiav uas koj yuav tsum tau sau tus IP chaw nyob ntawm Pi hauv qab 'Tus Tswv Chaw Nyob'. Tom qab ntawd koj tuaj yeem sau lub npe siv uas koj tuaj yeem xaiv. ces nyem rau 'OK'.

Feem ntau tom qab txhua cov kauj ruam no nws yuav cia li pib qhov kev sib txuas. Tom qab ntawd koj yuav tsum nkag mus rau koj tus password, thiab koj tau txuas nrog.

Kauj Ruam 5: Software ntawm Raspberry Pi

Software ntawm Raspberry Pi
Software ntawm Raspberry Pi

Rau kuv tus lej ua haujlwm (uas kuv yuav txuas hauv qab no) koj yuav tsum tau teeb tsa qee pob khoom thiab tsev qiv ntawv. Thawj qhov uas xav tau yog rau koj hloov kho koj li Pi.

Ua ntej, hloov kho koj li kab ke cov npe khoom los ntawm kev nkag mus rau cov lus txib hauv qab no: sudo apt-tau hloov tshiab Tom ntej, hloov kho tag nrho koj cov pob khoom teeb tsa rau lawv cov kho tshiab kawg nrog cov lus txib hauv qab no: sudo apt-get dist-upgrade Tom qab koj tau teeb tsa pob khoom koj yuav yuav tsum tau teeb tsa qee lub tsev qiv ntawv:

  • Flaskflask_cors
  • RPI. GPIO
  • hnub tim
  • xov
  • sij hawm
  • cov txheej txheem
  • ib mysq
  • lSocketIO

Kauj Ruam 6: Teeb tsa Lub Vev Xaib ntawm Raspberry Pi

Teeb tsa Lub Vev Xaib ntawm Raspberry Pi
Teeb tsa Lub Vev Xaib ntawm Raspberry Pi

Mus rau koj lub Putty console.

peb yuav nruab Apache webserver. Los ntawm kev ua li ntawd koj yuav tuaj yeem qhib lub vev xaib ntawm txhua lub cuab yeej txuas nrog koj lub network. Ntaus cov lus txib hauv qab no thiab nias sau: sudo apt-tau nruab apache2

Tam sim no mus rau daim nplaub tshev:/var/www/html/Ntawm no koj tuaj yeem tso tag nrho koj cov ntaub ntawv los ntawm koj lub vev xaib thiab qhov index.html nplooj ntawv yuav qhib thaum twg koj xauj mus rau IP ntawm koj Pi. ceev faj tsis txhob ntaus lub peev I hauv index.html txwv tsis pub nws yuav tsis qhib qhov nplooj ntawv.

Kauj Ruam 7: Software: Python

Software: Nab hab sej
Software: Nab hab sej

Kuv tau ua ntau yam ntawv nab nab, Kuv yuav txuas kuv tus githubhere yog li koj tuaj yeem saib cov cai rau koj tus kheej. Tab sis kuv yuav piav qhia nws me ntsis lawm.

Kuv coded qee chav kawm rau Ultrasonic sensor, teeb, LDR thiab LCD. Kuv siv cov tsev qiv ntawv rau DHT11-sensor. (ntshuam Adafruit_DHT) Thaum kawg kuv tsuas siv ib daim ntawv los ua kom tiav txoj haujlwm, qhov no yog npe app.py. Tsis tas li hauv cov ntawv no kuv cim qee txoj hauv kev yog li kuv tuaj yeem nyeem cov ntaub ntawv los ntawm kuv cov ntaub ntawv thiab xa mus rau qhov khoom json uas kuv tau siv hauv kuv cov ntaub ntawv javascript.

Kauj Ruam 8: Software: Lub Vev Xaib

Software: Lub Vev Xaib
Software: Lub Vev Xaib
Software: Lub Vev Xaib
Software: Lub Vev Xaib
Software: Lub Vev Xaib
Software: Lub Vev Xaib
Software: Lub Vev Xaib
Software: Lub Vev Xaib

Vim tias kuv tau tsim txoj hauv kev uas koj tuaj yeem teeb tsa lub tswb ntawm lub vev xaib. Yog li kuv tau tsim lub vev xaib kom cia kuv ua qhov no. Los ntawm lub vev xaib koj tseem tuaj yeem saib cov av noo, kub thiab keeb kwm.

Thaum tus Pi tab tom pib, nws yuav pib khiav kuv cov ntawv nab nab. Qhov no yuav tau saib xyuas kom tau txais cov ntaub ntawv los qhia hauv lub vev xaib thiab ua rau nws muaj peev xwm teeb tsa lub tswb. Lub xaib tseem ua haujlwm zoo yog li nws tuaj yeem qhib rau ntawm lub xov tooj yam tsis tau poob cov yam ntxwv lossis lwm yam.

Kuv tus lej tuaj yeem pom ntawm github ntawm no.

Kauj Ruam 9: Tsim Rooj Plaub

Tsim Rooj Plaub
Tsim Rooj Plaub
Tsim Rooj Plaub
Tsim Rooj Plaub
Tsim Rooj Plaub
Tsim Rooj Plaub

Rau kuv rooj plaub, kuv tsim lub npov kom ua raws lub moos.

Kuv kuj tso duab uas koj tuaj yeem pom cov txheej txheem ntawm kev tsim rooj plaub. Txog qhov ntsuas kuv tseem yuav xa cov ntaub ntawv hauv qab no uas koj tuaj yeem pom kuv cov phiaj xwm ntawm koj yuav rov tsim nws li cas.

Kauj Ruam 10: Tus Neeg Siv Manuel

Ntawm no koj tuaj yeem pom phau ntawv qhia ceev ntawm txoj haujlwm ua haujlwm li cas. Vam tias koj hnub yuav zoo dua yog tias koj ua qhov no lub tswb ntse ntawm qhov kawg ntawm qhov kev qhia no!

Ua tsaug rau koj nyeem.

Pom zoo: