Cov txheej txheem:

SmartMirror Nrog Backlighting: 5 Kauj Ruam
SmartMirror Nrog Backlighting: 5 Kauj Ruam

Video: SmartMirror Nrog Backlighting: 5 Kauj Ruam

Video: SmartMirror Nrog Backlighting: 5 Kauj Ruam
Video: Военные тактические часы-Топ-10 самых жестких военных ч... 2024, Kaum ib hlis
Anonim
SmartMirror Nrog Backlighting
SmartMirror Nrog Backlighting
SmartMirror Nrog Backlighting
SmartMirror Nrog Backlighting
SmartMirror Nrog Backlighting
SmartMirror Nrog Backlighting

Tom qab txheej txheem kev xav ntev kuv tau los xaus los tsim lub iav ntse. Kuv muaj tus cwj pwm uas muaj lub sijhawm pw tsaug zog tsis xwm yeem yog li kuv xav kom daim iav no pab thiab teev kuv lub sijhawm sawv thiab lwm yam. Kuv xav kom nws yooj yim thiab siv 3 lub ntsuas pa thiab ntawm qhov tseeb teeb pom kev zoo.

Kuv yuav coj koj mus dhau txoj kev tsim kuv lub tswv yim.

Khoom siv

Sensors

  • Ib Qhov Kub Kub Sensor (DS18S20)
  • DHT11 Vaum & Kub sensor
  • Infrared tsab ntawv tsa suab sensor

Lwm yam

  • Raspberry Pi 3
  • Ob txoj kev acrylic iav.
  • Khoos phis tawj saib
  • Ntoo ntoo
  • Coj sawb
  • LED sawb 120LED/m 5050
  • HDMI Cable
  • Mosfets IRFZ44N
  • Cov qhob cij
  • Hlau
  • SD daim npav
  • 4, 7K, 1K, 2K Resistors

Kauj ruam 1: Kev thaiv kab

Thaiv
Thaiv

Qhov no yog qhov thaiv nrog cov xav tau cov ntsuas thiab cov tiv thaiv. Peb xav tau lub hwj chim 12V los siv qhov no ntawm lub khob cij. Hauv cov phiaj xwm no yog nyob ntawm tib daim ntawv tais tab sis qhov tseeb nws muaj kev nyab xeeb dua los ua qhov no ntawm cov qhob cij cais.

Kauj ruam 2: Database

Database
Database

Qauv

Cov chaw khaws ntaub ntawv tuaj yeem khaws cov ntaub ntawv ntawm 2 lub ntsuas cua uas xa cov ntaub ntawv. Nws muaj tus lej tshwj xeeb los txheeb xyuas qhov ntsuas ua ke nrog tus nqi thiab sensorID. Lub sijhawm ntsuas kuj tseem khaws cia. Cov ntsuas muaj lub rooj txawv teb chaws los txheeb xyuas lawv hauv lawv lub rooj niam txiv.

Tso tawm:

Peb yuav xav tau xa cov ntaub ntawv no mus rau pi tab sis ua ntej peb yuav tsum nruab MariaDB.

sudo apt nruab mariadb-server

ces:

mysql_secure_installation

Tsuas yog nias nkag. Tom qab ntawd Y thiab nkag mus lo lus zais 2 zaug.

Tsuas yog nias Y rau tag nrho cov txheej txheem.

Ces ntaus:

mysql -u hauv paus -p

Sau koj tus password rau kev txuas.

Tom qab ntawd xa cov ntaub ntawv khaws cia rau PI thiab koj zoo mus.

Koj tuaj yeem pom kuv SQL database hauv qab no.

Kauj Ruam 3: Daim iav Tsev

Daim iav Tsev
Daim iav Tsev
Daim iav Tsev
Daim iav Tsev
Daim iav Tsev
Daim iav Tsev

Kuv siv ntoo MDF los tsim daim iav no. Kuv xub tsim lub xwmfab tso rau daim iav thiab lwm lub xwmfab tso rau saib thiab khoom siv hluav taws xob tom qab. Kuv txuas daim iav nrog rwb thaiv tsev kom nws txav tsis tau ntxiv lawm. Kuv siv woodglue los ua kua nplaum 2 woos plaub fab ua ke.

Kuv drilled ib lub qhov kom tso cov hlua LED hla los txuas nws rau sab ntawm daim iav. Cov hlua LED tau txuas nrog daim kab xev cais.

Kuv pleev xim rau daim iav kom ua tiav zoo. Nws kuj tseem ua tau zoo nrog daim kab xev.

Kuv txuas tus saib nrog 2 txoj kab xev muaj zog. Hmoov zoo qhov no yog qhov ua yuam kev vim tias koj tuaj yeem pom daim kab xev dawb los ntawm daim iav. Kuv tau kaw daim iav tom qab nrog daim kab xev dub kom lub teeb hla tsis dhau.

Kuv glued lub breadboards thiab pi rau sab nraum qab ntawm tus saib.

Kauj ruam 4: Code

Code
Code

Kuv coded tus HTML, css thiab javascript hauv Visualstudio Code thiab kuv backend hauv Pycharm nrog Python.

Kuv siv ntau qhov nyob rau cov ntaub ntawv nyob ntawm kuv lub vev xaib thiab ob peb qhov kev ntsuas rau kev ntsuas txhua hnub. Thaum daim iav ua haujlwm nws yuav tso saib lub ntsuas qhov ntsuas nyob rau lub sijhawm ntawd thiab lub sijhawm hauv cheeb tsam.

Koj tuaj yeem pom kuv tus lej ntawm no: GitHub Repository

Kauj Ruam 5: Khiav Daim iav ntawm PI

Khiav Daim iav ntawm PI
Khiav Daim iav ntawm PI

Vijtsam

Txhawm rau tig lub vijtsam kom dai nws ib sab koj yuav tsum taw rau:

sudo nano /boot /config.txt

thiab ntxiv kab hauv qab no hauv qab:

display_rotate = 1

Apache

Txhim kho apache webserver:

sudo apt nruab apache2 -y

Rub tawm txhua cov ntaub ntawv txuas mus rau/var/www/html/nrog filezilla thiab nws yuav khiav ntawm sebserver.

Backend

Autorun tus backend hauv rc.local:

sudo nano /etc/rc.local

Ntxiv cov kab hauv qab no ua ntej 'tawm 0' tab sis siv qhov chaw ntawm koj cov ntaub ntawv backend:

sudo nab hab sej /home/gilles/mirror.py

Tam sim no PI tab tom khiav lub vev xaib thiab backend thaum pib.

Khiav daim iav nplooj

Tam sim no peb xav kom tus pi khiav lub html nplooj ntawv ntawm tus tswv hauv zos hauv puv npo (peb daim iav tsom iav)

tsim ib tsab ntawv hauv koj txoj hauv kev xav nrog cov cai no:

#!/bin/bashsleep 20DISPLAY =: 0 chromium --noerrdialogs --kiosk https://localhost/mirror.html --incognito

Tam sim no khaws cov ntawv thiab mus rau:

sudo nano lxsession/LXDE-pi/autostart

tom qab ntawd ntxig kab kab ntawv no hauv qab:

@sh tsab ntawv.sh

Daim iav tam sim no yuav pib siv thaum pib thiab koj yuav pom koj tus kheej daim iav ntse!

Tsuas yog nthwv mus rau IP chaw nyob ntawm lub vijtsam thiab koj tuaj yeem nkag mus rau lub vev xaib ntawm koj lub xov tooj, laptop …

Pom zoo: