Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Kev thaiv kab
- Kauj ruam 2: Database
- Kauj Ruam 3: Teeb Raspberry Pi
- Kauj ruam 4: Arduino Uno Teeb
- Kauj Ruam 5: Case Case
- Kauj Ruam 6: Tiav Kov
Video: SmartBox - Smart Tsev System rau Koj Chav: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Nyob zoo sawv daws!
Hauv cov lus qhia no, kuv yuav piav qhia rau koj tias yuav ua li cas thiaj ua tau chav zoo. Cov kab ke no muaj ob yam khoom siv.
Ib qho cuab yeej dav dav nrog lub ntsuas cua thiab ntsuas qhov ntsuas kub uas ntsuas lub neej tam sim no hauv koj chav. Koj yuav tuaj yeem teeb tsa qhov xav tau yam tsawg kawg nkaus thiab qhov kub thiab txias tshaj plaws. Thaum cov txiaj ntsig no sib txawv, koj yuav tau txais cov ntawv ceeb toom ntawm nplooj ntawv.
Ntxiv nrog rau cov ntsuas, kuj tseem muaj lub xov tooj cua ntse suav nrog tus hais lus uas koj tuaj yeem tswj hwm ntawm lub vev xaib. Koj tuaj yeem tsim, rho tawm thiab qhib/qhib lub tswb. Teeb tsa lub tswb tshwm sim nrog kev txav tes yooj yim dua ntawm lub ntsuas ultrasonic.
Ua tus thib ob thiab cais cov cuab yeej, koj yuav tuaj yeem tswj tau ib qho LED sawb nrog cov qauv ua ntej thiab cov xim.
Khoom siv
- Raspberry Pi 3 qauv B+
- 16GB SD Card
- Arduino Ib
- Sib sau Pi T-Cobbler Ntxiv
- Cov ntawv me me
- Mov ci fais fab mov (Piv txwv li YwRobot Fais Fab Khoom)
- Ib Tus Hlau Kub Kub sensor (DS18B20+)
- Digital Vaum & Vaum sensor (DHT22)
- Ultrasonic Distance sensor (HC-SR05)
- 16x2 LCD Screen
- Cov potentiometer
- Amplifier (Adafruit MAX98357A I2S 3W Class D Amplifier)
- Tus hais lus 3 Txoj kab uas hla - 4 Ohm 3 Watt
- Bluetooth module (HC-05)
- 5V RGB Ledstrip (WS1812B)
- 1x 4.7K Ohm Resistor
- 1 x 10K Ohm Resistor
3 x 1K Ohm Resistor
- 1x 330 Ohm tus tiv thaiv
- Dhia cov kab hluav taws xob
Kauj ruam 1: Kev thaiv kab
Cia peb pib, puas yog.
Ua ntej, txuas txhua yam raws li cov txheej txheem saum toj no. Nco ntsoov tias koj txuas txhua yam kom raug, txwv tsis pub qee yam yuav tsis ua haujlwm.
NCO TSEG: Yog tias koj xav hloov kho, tom qab ntawd koj yuav tau kho cov cai. Yog li tsuas yog ua qhov no yog tias koj paub tias koj tab tom ua dab tsi! Koj ib txwm tuaj yeem tiv tauj kuv rau cov lus nug lossis teeb meem.
Yog tias koj xav tau cov txheej txheem fritzing, koj tuaj yeem rub tawm lawv ntawm no.
Kauj ruam 2: Database
Cov ntaub ntawv khaws tseg yuav khaws txhua qhov ntsuas ntsuas hauv keeb kwm yav dhau los. Qhov no yog siv rau keeb kwm kab teeb ntawm lub vev xaib.
Yog tias koj xav ua haujlwm ntawm lub vev xaib koj yuav xav tau tus account. Txhua tus as khauj khaws lub tswb, lub teeb pom kev zoo, ceeb toom thiab teeb tsa.
NCO TSEG: Tus txheej txheem nkag tsis suav nrog tab sis kuv tuaj yeem ntxiv qhov no tom qab.
Kauj Ruam 3: Teeb Raspberry Pi
Yog li yog txhua yam txuas nrog, peb tuaj yeem pib nrog teeb tsa ntawm Raspberry Pi.
Ua ntej, cia pib nrog daim duab.
Duab
1: Rub tawm Raspberry Pi OS duab:
2: Rub tawm thiab teeb tsa Win32DiskImager:
3: Ntxig daim npav SD thiab khiav Win32DiskImager.
4: Xaiv cov duab rub tawm ntawm koj tsav. Tom qab ntawv xaiv koj daim npav SD thiab nias lub pob sau. (Nco ntsoov tias daim npav SD tsis muaj dab tsi ua ntej koj pib txheej txheem no, txhua cov ntaub ntawv yuav raug tshem tawm!)
5: Yog tias txheej txheem ua tiav, peb tuaj yeem ua qhov hloov kho zaum kawg rau Raspberry Pi. Mus rau SD-card cov npe thiab ntxiv cov ntawv "ssh" yam tsis txuas ntxiv kom paub tseeb tias pi yuav pab SSH thaum pib.
6: Tom qab ntawd qhib cmdline.txt hauv tib cov npe thiab ntxiv "ip = 169.254.10.1" ntawm qhov kawg ntawm kab thiab nyem rau ntawm save. NOTE: Khaws txhua yam ntawm ib kab lossis qee qhov chaw yuav tsis ua haujlwm.
7: Tam sim no muaj kev nyab xeeb tshem daim npav SD ntawm koj lub khoos phis tawj thiab tso daim npav SD hauv Raspberry Pi.
8: Thaum qhov ntawd ua tiav, koj tuaj yeem txuas tus pi nrog Ethernet cable mus rau qhov chaw nres nkoj LAN ntawm koj lub laptop lossis khoos phis tawj.
9: Fais fab Raspberry Pi.
Kev teeb tsa Wi-nkaus thiab Pi
Txhawm rau tswj Raspberry Pi hla SSH peb xav tau software uas hu ua Putty. Koj tuaj yeem rub tawm thiab teeb tsa Putty ntawm no:
1: Thaum Putty tau teeb tsa koj tuaj yeem txuas rau pi nrog IP: 169.254.10.1 thiab chaw nres nkoj: 22. Thaum cov kab hais kom ua interface tshwm tuaj koj tuaj yeem nkag mus nrog tus siv: pi thiab tus password: raspberry.
2: Tam sim no peb tau nkag mus rau hauv hom "sudo raspi-config" thiab mus rau kev xaiv cuam tshuam. Nco ntsoov Ib-Hlau, Serial (Tsuas yog qhib qhov chaw nres nkoj khoos phis tawj, tsis yog lub plhaub nkag mus hla tus lej), I2C en SPI tau qhib.
3: Txhawm rau txuas nrog Wifi peb yuav tsum siv tus neeg siv hauv paus. Ntaus "sudo -i" txhawm rau nkag mus ua tus neeg siv hauv paus.
4: Txhawm rau ntxiv koj li Wi -nkaus network rau Raspberry Pi, ntaus ntawv
"wpa_passphrase" SSID "" koj tus password ">> /etc/wpa_supplicant/wpa_supplicant.conf"
hauv lub davhlau ya nyob twg nrog lub npe thiab tus password ntawm koj lub network.
5: Thaum qhov no ua tiav, rov pib dua koj tus pi.
6: Yog tias txhua yam raug, koj yuav tsum pom tus IP ntawm koj wlan0 interface. Ua "ip a" txhawm rau txheeb xyuas qhov no.
7: Raws li hom kawg "sudo apt-tau hloov tshiab" thiab "sudo apt-tau hloov dua tshiab" hloov kho koj li pi.
8: Nco ntsoov teeb tsa MySQL, apache2 thiab php-mysql rau txoj haujlwm no. Hom: sudo apt nruab apache2 mariadb-server php-mysql -y
9: Rau txhim kho MySQL nyeem kab ntawv no:
10: Hloov kho koj tus neeg siv MySQL thiab tus lej zais hauv cov ntaub ntawv config.py hauv nraub qaum.
Teeb Bluetooth
1: Fais fab Arduino
2: Hom hcitool scan txhawm rau nrhiav mac chaw nyob ntawm koj tus qauv Bluetooth. Thaum pom sau nws lossis luam nws hauv lwm cov ntawv.
3: Tam sim no peb tab tom yuav ntxiv Bluetooth module rau Raspberry Pi. Ua cov lus txib hauv qab no:
sudo bluetoothctl cov
agent rau
khub mac-address (Yog tias nws nug tus pin, tus pin tus qauv yog 1234)
ntseeg mac-chaw nyob
4: Ntxiv koj mac chaw nyob rau app.py cov ntaub ntawv hauv lub backend.
Hais lus teeb
Tam sim no koj tus pi tau hloov kho tshiab thiab peb muaj internet txuas. Peb tuaj yeem pib teeb tsa tus hais lus. 1: Khiav cov lus txib hauv qab no: "curl -sS https://raw.githubusercontent.com/adafruit/Raspbe… | bash"
2: Thaum nws ua tiav nws yuav nug koj kom rov pib dua, nias y thiab nkag mus.
3. Tam sim no khiav tsab ntawv dua, qhov no yuav ua kom lub suab ua haujlwm raug. Yog tias txhua yam yog lawm koj yuav hnov tus poj niam hais lus.
4. Thaum qhov ntawd ua tiav, rov pib dua zaum ob.
Python teeb tsa
Txoj haujlwm txoj cai sau rau ntawm nab hab sej kom ntseeg tau tias koj tau nruab sej 3.7. Txheeb qhov no nrog "python3 -V". Yog tias koj muaj nab hab sej koj tuaj yeem teeb tsa cov pob hauv qab no nrog cov pip installer: pip nruab Flask Flask-Cors Flask-MySQL Flask-SocketIO PyMySQL gevent gevent-websocket python-socketio thov
Kev teeb tsa SmartBox
Tam sim no txhua qhov kev teeb tsa tseem ceeb tau teeb tsa peb tuaj yeem pib nrog kev teeb tsa SmartBox.
1: Clone SmartBox qhov chaw cia rau koj phau ntawv teev npe hauv tsev (/tsev/pi) los ntawm kev ntaus ntawv: git clone
2: Thaum qhov no ua tiav, koj tuaj yeem khiav cov ntaub ntawv sql. Ntaus "sudo mysql -u root -p << SmartBox.sql" los ua lub database.
3: Tom qab ntawd theej cov frontend rau/var/www/html los ntawm kev ua "cp -R frontend/./Var/www/html"
4: Rau qhov pib tsis siv neeg ntxiv cov ntaub ntawv pabcuam rau systemd. Hom: "cp kev pabcuam/SmartBox.service /etc/systemd/system/SmartBox.service" thiab ua "sudo systemctl pab kom myscript.service" pab nws.
5: Thaum ua tiav, mus rau config.py hauv lub backend thiab hloov nws mus rau koj tus lej mysql password.
6: Reboot koj pi
Kauj ruam 4: Arduino Uno Teeb
Tam sim no lub cuab yeej tseem ceeb tau ua tiav, peb yuav pib nrog cov kab ntawv coj. Arduino yuav tswj 5V WS1812B LED sawb rau peb.
1: Rub tawm thiab teeb tsa Arduino IDE:
2: Rub tawm Arduino Code hauv kuv qhov chaw cia khoom github:
3: Yog tias txhua yam raug rub tawm thiab teeb tsa, koj tuaj yeem ntsaws rau hauv koj Arduino Uno.
4: Qhib cov ntawv LedStripCode.ino thiab xa nws mus rau koj Arduino los ntawm txhaj rau tus xub taw tes rau sab xis.
5: Txuas koj lub bluetooth module thiab coj mus rau arduino thiab txhua yam yuav tsum ua haujlwm. (Saib Kauj Ruam 1 Txuas)
Kauj Ruam 5: Case Case
Rau kuv cov ntaub ntawv tsim kuv tau siv lub thawv yas uas twb muaj lawm thiab cov ntaub ntawv raug cai Raspberry Pi. Ntawm sab xub ntiag kuv tau ua qhov sib txawv rau tus hais lus, thiab ib qho rau lub vijtsam LCD.
Ntawm sab nraub qaum kuv tau qhib rau qhov thaiv ntawm qhov ntsuas kub thiab av noo. Kuj tseem muaj qhov qhib rau qhov thaiv ntawm lub khob cij fais fab mov sab hauv.
Nyob rau sab saum toj pom muaj ob lub qhov rau lub ntsuas ultrasonic, yog li txav tau tuaj yeem kuaj pom thaum lub tswb nrov tawm.
Kuv tau teeb tsa Raspberry Pi hauv rooj plaub ntawm sab xis ntawm lub npov, yog li kuv tuaj yeem hloov kho lossis hloov nws yooj yim dua.
Thaum qhov ntawd ua tiav, koj tuaj yeem sib xyaw koj li T-cobbler thiab cov ntsuas. Kuv siv cov ntsia hlau thiab silicone txhawm rau kom ntseeg tau tias txhua yam zoo.
NCO TSEG: Yog tias koj siv cov hlau ntsia hlau txhawm rau txhawm rau Raspberry Pi kom paub tseeb tias koj siv kab xev insulating.
Kauj Ruam 6: Tiav Kov
Tam sim no txhua yam tau ua tiav, koj puas tuaj yeem tshem tus IP ib feem hauv cmdline.txt.
Siv: sudo nano /boot/cmdline.txt
Pom zoo:
Plug & Ua Si CO2 Sensor Zaub Nrog NodeMCU/ESP8266 rau Cov Tsev Kawm Ntawv, Tsev Kawm Qib Siab lossis Koj Lub Tsev: 7 Kauj Ruam
Plug & Ua Si CO2 Sensor Zaub Nrog NodeMCU/ESP8266 rau Cov Tsev Kawm Ntawv, Lub Tsev Kawm Qib Siab lossis Koj Lub Tsev: Kuv yuav qhia koj sai npaum li cas txhim kho lub plug & ua si CO2 sensor qhov twg txhua qhov ntawm txoj haujlwm yuav txuas nrog DuPont xov hlau. Yuav muaj tsuas yog 5 cov ntsiab lus uas yuav tsum tau muab siv, vim tias kuv tsis tau muab tshuaj txhuam ua ntej qhov haujlwm no txhua lub sijhawm
Siv Kev Cia Siab Lub Hauv Paus txuas ntxiv txhawm rau Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Txoj Cai Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: 11 Kauj Ruam
Siv Kev Cia Siab Lub Hauv Paus Txuas Ntxiv kom Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: Lub hom phiaj ntawm cov lus qhia no yog los qhia seb yuav tshawb nrhiav koj tsev neeg tsob ntoo li cas hauv Tsev Neeg Nrhiav rau cov poj koob yawm txwv nrog kev ua haujlwm hauv lub tuam tsev tsis tiav siv Kev Cia Siab lub hauv siab txuas ntxiv. Siv Kev Cia Siab Lub Hauv Paus tuaj yeem ua rau koj qhov kev tshawb nrhiav tsis tiav
Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj): 4 Cov Kauj Ruam
Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj): Kuv lub hom phiaj kawg yog kom muaj kuv lub tsev nyob ntawm kuv lub hnab ris, nws cov hloov pauv, lub ntsuas pa thiab kev nyab xeeb. thiab tom qab ntawd pib ua phooj ywg nws Cov Lus Qhia: Nyob zoo Ich bin zakriya thiab qhov no "Android tsev" yog kuv txoj haujlwm, txoj haujlwm no yog thawj zaug los ntawm plaub qhov kev qhia yav tom ntej, Hauv
Ntse Suab Nkauj hauv Chav Dej thiab Da Dej Nrog Raspberry Pi - Sib Koom Ua Ke Hauv Chav, Tswb, Khawm Tswj thiab Kev Siv Tsev Hauv Tsev: 7 Kauj Ruam
Ntse Suab Nkauj hauv chav pw thiab Da Dej Nrog Raspberry Pi - Sib Koom Ua Ke Hauv Chav, Tswb, Khawm Tswj thiab Kev Siv Tsev Hauv Tsev: Niaj hnub no peb xav muab ob qho piv txwv txog yuav ua li cas koj tuaj yeem siv Raspberry Pi nrog peb Max2Play software rau hauv tsev automation: hauv chav dej thiab chav pw . Ob txoj haujlwm zoo ib yam nyob hauv cov suab paj nruag siab ncaj los ntawm ntau qhov chaw tuaj yeem rub tawm los
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rov Ua Rau Lawv rau 12V.: 3 Cov Kauj Ruam
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rewiring Lawv rau 12V: Kuv txoj kev npaj tau yooj yim. Kuv xav txiav cov phab ntsa uas siv hluav taws xob LED teeb ua ib daim ces rov txuas nws kom khiav tawm 12 volts. Lwm txoj hauv kev yog siv lub zog hloov pauv, tab sis peb txhua tus paub tias lawv tsis muaj txiaj ntsig zoo, puas yog? Txoj cai? Los yog lawv?