Cov txheej txheem:
- Kauj Ruam 1: Pom Kev Nyeem Ntawv
- Kauj ruam 2: Cov ntaub ntawv
- Kauj Ruam 3: Kho lub Raspberry Pi
- Kauj ruam 4: Tsim Nws! Kho vajtse
- Kauj ruam 5: Tsim Nws! Software
- Kauj Ruam 6: Xeem & Nruab
Video: IoT Tus Saib Xyuas Tsiaj!: 6 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Khaws qhov muag saib koj cov menyuam nyiam thiab ua suab paj nruag lossis qhia lawv kom nyob ntsiag to thaum koj tsis nyob! Phau ntawv qhia no yuav qhia siv lub Raspberry Pi lub computer los saib xyuas lub suab nrov hauv koj lub tsev (ntawm Huab) los saib seb thiab thaum twg koj tus tsiaj chim.
Nruas yob … qhov lom zem tshaj plaws: Yog tias nws nrov nrov (zoo li Fido yog tawv lossis ua qee yam rau lwm yam), peb yuav koj tuaj yeem qhia lawv kom nyob ntsiag to lossis ua suab paj nruag!
Nrog rau Pi (thiab cov neeg hais lus), peb yuav siv SparkFun MEMS lub xov tooj cua lub suab tawm suab los ntsuas lub ntim ntim thiab ua rau lub suab tso tawm. Cov ntaub ntawv raug xa mus rau CloudMQTT kev pabcuam siv MQTT kev sib txuas lus raws tu qauv.
Lub Sijhawm Nyeem Ntawv Tag Nrho: ~ 8 feeb
Tag Nrho Cov Sijhawm: 60 feeb (tsawg dua nrog kev paub dhau los)
Ua tsaug ntau rau SparkFun rau kev txhawb nqa txoj haujlwm no! Mus saib qhov kev qhia ntawm no.
Kauj Ruam 1: Pom Kev Nyeem Ntawv
Txhawm rau tsim txoj haujlwm no, koj yuav xav tau teeb tsa kom raug, WiFi txuas nrog Raspberry Pi 3 computer nrog Raspbian OS. Nws kuj tseem pab kom paub qee qhov Python programming nrog rau cov hauv qab no: (1) yuav siv thiab tswj Raspberry Pi GPIO pins li cas; (2) MQTT kev sib txuas lus; thiab (3) analog sensors. Yog tias ib qho ntawm qhov no tsis paub, lossis yog tias koj tsuas yog xav paub (xav paub!), Txheeb tawm cov lus qhia hauv qab no!
Raspberry Pi 3
- Raspberry Pi 3 Starter Kit Hookup Guide
- Raspberry Pi GPIO
- SPI Kev Sib Tham nrog Raspberry Pi
MQTT Kev Sib Txuas Lus
MQTT (Xov Xwm Lus Nug Telemetry Thauj Mus Los) yog qhov nrov IoT kev sib txuas lus raws tu qauv. Peb yuav siv Paho Client Python lub tsev qiv ntawv thiab MQTT cov kev pabcuam hu ua CloudMQTT. Nov yog ntau ntxiv txog MQTT thiab yuav siv nws li cas:
- Tshawb Nrhiav Kev Sib Tham rau IoT
- Pib Pib nrog CloudMQTT
- Txheej txheem cej luam ntawm Dab noj hnub Paho MQTT Python cov neeg siv tsev qiv ntawv
MEMS Microphone Breakout Board
MEMS lub microphone yog lub microphone zoo sib xws, yog li peb yuav xav tau Analog-to-Digital converter ("ADC") los nyeem hauv cov lus sib piv nrog Raspberry Pi digital GPIO pins.
- Pib nrog SparkFun MEMS Microphone Breakout Board
- MEMS Microphone Datasheet
- MCP3002 ADC Cov Ntaub Ntawv
Kauj ruam 2: Cov ntaub ntawv
- Raspberry Pi 3 Qauv B.
Peb tseem yuav xav tau cov khoom siv hauv qab no: Raspberry Pi 3 Case; SD Card (yam tsawg 8 GB); Raspberry Pi 3 GPIO cable; MicroUSB fais fab cable; HDMI cable thiab HDMI-tshaj saib; USB keyboard; USB nas; hais lus nrog 1/8 lub mloog pob ntseg chaw nres nkoj.
- SparkFun MEMS Mic Breakout Board
-MCP3002 (Analog-rau-Digital Converter)
-Breadboard & M-to-M Breadboard Jumper Wires
Kauj Ruam 3: Kho lub Raspberry Pi
Kauj Ruam 1: Txheeb & Txhim Kho Tshiab Txheeb xyuas thiab txhim kho hloov tshiab ib txwm yog txoj hauv kev zoo los pib. Khiav cov lus txib hauv qab no hauv lub qhov rai davhlau ya nyob twg:
sudo apt-tau hloov tshiab
sudo apt-tau hloov tshiab
sudo rov pib dua
Kauj Ruam 2: Teeb SPI Interface rau MEMS Microphone + MCP3002
Txhawm rau siv SPI (Serial Port Interface) nyeem hauv MEMS Microphone ntawm MCP3002, peb yuav xav tau Python Dev Pob:
sudo apt-tau nruab nruab sej-dev
Peb tseem yuav xav tau SPI Interface (tej zaum yuav xav tsim lub subfolder kom txuag tau qhov no hauv):
git clone git: //github.com/doceme/py-spidev
sudo python setup.py nruab
Nov yog SPI-Dev Cov Ntaub Ntawv yog tias koj ua rau muaj teeb meem.
Kauj Ruam 3: Ua Si Suab nrog OMXPlayer
OMXPlayer yog lub suab thiab cov vis dis aus tso ua ntej ntawm Raspbian OS. Nws ua haujlwm nrog ntau hom ntaub ntawv suab, suav nrog:.wav,.mp3, thiab.m4a. Nov yog qhov peb yuav siv los ua suab rov qab thaum Fido nrov nrov. Python lub tsev qiv ntawv los tswj hwm OMXPlayer suav nrog hauv Raspbian (woo!)
Txhawm rau sim OMXPlayer los ntawm lub davhlau ya nyob twg, ntaus cov hauv qab no:
omxplayer /home/…/SongFilePath/SongFileName.mp3
Yog tias qhov ntawd tsis ua haujlwm, sim yuam nws hla lub tshuab tawm suab hauv zos:
omxplayer -o hauv zos /home/…/SongFilePath/SongFileName.mp3
Kauj Ruam 4: teeb tsa CloudMQTT Server
Tam sim no peb teeb tsa MQTT server! Txhawm rau ua qhov no siv CloudMQTT, ua cov hauv qab no:
- Teeb tsa CloudMQTT tus lej nyiaj (phiaj xwm "Cute Cat" yog pub dawb).
- Tsim qhov tshiab MyCloud piv txwv.
- Hauv Console, tsim txoj cai ACL tshiab.
- Koj tuaj yeem saib xyuas cov lus tshaj tawm hauv "Websocket" UI.
Thaum kawg, teeb tsa MQTT Paho Client Python lub tsev qiv ntawv:
pip nruab paho-mqtt
Kauj ruam 4: Tsim Nws! Kho vajtse
Pinout cov duab kos rau Raspberry Pi thiab MCP3002 nyob hauv cov duab saum toj no.
1. Ntxig MCP3002 tus pin rau hauv daim txiag (saib daim duab pinout saum toj no)
MCP3002 siv 4 tus lej SPI rau kev sib txuas lus: Clock Serial ("SCL"), Master Input Slave Output ("MISO"), Master Output Slave Input ("MOSI"), thiab Chip Select ("CS"). Cov pins no sib haum rau Raspberry Pi GPIO tus pin 11 (SCLK), GPIO tus pin 9 (MISO), GPIO Pin 10 (MOSI), thiab GPIO Pin 8 (CE0).
Ua cov kev txuas hauv qab no nrog MCP3002 tus pin:
- Txuas Pin 1 rau Raspberry Pi GPIO Pin 8 (CE0)
- Txuas tus Pin 2 mus rau qhov tso tawm analog ntawm MEMS Microphone breakout board
- Txuas tus Pin 4 rau GND
- Txuas Pin 5 rau Raspberry Pi GPIO Pin 10 (MOSI)
- Txuas Pin 6 rau Raspberry Pi GPIO tus pin 9 (MISO)
- Txuas Pin 7 rau Raspberry Pi GPIO Pin 11 (SCLK)
- Txuas Pin 8 rau Raspberry Pi 3.3V tawm
2. Siv cov xov hlau txuas rau MEMS Microphone breakout board. Txuas mus rau MCP3002 thiab Raspberry Pi
- Txuas Vcc rau Raspberry Pi 3.3V.
- Txuas GND rau Raspberry Pi GND
- Txuas AUD rau MCP3002 Tus Pin 2
3. Txuas txhua lub xov tooj rau Raspberry Pi thiab qhib txhua yam
Kauj ruam 5: Tsim Nws! Software
Peb lub hom phiaj nrog Bark Back yog ob npaug: ua rau muaj suab nrov thaum tus dev yws, thiab xa cov ntaub ntawv mus rau tus neeg rau zaub mov uas peb tuaj yeem tshawb xyuas nws.
Nov yog qhov kev pab cuam Python qhib rau qhov haujlwm no. Ua tsaug rau (thiab thov ua) kho thiab hloov kho cov cai.
Txhawm rau kom tau txais txoj haujlwm thiab ua haujlwm, koj yuav tsum ua ob yam:
- songList: Sau rau hauv kab ntawv thiab npe lub npe rau txhua zaj nkauj uas koj xav ua.
- qhab nia: Qhia koj cov ntaub ntawv CloudMQTT hauv phau ntawv txhais lus no.
Kauj Ruam 1: Nyeem hauv SparkFun MEMS Microphone breakout board
Nyeem nyob rau hauv ADC tus nqi (nruab nrab ntawm 0 thiab 1023) los ntawm MEMS Microphone breakout board (ntawm MCP3002) siv SPI lub tsev qiv ntawv thiab xam lub teeb liab ncov-rau-ncov qhov siab.
Daim ntawv qhia lub teeb liab ncov-mus-ncov qhov siab tshaj plaws rau Chav Ntim. Txoj cai tam sim no qhia txog ADC thaj tsam ntawm 0 thiab 700 (raws li kev sim nrawm) mus rau Chav Ntim nruab nrab ntawm 0 thiab 10. Txhawm rau kho qhov rhiab heev ntawm lub microphone, hloov kho ADC cov khoom siv ntau yam.
Yog xav paub meej ntawm MEMS mic, txheeb xyuas qhov kev qhia no.
Kauj ruam 2: Ua lub suab player
Ua ntej peb yuav xav tau nkauj los ua si! Koj tuaj yeem kaw suab nrawm hauv GarageBand (lossis ntawm koj lub xov tooj ntawm tes) thiab xa lawv mus rau Raspberry Pi. Hauv Python, siv lub tsev qiv ntawv txheej txheem hu rau omxplayer.
Hauv txoj cai, nkag mus rau txoj kab ntawv ntawm cov nkauj uas koj xav rov ua dua hauv * songList * sib txawv (kab 26). Lub ntim ntim tam sim no tau teeb tsa rau 7 hauv lub luag haujlwm tseem ceeb.
Kauj Ruam 3: Xa cov ntaub ntawv mus rau CloudMQTT Server
Siv Paho Client Python lub tsev qiv ntawv los sib tham nrog CloudMQTT servers. Txhawm rau nthuav dav dav: teeb tsa Client server; txhais cov txheej txheem kev sib txuas lus; txuas nrog peb daim ntawv pov thawj (aka creds); thiab sau npe thiab tshaj tawm peb cov ntaub ntawv. Feem ntau qhov no yog ua tiav hauv txoj haujlwm tseem ceeb (kab 129 - 149, thiab kab 169 - 174).
Txhawm rau txheeb xyuas cov ntaub ntawv tau txais, mus rau "Websocket UI" tab hauv CloudMQTT console.
Kauj Ruam 6: Xeem & Nruab
Khiav BarkBack.py program hauv Terminal lossis hauv Python IDE (koj kuj tseem tuaj yeem siv SSH los khiav qhov haujlwm tom qab koj tau tawm mus lawm).
Txheeb xyuas tias koj tau txais qib ntim hauv koj li Websocket UI tab.
Kuaj lub kaw lus los ntawm kev ua rau lub mic (npuaj, qw, tawv, thiab lwm yam) kom ntseeg tau tias cov neeg hais lus ua si hla txhua lub suab.
Thaum txhua yam tau tiav thiab ua tiav, nws tau pom zoo kom muab cov khoom sib txuas rau PCB (Luam Ntawv Circuit Board) yog tias koj npaj siab yuav nruab qhov system ntau dua li ob peb hnub.
Khiav Tawm Hauv Kev Sib Tw Microcontroller 2017
Thawj qhov khoom plig hauv kev sib tw Sensors 2017
Pom zoo:
ARUPI - Tus Nqi Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: 8 Kauj Ruam (nrog Duab)
ARUPI - Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: Cov lus qhia no tau sau los ntawm Anthony Turner. Txoj haujlwm tau tsim los nrog ntau qhov kev pab los ntawm Shed hauv Tsev Kawm Ntawv ntawm Kev Suav, University of Kent (Mr Daniel Knox tau pab zoo!)
WiFi Tsis Siv Neeg Tsob Nroj Tsiaj Pub Nrog Cov Chaw Tso Dej - Sab Hauv Tsev/Sab Nraud Kev Cog Qoob Loo - Cov Nroj Tsuag Dej Tuaj Nrog Kev Saib Xyuas Chaw Nyob: 21 Kauj Ruam
WiFi Tsis Siv Neeg Cog Tsob Nroj Tsiaj Nrog Cov Chaw Tso Dej - Sab Hauv Tsev/Sab Nraud Kev Cog Qoob Loo - Cov Nroj Tsuag Dej Tuaj Nrog Kev Saib Xyuas Tej Zaum: Hauv qhov kev qhia no peb yuav nthuav qhia yuav ua li cas teeb tsa kev cai nyob sab hauv tsev/sab nraum zoov cog cog cog uas tuaj yeem tso dej nroj tsuag thiab tuaj yeem saib xyuas nyob deb ntawm kev siv Adosia platform
Kev Saib Xyuas Tus Kheej Ntiag Tug Hacked Los Ntawm Cov Laus LCD Saib: 7 Kauj Ruam (nrog Duab)
Kev Saib Xyuas Tus Kheej Ntiag Tug Los Ntawm Lub Luag Qub LCD: Thaum kawg koj tuaj yeem ua qee yam nrog lub qub LCD saib uas koj muaj hauv lub nkas -las. Koj tuaj yeem tig nws mus ua tus saib xyuas ntiag tug! Nws zoo nkaus li dawb rau txhua tus neeg tshwj tsis yog koj, vim tias koj hnav "khawv koob" tsom iav! Txhua yam koj yuav tsum muaj yog pa
Txhim Kho Tus Saib Xyuas Nrog Tus Ua Mov ci: AKA Tsis Txhob Muab Nws Tawm!: 5 Kauj Ruam (nrog Duab)
Txhim Kho Tus Saib Xyuas Nrog Tus Ua Mov ci: AKA Tsis Txhob Muab Nws Tawm!: Hauv zos hauv Victoria, BC peb muaj tus txiv leej tub uas tau muab pov tseg tab sis siv tau cov cuab yeej IT thiab xa rov qab rau zej zog dawb. Nws lub dag zog tau siv cov khoom siv hluav taws xob tawm ntawm qhov chaw pov tseg thiab pab tib neeg uas yog qhov zoo heev. Kuv khaws ib
Kev Kawm Lub Plawv Tus Kheej Saib Xyuas Zaum Saib: 19 Cov Kauj Ruam (nrog Duab)
Kev cob qhia Lub Plawv Tus Kheej Saib Xyuas Zaum Saib: Tsev Kawm Qib Siab yog lub sijhawm nyuaj thiab ntxhov siab hauv ib tus neeg lub neej, yog vim li ntawd nws thiaj tseem ceeb heev kom koj qhov kev nyuaj siab nyob qis. Ib txoj hauv kev peb nyiam ua qhov no yog los ntawm kev ua haujlwm, nws pab ua kom koj lub siab meej thiab lub cev zoo. Tias yog vim li cas peb tsim lub portabl