Cov txheej txheem:

SmartFridge: 10 Kauj Ruam
SmartFridge: 10 Kauj Ruam

Video: SmartFridge: 10 Kauj Ruam

Video: SmartFridge: 10 Kauj Ruam
Video: 10 самых АТМОСФЕРНЫХ мест Дагестана. БОЛЬШОЙ ВЫПУСК #Дагестан #ПутешествиеПоДагестану 2024, Kaum ib hlis
Anonim
SmartFridge
SmartFridge
SmartFridge
SmartFridge

Koj puas tau muaj teeb meem, uas koj tsis tau paub tiag tiag dab tsi nyob hauv koj lub tub yees? Lossis koj puas tau coj qee yam tawm ntawm koj lub tub yees thiab tsis nco qab kaw nws? Zoo kuv feem ntau tau ua. Tias yog vim li cas kuv tsim txoj haujlwm no.

Qhov SmartFridge ceeb toom rau koj nrog lub suab nrov nrov yog tias koj tawm ntawm lub qhov rooj qhib, thiab nco qab tias cov khoom lag luam twg nyob hauv koj lub tub yees thiab tus nqi ntawm lawv.

Khoom siv:

Yam uas koj xav tau rau txoj haujlwm no:

  • Raspberry Pi 3 qauv B
  • Raspberry PI T-cobbler
  • Barcode Reader/Scanner Module
  • Dallas (tsis muaj dej)
  • LCD zaub rau raspberry Pi
  • Cov xov hlau
  • LDR
  • MCP3008
  • Hais lus

tag nrho cov ntu no yuav raug nqi koj ib ncig € 146

Kauj Ruam 1: Cov Hluav Taws Xob Hluav Taws Xob

Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob

Ua ntej koj yuav tsum tau teeb tsa Circuit Court ua ke, Kuv tau muab Fritzing schema los ua qhov no. Yog koj yuav siv kuv tus lej kuv tau muab ntawm cov kauj ruam nyeem cov ntaub ntawv sensor Nws tseem ceeb koj xaim te sensors thiab LED rau tib GPIO pins, Koj tuaj yeem kuj tsuas yog hloov tus pins hauv cov cai.

Tsis txhob hnov qab txuas lub tshuab luam ntawv barcode rau 1 ntawm USB chaw nres nkoj ntawm pi

Kauj ruam 2: Teeb Raspberry Pi

Teeb Raspberry Pi
Teeb Raspberry Pi
Teeb Raspberry Pi
Teeb Raspberry Pi
Teeb Raspberry Pi
Teeb Raspberry Pi
  • Rub cov duab raspbian los ntawm lub vev xaib no:
  • Xaiv Raspbian Stretch nrog lub desktop thiab pom zoo xaiv software.
  • Nruab Balena Etcher:
  • Txuas koj lub laub micro SD rau koj lub khoos phis tawj
  • Qhib Etcher & xaiv iso cov ntaub ntawv koj nyuam qhuav rub tawm los ntawm raspberrypi.org
  • Xaiv koj lub laub micro SD
  • Nyem nyem! & tos ib pliag

Kauj Ruam 3: Hloov Chaw Raspbian

Hloov Chaw Raspbian
Hloov Chaw Raspbian

Thaum khau raj hauv raspbian koj yuav tsum hloov qee qhov chaw:

  • Ua ntej txuas rau koj lub network wifi
  • Qhib lub davhlau ya nyob twg qhov rai thiab ntaus: sudo raspi-config
  • Mus rau khau raj xaiv> Desktop / CLIChoose Console
  • Nias nkag mus
  • Mus rau cov kev xaiv cuam tshuam Qhib Serial thiab 1-xaim
  • Nias qhov ua tiav thiab cia tus pi reboot

Tom qab hom reboot hauv console:

  • sudo apt-tau hloov tshiab
  • sudo apt-tau hloov tshiab
  • y

Kauj Ruam 4: Nyeem Cov Ntaub Ntawv Sensor

Nyeem Cov Ntaub Ntawv Sensor
Nyeem Cov Ntaub Ntawv Sensor

