Cov txheej txheem:

Kuv Daim iav Ntse: 15 Kauj Ruam (nrog Duab)
Kuv Daim iav Ntse: 15 Kauj Ruam (nrog Duab)

Video: Kuv Daim iav Ntse: 15 Kauj Ruam (nrog Duab)

Video: Kuv Daim iav Ntse: 15 Kauj Ruam (nrog Duab)
Video: Tseem Ev Lub Kawm - Koos Loos 2024, Hlis ntuj nqeg
Anonim
Kuv Ntse Daim iav
Kuv Ntse Daim iav

Lub sijhawm thaum sawv ntxov tuaj yeem txwv. Koj yuav tsum tau npaj rau kev ua haujlwm, tsev kawm ntawv,… Saib huab cua yuav siv qee lub sijhawm uas nyob ntawd. Daim iav ntse tshem tawm lub sijhawm koj xav tau qhib koj lub xov tooj lossis khoos phis tawj thiab saib huab cua. Hauv txoj haujlwm no peb yuav ua daim iav zoo li no. Nws yuav tuaj yeem qhia koj lub sijhawm, huab cua hauv cheeb tsam, qhov kub thiab av noo ntawm qhov chaw uas koj daim iav dai. Cov ntaub ntawv no tseem yuav raug qhia ntawm lub vev xaib ua hauv tsev.

Kauj Ruam 1: Cov Cheeb Tsam Koj Xav Tau

Cov npe ntawm cov khoom tuaj yeem pom hauv pdf hauv qab no

  • Khoos phis tawj lub computer nrog HDMI cov tswv yim (lossis DVI cov tswv yim nrog hloov pauv zoo li hauv kuv qhov teeb meem)
  • DHT11 kub thiab av noo sensor
  • Raspberry pi 3 qauv B.
  • Ntoo
  • Kho vajtse txhawm rau kho cov ntoo hauv qhov chaw (ntsia hlau, kua nplaum, nkhaus)
  • Cov iav tsom iav, sim txiav txim qhov ntev raws li ze ntawm qhov ntev ntawm lub vijtsam. Kuv xaj kom muaj kev cai me me thiab ntsuas sab nrauv ntawm lub vijtsam, sib sau ua ke, nrog ciam teb. Lub vijtsam tuaj yeem so ntawm daim iav nkag mus.
  • Cables txuas lub sensor rau koj tus txiv pos raspberry (poj niam-poj niam 2.54 txog 2.0mm jumper xov hlau tau thov)
  • HDMI kab

Kauj Ruam 2: Teeb Raspberry Pi

Tam sim no nws yog lub sijhawm los teeb tsa qee software kom tswj tau Raspberry Pi:

  • Raspbian OS duab
  • Win32 disc tus tswj hwm

1) Nruab Raspbian OS software los ntawm Raspberry pi lub vev xaib.

Rub tawm ZIP cov ntaub ntawv thiab rho tawm nws mus rau qhov chaw xav tau.

2) Rub tus Win32 disc tus tswj.

  • Nyem rau ntawm daim nplaub tshev icon xaiv cov duab
  • Tom qab ntawv xaiv ntawm "Ntaus" koj microSD
  • Tom qab ntawv nyem rau "Sau"

Thaum cov duab sau rau ntawm koj daim npav MicroSD, koj tuaj yeem qhib nws hauv Windows Explorer.

  • Qhib cov ntaub ntawv "cmdline.txt"
  • Ntxiv kab hauv qab no ua ntej lo lus "rootwait": 169.254.10.0
  • Tom qab ntawd khaws cov ntawv.

Tam sim no ntxig MicroSD rau hauv koj li Raspberry pi

Thov lub hwj chim rau koj Pi nrog 5, 2V lub zog hloov pauv.

Txuas lub network cable rau koj Pi thiab koj lub computer.

Kauj Ruam 3: Txuas rau Koj Tus Raspberry Pi

Txuas nrog Koj Raspberry Pi
Txuas nrog Koj Raspberry Pi

Tam sim no peb tau teeb tsa txhua yam koj xav tau los siv koj li RPi

1) Nruab Putty thiab qhib nws.

2) Tsim kev sib txuas (raws li qhia hauv daim duab)

3) Nkag mus rau koj tus pi:

  • username: pib
  • Lo lus zais: raspberry

4) WIFI teeb tsa

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Hauv qab ntawm cov ntawv, koj ntxiv cov kab no:

network = {ssid = "lub npe ntawm lub wireless network" psk = "password ntawm lub wireless network"

}

5) Txhawm rau txuas wireless rau koj RPi koj yuav tsum xub nrhiav koj tus IP chaw nyob ntawm tus lej no:

ifconfig wb 0

Tam sim no koj tuaj yeem siv tus IP chaw nyob hauv putty nkag mus rau wireless.

Kauj Ruam 4: Ntsuas Qhov Ntev rau Kev Tsim Ntoo

Koj yuav tsum ntsuas 2 yam:

  • Qhov ntev ntawm koj lub vijtsam (! Tsuas yog tshuaj ntsuam, tsis muaj ntug!)
  • Qhov ntev ntawm daim iav plexi koj tau yuav

Nco ntsoov tias cov ntsuas no yuav yog sab hauv ntawm lub duab plaub. Thaum yuav ntoo, koj yuav tsum tau ntxiv 8 npaug tus nqi ntawm qhov dav ntawm ntoo kom muaj qhov ntev raug vim tias nws zoo yog tias koj pom ntoo hauv miter.

Rau pem hauv ntej ntawm daim iav, kuv tau siv ntoo ntoo ntawm 18 txog 69mm thiab ntev txog 210cm

Sau qhov ntev cia, peb yuav siv lawv tom qab.

Kauj Ruam 5: Siv Lub Vev Xaib Sib nrug

Siv lub Screen Sib nrug
Siv lub Screen Sib nrug
Siv lub Screen Sib nrug
Siv lub Screen Sib nrug
Siv lub Screen Sib nrug
Siv lub Screen Sib nrug

Tam sim no peb yuav coj qhov screen sib nrug. Txhua lub vijtsam sib txawv, rau kuv lub vijtsam kuv yuav tsum xoob 4 tus ntsia hlau thiab tshem tawm cov ntsia ib ncig ntawm lub saib. Kuv qhov teeb meem, lub vijtsam tau txuas nrog lub zog siv los ntawm tsuas yog ob peb txoj xov hlau. Yog li kuv tau kaw lub nraub qaum rau ntawm qhov screen nws tus kheej, yog li nws yuav tsis txav mus los.

Kauj Ruam 6: Ua Sab Pem Hauv Ntej ntawm Daim iav

Ua Sab Pem Hauv Ntej ntawm Daim iav
Ua Sab Pem Hauv Ntej ntawm Daim iav
Ua Sab Pem Hauv Ntej ntawm Daim iav
Ua Sab Pem Hauv Ntej ntawm Daim iav
Ua Sab Pem Hauv Ntej ntawm Daim iav
Ua Sab Pem Hauv Ntej ntawm Daim iav
  1. Txhawm rau ua ntu ntu, peb xav tau qhov ntsuas ntawm lub vijtsam yam tsis muaj ciam teb. Koj tuaj yeem xaiv qhov dav ntawm ntoo yuav tsum yog, tab sis kuv pom zoo kom siab txog +/- 20mm. Ciam teb tsis tas yuav siab li ntawd.
  2. Nws pab tau yog tias koj ua thawj daim duab zoo li hauv daim duab thib ob nrog koj ntsuas. Nws pab thaum txiav cov ntoo.
  3. Ntsuas qhov ntev ntawm koj lub vijtsam ntawm ntoo. Kos kaum kaum ntawm 45 ° sab nraud ntawm txhua sab. Rov ua qhov no rau 4 qhov ntev ntawm koj lub vijtsam.
  4. Koj tuaj yeem txiav cov phiaj ntoo koj tus kheej siv lub viav vias ncig, lossis nug lub khw uas koj yuav cov phiaj ntoo ua nws rau koj.
  5. Kuv tau hlais 2 lub qhov me me rau ib lub plank ntawm ib sab hauv qhov siab ntawm ntoo, yog li kuv tuaj yeem haum cov kais dej hauv lub qhov kom txuas cov ntoo ua ke.
  6. Txhawm rau txhim kho lawv ua ke tas li kuv siv cov kua nplaum ntoo.
  7. Cia cov kua nplaum ua kom tawv thaum hmo ntuj.

Kauj Ruam 7: Ua Tom Qab Ntawm Daim iav

Ua Sab Sab Ntawm Daim iav
Ua Sab Sab Ntawm Daim iav
Ua Sab Sab Ntawm Daim iav
Ua Sab Sab Ntawm Daim iav
Ua Sab Sab Ntawm Daim iav
Ua Sab Sab Ntawm Daim iav
  1. Tam sim no peb yuav xav tau qhov ntsuas ntawm daim iav-plexi.
  2. Peb yuav tsis txiav cov ntoo ntawm lub kaum sab xis 45 °.
  3. Koj daim duab yuav tsum zoo li daim duab thib peb.
  4. Txog qhov ntev, peb tab tom yuav ntxiv 2 npaug ntawm qhov dav ntawm cov ntoo.
  5. Txog qhov siab, peb tab tom txiav cov phiaj rau qhov ntsuas ntawm plexi-daim iav. Qhov tshwm sim yog, thaum tso cov phiajcim zoo li hauv daim duab, kev ntsuas sab hauv zoo ib yam rau ntawm plexi-daim iav.
  6. Txhawm rau txhim kho cov ntoo ntoo ua ke, kuv drilled qhov thiab txuas nws nrog cov ntsia hlau. Vim tias qhov no yuav yog sab nraub qaum, kev kho kom zoo tsis yog qhov tseem ceeb.

Kauj Ruam 8: Ua tiav Kev Tsim Ntoo

Ua tiav Kev Tsim Ntoo
Ua tiav Kev Tsim Ntoo
Ua tiav Kev Tsim Ntoo
Ua tiav Kev Tsim Ntoo

Tam sim no, peb tab tom yaum 2 lub tsev tsim ua ke.

Kuv siv hlau 90 ° khoov thiab ntsia hlau txhawm rau kho 2 raws li qhia hauv daim duab.

Koj tseem tuaj yeem siv cov duab plaub me me nrog cov ntsia hlau, tab sis nws tsis tsim nyog.

Kauj Ruam 9: Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho

Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
Tso lub Plexi-iav thiab Screen hauv Kev Tsim Kho
  1. Yog tias txhua yam yog qhov raug, koj daim iav haum zoo nyob tom qab thiab so ntawm ntug ntawm sab xub ntiag.
  2. Kuv muab qee cov kua nplaum tso rau ntawm ntug thiab muab daim iav tso rau hauv nws txoj haujlwm zaum kawg.
  3. Muab qee qhov hnyav tso rau ntawm daim iav, yog li nws qhuav zoo.
  4. Cia nws zaum ib hmo.

Kauj Ruam 10: Tso Nws Txhua Qhov Ua Ke

Tso Nws Txhua Qhov Ua Ke
Tso Nws Txhua Qhov Ua Ke
Tso Nws Txhua Qhov Ua Ke
Tso Nws Txhua Qhov Ua Ke
Tso Nws Txhua Qhov Ua Ke
Tso Nws Txhua Qhov Ua Ke
Tso Nws Txhua Qhov Ua Ke
Tso Nws Txhua Qhov Ua Ke

Tam sim no peb kev tsim kho tiav, peb yuav tso peb lub vijtsam hauv lub tsev, nrog DHT11 ntsuas kub.

Koj yuav kho nws li cas, yog nyob ntawm koj, tsuas yog xyuas kom lub vijtsam thiab pi tsis mus qhov twg.

Kuv tau teeb tsa DHT11 lub ntsuas kub sab nraud ntawm daim iav, yog li kev nyeem yuav yog qhov tseeb tshaj plaws.

Kauj ruam 11: SQL- Database

SQL- Cov ntaub ntawv
SQL- Cov ntaub ntawv
  1. Hauv cov kauj ruam no peb yuav txhim kho qee yam khoom uas yuav ua rau nws muaj peev xwm khiav cov ntaub ntawv khaws cia.
  2. sudo apt hloov tshiab
  3. sudo apt install -y python3-venv python3-pip python3-mysqldb mariadb-server uwsgi nginx uwsgi-plugin-python3

Tam sim no peb tsis muaj neeg siv. Peb siv cov cai no los tsim cov neeg siv, koj tsuas yog yuav tsum tau sau rau tus neeg siv thiab tus password:

Tsim tus neeg siv 'FILL_USER_IN'@'localhost' IDENTIFIED BY 'FILL_PASSWORD_IN';

Tsim DATABASE ntse-daim iav;

ZOO TSHAJ PLAWS NTUJ NTAWV ntawm ntse-daim iav.* Rau 'FILL_USER_IN'@'localhost' NROG QHOV ZOO TSHAJ PLAWS;

sudo mariadb <sql/db_init.sql

Kauj ruam 12: SQL Kev Sib Txuas rau Pycharm

Peb yuav txuas peb cov ntaub ntawv khaws cia rau pycharm

  1. Mus rau View> Tool Windows> Database thiab nyem rau ntawm ntsuab ntxiv rau ntxiv kev sib txuas
  2. Xaiv Cov Ntaub Ntawv Qhov Chaw> MySQL thiab Rub tus tsav tsheb, yog tias nws los txog

General

  • Tus tswv = localhost
  • Chaw nres nkoj = 3306
  • Tus neeg siv = *lub npe koj xaiv hauv qib kawg *
  • Lo lus zais = * tus lej koj tau xaiv hauv qib kawg *

SSH/SSL

  • Proxy host = * koj tus IP chaw nyob *
  • Chaw nres nkoj = 22
  • Proxy user = pib
  • Pov thaiv tus password = raspberry

Kom ntxig ntxhuav

  1. koj txoj nyem rau ntawm ntse-daim iav> qhib console
  2. Ua sql hauv zip file hauv console
  3. Database yog ua

Kauj Ruam 13: Tau Txais Txoj Cai rau Txoj Haujlwm

Tau txais Code rau Txoj Haujlwm
Tau txais Code rau Txoj Haujlwm

Hauv pycharm mus rau:

Cov ntaub ntawv> chaw> Tsim, Ua tiav, Kev xa tawm> Kev xa tawm

Sau qhov screen zoo li hauv daim duab

Ua tib yam hauv

File> Default settings> Build, Execution, Deployment> Deployment

Tam sim no koj tsuas yog rub cov lej los ntawm kuv github thiab qhib nws hauv pycharm

Kauj Ruam 14: Pib Ua Haujlwm Txoj Haujlwm

Txhawm rau thauj cov vijtsam nplooj ntawv thaum pib, hauv koj Pi, koj ntaus qhov no:

cd /home/pi/.config/lxsession/LXDE-pi/

thiab qhib cov ntawv autostart nrog nano

nano autostart pib

Koj paub tseeb tias qhov no yog dab tsi hauv cov ntawv:

@lxpanel --profile LXDE-pi @pcmanfm-desktop --profile LXDE-pi @xscreensaver -no-splash @point-rpi @chromium-browser --incognito --kiosk 127.0.0.1/monitor @xset s noblank @xset s tawm @xset -dpms

Tam sim no nplooj ntawv saib yuav thauj khoom thaum pib thiab lub vijtsam tsis ua haujlwm.

Kauj Ruam 15: Txaus Siab Rau Koj Daim iav Ntse

Txaus siab rau Koj Daim iav Ntse
Txaus siab rau Koj Daim iav Ntse

Tam sim no koj tsuas yog lub zog ntawm lub vijtsam thiab pi, thiab cia daim iav ua nws cov khawv koob.

Nws yuav siv qee lub sijhawm rau Daim iav kom khau raj, tab sis cia nws ua nws txoj haujlwm.

Qhov chaw ntawm lub vijtsam tau teeb tsa rau Kortrijk, Belgium, qhov chaw uas tsom iav tau ua, tab sis yog tias koj xav hloov nws, mus rau hauv lub vev xaib> zoo li qub> JavaScript nplaub tshev hauv cov cai thiab tshawb nrhiav kab uas Lub Nroog = Kortrijk; (nws yog thawj kab ntawm txoj cai). Koj tuaj yeem hloov nws mus rau qhov chaw koj nyob. Koj yuav tsum hloov nws hauv 2 javascript cov ntaub ntawv rau qhov chaw hloov pauv ntawm qhov chaw thiab ntawm daim iav.

Txaus siab rau koj daim iav ntse!

Clocks Contest
Clocks Contest
Clocks Contest
Clocks Contest

Qhov khoom plig thib ob hauv Kev Sib Tw Clocks

Pom zoo: