Cov txheej txheem:
- Kauj Ruam 1: Cov Khoom Siv
- Kauj ruam 2: Ua Circuit Court
- Kauj Ruam 3: Tsim Database
- Kauj Ruam 4: Sau Cov Ntaub Ntawv Sensor mus rau Database
- Kauj Ruam 5: Qhia Koj Tus IP ntawm Zaub
- Kauj Ruam 6: Ntsuas Cov Ntsuas Hluav Taws Xob Txhua 10 feeb
- Kauj Ruam 7: Ua Lub Vev Xaib
- Kauj Ruam 8: Tsim Qhov Back-end
- Kauj Ruam 9: Tsim Lub Hauv Paus-kawg
- Kauj Ruam 10: Ua Lub Tsev Cog Khoom
- Kauj Ruam 11: Muab Txhua Yam Ua Ke
Video: Mini-Serre: 11 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Raws li tub ntxhais kawm, Kuv muaj tus cwj pwm tsis zoo ntawm kev hnov qab yam khoom. Vim li ntawd, yog tias kuv xav cog qee hom cog, kuv ib txwm tsis nco qab txog nws thiab nws tuag vim tsis muaj leej twg saib xyuas nws.
Kuv yuav sim kho qhov teeb meem no nrog Mini-Serre. Mini-Serre yog lub tshuab ua haujlwm saib xyuas lub vaj uas xa cov ntaub ntawv ntawm ntau hom kev ntsuas uas tau teeb tsa rau lub vev xaib uas khiav ntawm Raspberry Pi. Txoj hauv kev no tus neeg siv tuaj yeem tshuaj xyuas lawv cov nroj tsuag ntawm lub vev xaib tsis hais lawv nyob qhov twg. Lub tswv yim no tau tsim los ua qhov phiaj xwm zaum kawg hauv thawj xyoo ntawm kev siv xov tooj cua thiab kev sib txuas lus, ntawm Howest Kortrijk, Belgium.
Kauj Ruam 1: Cov Khoom Siv
Txhawm rau tsim txoj haujlwm no, koj yuav xav tau cov khoom hauv qab no:
Electronics
- Raspberry pi 3 - cov khoom siv
- Cov qhob cij
- Txiv neej-rau-txiv neej txuas
- Txiv neej-rau-poj niam txuas
- Dallas 18B20 (ntsuas kub)
- Photoresistor Kev Tshawb Fawb Photosensitive Teeb Sensor
- YWB 3008
- Potentiometer
- LCD-zaub
- Resistors
- Xiav LED
- RGB LED
Casing:
13. Central Park kweekkas (https://www.brico.be/nl/tuin-buitenleven/moestuin/…) 14. Ntoo phaj (hauv qab ntawm rooj plaub) 15. Nails 16. Screws
Cov Cuab Yeej:
17. Rauj 18. Pom 19. Ntsia Hlau 20. Laum
Kauj ruam 2: Ua Circuit Court
Hauv kauj ruam 2 peb yuav ua qhov Circuit Court rau txoj haujlwm no. Qhov no yog qhov tsawg kawg nkaus uas koj xav tau yog tias koj xav kom nws ua haujlwm. Siv lub fritzing lub rooj thiab daim duab los ua daim qauv ntawm daim phiaj. Nov yog qhov uas koj xav tau tag nrho cov khoom siv hluav taws xob los ntawm theem 1.
Cov ntaub ntawv hais txog lub Circuit Court:
Peb muaj 2 lub cim txuas nrog MCP3008 uas yog lub teeb pom kev zoo thiab cov av noo noo. Qhov ntsuas kub muaj qhov tso tawm digital thiab siv GPIO-pin ntawm Raspberry Pi.
Ntxiv:
Kuv kuj tau siv LCD-zaub uas yuav ua rau nws yooj yim dua tom qab los txuas rau Raspberry Pi yam tsis tas yuav tsum txuas rau koj lub khoos phis tawj. Qhov no tsis tsim nyog tab sis nws tau pom zoo heev.
Kauj Ruam 3: Tsim Database
Nws yog ib qho tseem ceeb heev los khaws koj cov ntaub ntawv los ntawm cov ntsuas hauv kev teeb tsa tab sis kuj tseem muaj kev nyab xeeb. Qhov no yog vim li cas kuv thiaj txiav txim siab khaws kuv cov ntaub ntawv hauv chaw khaws ntaub ntawv. Txoj kev no tsuas yog kuv tuaj yeem nkag mus rau cov ntaub ntawv no (nrog tus as khauj tus kheej) thiab khaws nws kom zoo. Hauv daim duab saum toj no koj tuaj yeem pom kuv cov phiaj xwm los ntawm kuv cov ntaub ntawv khaws tseg thiab hauv qab cov ntaub ntawv xa tawm cov ntaub ntawv mus rau qhov program database, piv txwv li MySQL.
Database-programIt yog qhov tseem ceeb uas peb cov ntaub ntawv tuaj yeem ua haujlwm ntawm nws tus kheej los ntawm peb Raspberry Pi. Koj tuaj yeem ua qhov no los ntawm rub tawm MySQL lossis MariaDB rau Raspberry Pi. Koj xub xav ua lub hauv paus ntawm koj lub computer hauv MySQL Workbench. Tom ntej no koj xa cov ntaub ntawv no raws li tus kheej muaj cov ntaub ntawv. Tam sim no txuas rau koj li Raspberry Pi lub database ntawm MySQL Workbench thiab rov kho cov ntaub ntawv khaws cia ntawm no. Tam sim no koj muaj cov ntaub ntawv khaws cia ntawm koj li Raspberry Pi!
Kauj Ruam 4: Sau Cov Ntaub Ntawv Sensor mus rau Database
Tom qab cov chaw khaws ntaub ntawv tau khiav ntawm koj li Raspberry Pi peb xav kom peb lub ntsuas cua tuaj yeem khaws lawv cov ntaub ntawv hauv nws. Peb tuaj yeem ua qhov no los ntawm kev tsim 3 cov ntawv cais (uas tau ua hauv PyCharm). Ib qho zoo uas muaj nyob hauv PyCharm yog tias koj tuaj yeem txuas rau koj Pi thiab txoj hauv kev no koj tuaj yeem nkag mus rau koj lub database thiab sau ncaj qha rau nws. Cov ntaub ntawv kuj tseem tau nyeem ncaj qha los ntawm Raspberry Pi thiab LED's yuav ci ntsa iab raws li qhov koj xav tau.
Blue LED teeb tsa: Cov av tsis ntub txaus. RGB LED teeb ntsuab: txhua yam yog qhov zoo. RGB LED teeb liab: nws kub dhau, qhib lub ru tsev kom txias nws me ntsis. RGB LED teeb ci xiav: nws txias heev, kaw lub ru tsev yog nws qhib.
Koj tuaj yeem rub tawm txhua cov ntawv sau los ntawm kuv qhov chaw cia khoom github:
Nco tseg: Kuv siv kuv tus kheej cov ntaub ntawv nkag mus rau cov chaw khaws ntaub ntawv yog li koj yuav tau hloov nws kom haum rau koj li.
Nco tseg: Daim nplaub tshev DB1 muaj chav kawm 'database' uas tau nkag rau hauv cov cai uas yuav txuas rau koj lub database.
Kauj Ruam 5: Qhia Koj Tus IP ntawm Zaub
Cov zaub qhia pom IP-chaw nyob uas koj Raspberry Pi tab tom khiav, txoj hauv kev no koj tuaj yeem txuas tau yooj yim yam tsis muaj xov hlau rau koj Raspberry Pi. Kuv kuj tau sau ib tsab ntawv rau qhov no uas nyeem IP ntawm koj tus pi thiab qhia nws ntawm cov zaub (nco ntsoov tias koj GPIO-pins sib xws tsis li nws yuav tsis ua haujlwm). Raspberry Pi sau cov ntawv no cia li pib. Koj tuaj yeem ua qhov no los ntawm kev ntxiv qee qhov chaws rau rc.local cov ntaub ntawv ntawm koj li Raspberry Pi. Koj tuaj yeem mus txog ntawd los ntawm kev ntaus 'sudo nano /etc/rc.local', ua ntej kab kawg ntawm kab ntawv koj xav ntxiv 'Python3.5/home/user/filelocation &'.
Koj tuaj yeem pom cov ntawv ntawm no:
Nco tseg: qhov '&' thaum kawg, qhov no yuav ua rau cov ntawv sau ib zaug thiab nres tam sim ntawd kom lwm cov ntawv tuaj yeem ua haujlwm ib yam nkaus.
Kauj Ruam 6: Ntsuas Cov Ntsuas Hluav Taws Xob Txhua 10 feeb
Peb tsis xav kom peb cov ntaub ntawv khaws tseg los ntawm cov ntaub ntawv sensordata puas tau 0.001seconds, txwv tsis pub qhov no yuav ua rau nws nyuaj rau cov ntaub ntawv khaws cia nrog txhua cov ntaub ntawv nkag los thiab nws yuav tsoo. Qhov no yog vim li cas kuv thiaj ntxiv qhov scrapt rau 'crontab' ntawm Raspberry Pi. Crontab yog ib txoj haujlwm uas taug qab cov haujlwm uas tau teem tseg yog li txoj hauv kev no koj tuaj yeem yooj yim khiav cov ntawv txhua 10 feeb ib zaug.
Yuav teeb nws li cas:
Koj tuaj yeem teeb tsa qhov no los ntawm kev ntaus thawj hauv Raspberry Pi kab hais kom ua 'crontab -e', qhov no qhib tus kws kho mob rau crontab. Xaub mus rau hauv qab ntawm cov ntawv thiab ntxiv 3 kab, ib qho rau txhua qhov ntsuas.
' */10 * * * * python3.5/tsev/neeg siv/filepath/sensor1'
Nco tseg: Tus '*/10' yog 10 feeb uas peb xav kom nyob nruab nrab ntawm txhua qhov kev ntsuas. Cov cai kuv tau ntaus tom qab nws yog tus nab npawb version koj tab tom khiav thiab cov ntaub ntawv koj xav khiav yog li koj yuav tsum sau ib kab rau txhua qhov ntsuas vim tias lawv muaj nyob ntawm 3 cov ntaub ntawv sib txawv.
Kauj Ruam 7: Ua Lub Vev Xaib
Kuv ua kuv lub vev xaib hauv qhov program hu ua Atom. Nws yog qhov yooj yim heev rau siv txoj haujlwm thiab tawm tswv yim yog tias koj zoo nkauj tshiab los sau HTML thiab CSS zoo li kuv.
Koj tuaj yeem pom txhua tus lej thiab cov duab siv hauv qab no txuas:
Kuv tau ua ntej-kawg ntawm lub vev xaib hauv Visual Studio Code yog li yog tias koj tsis npaj rau kev ua HTML & CSS koj tus kheej koj tuaj yeem tsuas yog ntxiv cov ntawv rau hauv daim nplaub tshev tshiab hauv Visual Studio Code tsis yog Atom.
Kauj Ruam 8: Tsim Qhov Back-end
Sab nraub qaum thiab pem hauv ntej-kawg yuav yog yam uas ua rau muaj qee yam tshwm sim ntawm lub vev xaib peb nyuam qhuav ua. Hauv qab-kawg peb txuas rau peb cov database ib zaug ntxiv thiab tsis txhob muab cov ntaub ntawv tso rau hauv lub database. Tam sim no peb yuav nyeem tag nrho cov ntaub ntawv los ntawm cov ntsuas sib txawv thiab siv Socket. IO peb yuav xa nws mus rau peb lub hauv ntej-kawg kom peb tuaj yeem nthuav tawm nws ntawm lub vev xaib.
Koj tuaj yeem pom cov cai rau sab nraub qaum ntawm no:
Nco tseg: Peb siv chav kawm database peb siv ua ntej ua ntej yog li kuv tsis suav nrog qhov no hauv qhov chaw cia khoom no.
Kauj Ruam 9: Tsim Lub Hauv Paus-kawg
Pem hauv ntej-kawg yog qhov uas peb ua ke peb cov HTML & CSS code ua ke nrog JavaScript thiab peb Back-end. JavaScript uas kuv tau sau sim ua kom muaj kev sib txuas nrog rov qab kawg uas yuav tsum tau khiav. Tam sim no Back-end yuav xa tag nrho peb cov ntaub ntawv los ntawm cov ntsuas thiab peb tuaj yeem ua ob peb lub luag haujlwm hauv JavaScript uas kho cov ntawv HTML yog li nws haum rau peb qhov txiaj ntsig tam sim no.
JavaScript tuaj yeem pom ntawm no:
Nco tseg: nco ntsoov tias koj txuas hauv koj li HTML rau daim nplaub tshev raug ntawm qhov chaw ntawm koj li JavaScript tsis li nws yuav tsis ua haujlwm.
Kauj Ruam 10: Ua Lub Tsev Cog Khoom
Kuv yuav pob ua ntej los ntawm Brico:
Tsuas yog ua raws cov theem uas tuaj nrog pob. Tom qab qhov no ua tiav peb tsis tau npaj txhij tso peb Raspberry Pi nyob rau ntawd. Ua ntej peb yuav tsum tau ua 'hauv pem teb' lossis hauv qab rau lub Tsev Cog Khoom, koj tuaj yeem ua qhov no los ntawm kev siv lub phaj ntoo thiab ntsuas seb nws loj npaum li cas los ua kom haum. Kuv xub ua tus ncej ntoo kom cov phaj ntoo muaj ib yam dab tsi los so.
Kauj Ruam 11: Muab Txhua Yam Ua Ke
Peb yuav luag npaj txhij! Tsuas yog ib qib kawg no thiab koj npaj mus. Nqa Raspberry Pi thiab lub tsev cog khoom, ua ob peb qhov kom koj tuaj yeem tso lub LED hla nws, ua lub qhov rau cov zaub thiab lub qhov rau Raspberry Pi lub zog muab khoom. Muab txhua yam hauv lub tsev cog khoom, ntsaws rau Pi thiab koj tau teeb tsa! Koj tau txais koj tus kheej lub tsev cog khoom!
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
Tsev Automation Kauj Ruam ntawm Kauj Ruam Siv Wemos D1 Mini Nrog PCB Tsim: 4 Kauj Ruam
Tsev Automation Kauj Ruam Ib Leeg Siv Wemos D1 Mini Nrog PCB Tsim: Tsev Automation Kauj Ruam los ntawm Kauj Ruam siv Wemos D1 Mini nrog PCB Tsim cov tub ntxhais kawm ntawv qib siab. Tom qab ntawd ib tus ntawm peb cov tswv cuab tuaj
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
Kawm Yuav Ua Li Cas Kos Tus Tswm Ciab - Kauj Ruam Ib Kauj Ruam: 6 Kauj Ruam
Kawm Yuav Ua Li Cas Thiaj Li Tswmciab - Kauj Ruam Ib kauj ruam: Cov tswm ciab no siv sijhawm 10 feeb los kos yog tias koj ua raws kuv cov kauj ruam ua tib zoo
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: 9 Kauj Ruam
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: Cov ntawv qhia no yog qhia koj yuav tsim lub Caj Npab Caj Npab ntawm koj tus kheej li cas