Koj yuav siv cov lus programming Python los nyeem cov ntaub ntawv los ntawm cov ntsuas hluav taws xob & xa cov ntaub ntawv mus rau LCD zaub.

Koj tuaj yeem pom tag nrho kuv cov cai ntawm github:

Koj yuav pom kuv siv chav kawm sib txawv los nyeem cov ntaub ntawv los ntawm kuv lub ntsuas cua.

  • Lub tshuab luam ntawv barcode txuas nrog tus pi ntawm USB thiab siv tus lej txuas, Raws li tus qauv lub tshuab luam ntawv tau teeb tsa ua cov keyboard. Yog li peb yuav tsum hloov qhov no: Siv phau ntawv no thiab luam theej cov lej no:- USB COM Port Emulation- Tsis muaj (nplooj 12 ntawm phau ntawv qhia)- EnableEAN-8* (nplooj 24)- EnableEAN-13* (nplooj 25)
  • Qhov sib piv ntawm LDR tau hloov pauv siv MCP3008, tom qab ntawd hloov pauv los ntawm tus nqi mus rau feem pua.

Yog tias koj xav siv ntau dua tom qab ntawd 1 thaum Tseeb lub voj koj yuav xav tau ntshuam xov (qhov no twb tau ua tiav hauv cov cai muab)

Kauj Ruam 5: MySQL Database

MySQL Database
MySQL Database

Peb yuav khaws peb cov khoom hauv lub tub yees thiab kub hauv peb cov ntaub ntawv. Ua kom tswj cov ntaub ntawv kuv siv mySQLworkbench, Hauv mysqlworkbench koj yuav xav teeb tsa kev sib txuas nrog koj tus raspberry pi. Tab sis kom qhov no ua haujlwm peb yuav xav tau teeb tsa mariaDB ntawm peb cov raspberry pi.

Nov yog qhov koj ua nws:

sudo apt-tau nruab mariadb-server

Tom qab teeb tsa mariaDB nrog:

sudo mysql_secure_installationEnter password tam sim no rau hauv paus (nkag rau tsis muaj): hauv paus Hloov tus lej nkag hauv paus? [Y/n] Y lo lus zais tshiab: root123 Tshem cov neeg siv tsis qhia npe? [Y/n] y Disallow root login remotely? [Y/n] y Tshem tawm cov ntawv xeem thiab nkag mus rau nws? [Y/n] y Rov qab muaj lub rooj tshwj xeeb tam sim no? [Y/n] y

Txuas nrog mysqlworkbench mus rau mariaDB server nrog tus neeg siv hauv paus thiab tus password uas koj tau xaiv saum toj no ntawm koj tus ip chaw nyob.

Koj tuaj yeem pom koj tus ip chaw nyob IP los ntawm kev ntaus cov hauv qab no hauv lub davhlau ya nyob twg:

ip aw

Saib ntawm tus IP chaw nyob hauv wlan0 nws yuav zoo li zoo li 192.168. X. X

Kauj Ruam 6: Nruab Apache Webserver

Nruab Apache Webserver
Nruab Apache Webserver

Tam sim no peb yuav mus tom ntej thiab teeb tsa apcahe webserver los ntawm kev ntaus cov hauv qab no hauv lub davhlau ya nyob twg:

sudo apt-tau nruab apache2

sudo rov pib dua

Tam sim no theej cov ntawv los ntawm cov npe hauv qab no mus rau daim nplaub tshev/var/www/html ntawm SFTP siv qhov haujlwm zoo li Cyberduck lossis Filezilla ntawm tus IP chaw nyob los ntawm cov kauj ruam ua ntej

Kauj Ruam 7: Tshaj tawm Python Code rau Koj Tus Pi

Tshaj tawm Python Code rau Koj Pi
Tshaj tawm Python Code rau Koj Pi

Kuj siv cyberduck lossis filezilla koj yuav xav tau xa tus nab npawb nab npawb rau koj tus pi hauv qab / home / user_name Cov ntaub ntawv tau muab hauv qab no lossis ntawm kuv github

Tom qab ntawv khiav tsab ntawv siv cov lus txib no:

nab hab sej /tsev /user_name /back/app.py

Txheeb xyuas yog tias txhua yam ua haujlwm los ntawm kev ntaus koj tus raspberry pi tus IP chaw nyob hauv koj tus browser. Koj yuav tsum pom lub vev xaib nrog qhov ntsuas kub thiab lub rooj npliag

Tam sim no koj lub smartfridge yuav tsum ua haujlwm txig thiab peb tuaj yeem mus tom ntej thiab ua kom nws "zoo nkauj"

Nco tseg: hloov user_name saum toj no ib txwm nrog lub npe ntawm tus neeg siv uas koj tsim ntawm koj pi lossis tsuas yog siv tus neeg siv pi

Kauj Ruam 8: Vaj Tsev

Vaj Tsev
Vaj Tsev

Lub tsev uas kuv tau ua yog ua los ntawm lub thawv yas uas koj tuaj yeem kaw nrog cov kauv, tab sis koj tuaj yeem ua rau txhua txoj hauv kev uas koj xav tau. Tsuas yog tsis txhob hnov qab kom ntseeg tau tias lub teeb pom kev tuaj yeem pom lub teeb.

  • tsuag xim lub thawv dawb
  • Laum 2 qhov ntawm 8mm txoj kab uas hla ntawm nraub qaum, ib qho rau qhov ntsuas kub thiab 1 rau lub tshuab ntsuas barcode
  • Laum 1 lub qhov nyob rau sab laug ntawm lub thawv rau lub hwj chim ntawm koj tus pi
  • Ua lub qhov plaub fab nyob rau sab xub ntiag ntawm lub npov rau LCD zaub (Tsis txhob siv rab riam kuv twb sim nws thiab txiav kuv tus kheej)
  • Siv qee daim kab xev ob tog kom paub tseeb tias koj lub khob cij nyob qhov twg.

Kauj Ruam 9: Muab Lub Tsev Nyob Hauv Lub Txias

Muab Lub Tsev Nyob Hauv Lub Txias
Muab Lub Tsev Nyob Hauv Lub Txias

Muab koj lub thawv tso rau hauv lub tub yees

  • Laum ib lub qhov hla hauv qab ntawm koj lub tub yees rau txuas txuas txuas.
  • Sau lub qhov rov qab nrog qee qhov styrofoam
  • Siv silicon los sau qhov seem ntawm qhov sib txawv
  • Ua kom nws du nrog rab diav nrog xab npum nyob tom qab (yog li koj cov ntiv tes tsis lo)
  • Siv qee lub tsheb thauj khoom los nkaum qhov txuas txuas

Tam sim no koj tuaj yeem siv zog koj cov raspberry pi sab hauv lub tub yees

  • Siv 1 ntawm cov yas ntim los ntawm lub qhov rooj tub yees kom muab koj lub tshuab luam ntawv barcode rau
  • Nco ntsoov tias nws tsis txav nrog qee daim kab xev ob tog
  • Siv qee cov tsheb thauj khoom siv los nkaum qhov cable

Kauj Ruam 10: Kev xa mus

Kev xa mus
Kev xa mus

Yog tias koj xav siv lub vev xaib los tshuaj xyuas dab tsi sab hauv koj lub tub yees los ntawm sab nraum koj lub tsev koj yuav xav tau xa koj cov chaw nres nkoj hauv lub router.

Koj tuaj yeem ua qhov no los ntawm kev nkag mus rau koj tus IP chaw nyob hauv koj tus browser, nrhiav nplooj ntawv xa mus rau nplooj ntawv, teeb tsa txoj cai rau koj tus raspberry pi tus IP chaw nyob qhib chaw nres nkoj 80 txog 80 thiab 5000 txog 5000 nrog TCP raws tu qauv thiab khaws cov chaw.

Nco tseg: Txhawm rau txheeb xyuas koj lub router tus ip ntawm lub qhov rais, ntaus cmd hauv kab ntawv tshawb nrhiav, qhib lub commandprompt ntsaum hom: ipconfig. Lub qhov rooj tsis raug yuav yog koj lub router ip.

Ntawm mac koj mus rau cov ntawv qhia zaub mov Kua/System nyiam/Network/advanced/TCPIP, koj lub router ip yuav yog router

Pom zoo: