Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Npaj Kho Vajtse
- Kauj Ruam 2: Txhim Kho Cloud4RPi
- Kauj ruam 3: Txuas lub Sensor
- Kauj Ruam 4: Xa Kev Nyeem Sensor mus rau Huab
- Kauj Ruam 5: Kab kos thiab Tswb
Video: Vaum hauv Huab: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Lub caij ntuj sov los txog, thiab cov uas tsis muaj lub tshuab cua txias yuav tsum tau npaj los tswj huab cua sab hauv tsev. Hauv kab ntawv no, Kuv tab tom piav qhia txoj hauv kev niaj hnub los ntsuas qhov ntsuas tseem ceeb tshaj plaws rau tib neeg kev nplij siab: kub thiab av noo. Cov ntaub ntawv sau no raug xa mus rau huab thiab ua tiav nyob ntawd.
Khoom siv
Kuv tab tom siv Raspberry Pi board thiab DHT22 sensor. Koj tuaj yeem ua tib yam ntawm txhua lub khoos phis tawj uas muaj Internet, GPIO, thiab Python. Qhov pheej yig dua DHT11 sensor kuj ua haujlwm tau zoo.
Kauj Ruam 1: Npaj Kho Vajtse
Cia peb pib los ntawm qhov pib, vim tias kuv tsis tau siv kuv li Raspberry Pi ntev heev.
Peb yuav xav tau:
- Raspberry Pi board (lossis lwm IoT-taw qhia platform).
- SD lossis microSD daim npav (nyob ntawm lub platform).
- 5V/1A ntawm micro-USB. LAN cable, uas muab Internet txuas.
- HDMI zaub, RCA zaub, lossis UART chaw nres nkoj (kom qhib SSH).
Thawj kauj ruam yog rub Raspbian. Kuv tau xaiv Lite version, raws li kuv yuav siv SSH hloov chaw ntawm cov zaub.
Tej yam tau hloov pauv txij li lub sijhawm dhau los kuv tau ua: tam sim no muaj qhov zoo kawg nkaus hlawv software hu ua Etcher, uas ua haujlwm zoo kawg nkaus, thiab muaj kev tsim qauv zoo nkauj.
Tom qab cov duab hlawv tau ua tiav, Kuv tso daim npav SD rau hauv kuv tus Pi, ntsaws LAN thiab txuas hluav taws xob rau hauv, thiab tom qab ib ntus, kuv lub router sau npe lub cuab yeej tshiab.
Zoo kawg! Cia peb mus thiab SSH rau hauv nws.
Kev nyab xeeb tsis ua haujlwm, Kuv nyiam nws, tab sis qhov no ua rau qee yam nyuaj dua. Kuv yuav siv UART-USB adapter txhawm rau nkag mus rau lub plhaub thiab pab SSH…
Siv cov zaub tsis siv UART ua rau nws yooj yim dua.
Tom qab rov pib dua, Kuv kawg hauv.
Thawj yam ua ntej, cia hloov tshiab:
sudo apt hloov tshiab && sudo apt hloov tshiab -y
Tam sim no cia peb txuas cov cuab yeej tshiab no mus rau Huab.
Kauj Ruam 2: Txhim Kho Cloud4RPi
Kuv txiav txim siab sim huab huab hu ua Cloud4RPi, uas yog tsim los rau IoT.
Raws li cov ntaub ntawv, peb xav tau cov pob hauv qab no kom nws ua haujlwm:
sudo apt nruab git python3 python3 -pip -y
Cov tsev qiv ntawv cov neeg siv khoom tuaj yeem teeb tsa hauv ib qho lus txib:
sudo pip3 nruab cloud4rpi
Tam sim no peb xav tau qee qhov qauv piv txwv.
git clone https://github.com/cloud4rpi/cloud4rpi-raspberrypi-python && cd cloud4rpi-raspberrypi-python
Tsab ntawv ua tiav yog control.py.
Peb xav tau tus cim, uas tso cai Cloud4RPi txuas cov cuab yeej nrog tus as khauj. Txhawm rau kom tau ib qho, tsim ib tus as khauj ntawm cloud4rpi.io thiab ntaus tus Ntaus Tshiab khawm ntawm nplooj ntawv no. Hloov _YOUR_DEVICE_TOKEN_ txoj hlua hauv cov ntawv tswj.py nrog koj lub cuab yeej lub cim thiab khaws cov ntawv. Tam sim no peb tau npaj rau thawj qhov kev tshaj tawm.
sudo python3 control.py
Qhib lub cuab yeej nplooj ntawv thiab tshawb xyuas tias cov ntaub ntawv nyob ntawd.
Tam sim no cia peb txav mus rau cov ntaub ntawv ntawm lub ntiaj teb tiag.
Kauj ruam 3: Txuas lub Sensor
Peb yuav xav tau:
- DHT22 lossis DHT11 humidity sensor
- Rub-up resistor (5-10 KΩ)
- Cov xov hlau
DHT22 sensor ntsuas kub thiab av noo ib txhij. Cov txheej txheem kev sib txuas lus tsis yog tus qauv, yog li peb tsis tas yuav ua kom nws nyob hauv raspi -teeb tsa - tus lej GPIO yooj yim ntau dua li txaus.
Txhawm rau kom tau txais cov ntaub ntawv, Kuv yuav siv Adafruit lub tsev qiv ntawv zoo rau DHT sensors, tab sis nws yuav tsis ua haujlwm zoo li qub. Kuv ib zaug pom qhov txawv txav tsis tu ncua hauv cov cai, uas tsis ua haujlwm rau kuv kho vajtse, thiab tom qab ob xyoos kuv qhov kev thov rub tawm tseem tseem tos. Kuv kuj tseem tau hloov pauv lub rooj saib xyuas qhov ruaj khov vim tias kuv Raspberry Pi 1 nrog BCM2835 tau ceeb pom tias yog Raspberry Pi 3. Kuv xav tias nws muaj tseeb… Yog li, kuv pom zoo siv kuv rab diav rawg. Yog tias koj ntsib teeb meem nrog nws, thov sim thawj qhov chaw cia khoom, tej zaum nws ua haujlwm rau qee leej, tab sis kuv tsis yog ib tus ntawm lawv.
git clone https://github.com/Himura2la/Adafruit_Python_DHT.gitcd Adafruit_Python_DHT
Raws li lub tsev qiv ntawv tau sau hauv C, nws yuav tsum tau muab tso ua ke, yog li koj xav tau cov pob tsim-qhov tseem ceeb thiab sej-dev.
sudo apt install build-essential python-dev -ysudo python setup.py nruab
Thaum cov pob tau teeb tsa, txuas DHT22 raws li qhia hauv daim duab.
Thiab sim nws:
cd ~ nab hab sej -c "ntshuam Adafruit_DHT li d; luam d.read_retry (d. DHT22, 4)"
Yog tias koj pom qee yam zoo li (39.20000076293945, 22.600000381469727), koj yuav tsum paub tias qhov no yog cov av noo hauv feem pua thiab kub hauv Celsius.
Tam sim no, cia txhua yam ua ke!
Kauj Ruam 4: Xa Kev Nyeem Sensor mus rau Huab
Kuv yuav siv tus tswj.py ua lub hauv paus thiab ntxiv DHT22 kev cuam tshuam rau hauv nws.
cp cloud4rpi-raspberrypi-python/control.py./cloud_dht22.pycp cloud4rpi-raspberrypi-python/rpi.py./rpi.pyvi cloud_dht22.py
Tshem cov qauv piv txwv zoo li hauv daim duab saum toj no.
Raws li DHT22 rov qab ob qho tib si kub thiab av noo hauv kev hu ib zaug, Kuv yuav khaws lawv thoob ntiaj teb thiab hloov kho ib zaug hauv qhov kev thov, xav tias ncua sijhawm ntawm lawv ntau dua 10 vib nas this. Xav txog cov cai hauv qab no, uas tau txais DHT22 cov ntaub ntawv:
ntshuam Adafruit_DHT
temp, hum = Tsis muaj, Tsis muaj
last_update = time.time () - 20
def hloov tshiab_data ():
ntiaj teb kawg_update, hum, temp yog time.time () - last_update> 10: hum, temp = Adafruit_DHT.read_retry (Adafruit_DHT. DHT22, 4) last_update = time.time ()
def tau_t ():
update_data () rov qab puag ncig (temp, 2) yog tias temp tsis yog Tsis muaj Ib qho ntxiv Tsis muaj def get_h (): hloov tshiab_data () rov qab puag ncig (hum, 2) yog hum tsis yog Tsis muaj Lwm yam Tsis muaj
Ntxig cov cai no tom qab cov khoom siv uas twb muaj lawm thiab hloov kho qhov hloov pauv kom nws siv cov haujlwm tshiab:
variables = {'DHT22 Temp': {'type': 'numeric', 'bind': get_t}, 'DHT22 Humidity': {'type': 'numeric', 'bind': get_h}, 'CPU Temp': {'hom': 'lej', 'khi': cpu_temp}}
Yog tias koj pom tias kev ua haujlwm tsis meej pem, rub qhov kawg ntawm cov ntaub ntawv no.
Tom qab ntawd koj tuaj yeem tshawb xyuas nplooj ntawv ntaus ntawv.
python3 cloud_dht22.py
Tom qab ntawd koj tuaj yeem tshawb xyuas nplooj ntawv ntaus ntawv.
Koj tuaj yeem tso nws zoo li yog, tab sis kuv nyiam muaj kev pabcuam rau txhua yam. Qhov no ua kom ntseeg tau tias tsab ntawv yeej ib txwm ua haujlwm. Tsim kev pabcuam nrog cov ntawv sau tsis siv neeg uas koj twb muaj hauv cloud4rpi-raspberrypi-python directory:
service_install.sh cloud_dht22.py
Pib qhov kev pabcuam:
sudo kev pabcuam cloud4rpi pib
Thiab xyuas nws:
pi@raspberrypi: ~ $ sudo service cloud4rpi status -l ● cloud4rpi.service -Cloud4RPi daemon Loaded: loaded (/lib/systemd/system/cloud4rpi.service; enabled) Active: nquag (khiav) txij hnub Wednesday 2017-05-17 20: 22: 48 UTC; 1 feeb dhau los Lub ntsiab PID: 560 (nab nab) CGroup: /system.slice/cloud4rpi.service └─560/usr/bin/python /home/pi/cloud_dht22.py
Tej zaum 17 20:22:51 raspberrypi nab nab [560]: Tshaj tawm iot-hub/lus: {'hom': 'teeb tsa', 'ts': '2017-05-17T20… y'}]}
Tej zaum 17 20:22:53 raspberrypi nab nab [560]: Tshaj tawm iot-hub/lus: {'hom': 'cov ntaub ntawv', 'ts': '2017-05-17T20: 2… 40'}} Tsib Hlis 17 20: 22:53 raspberrypi nab nab [560]: Tshaj tawm iot-hub/lus: {'hom': 'system', 'ts': '2017-05-17T20….4'}}
Yog tias txhua yam ua haujlwm raws li qhov xav tau, peb tuaj yeem mus txuas ntxiv thiab siv Cloud4RPi lub peev xwm los tswj hwm nrog cov ntaub ntawv.
Kauj Ruam 5: Kab kos thiab Tswb
Ua ntej tshaj plaws, cia cov phiaj xwm sib txawv los saib seb lawv hloov pauv li cas. Qhov no tuaj yeem ua tiav los ntawm kev ntxiv Cov Tswj Vaj Huam Sib Luag tshiab thiab tso cov kab ntawv xav tau hauv nws.
Lwm qhov uas peb tuaj yeem ua ntawm no yog teeb tsa Kev Ceeb Toom. Cov yam ntxwv no ua rau koj teeb tsa thaj tsam nyab xeeb rau qhov sib txawv. Sai li qhov ntau tau hla dhau, nws xa email ceeb toom. Ntawm Tswj Vaj Huam Sib Luag kho nplooj ntawv, koj tuaj yeem hloov mus rau Alerts thiab teeb tsa ib qho.
Txoj cai tom qab ntawd, cov av noo hauv kuv chav pib poob sai yam tsis muaj laj thawj pom, thiab lub tswb nrov tom qab ntawd.
Koj tuaj yeem siv Cloud4RPi dawb nrog txhua yam khoom siv uas muaj peev xwm ua rau Python. As rau kuv, tam sim no kuv ib txwm paub thaum twg yuav tsum qhib lub tshuab cua txias, thiab kuv tseem tuaj yeem txuas nws mus rau kev xa tawm rau kev tswj chaw taws teeb ntawm Cloud4RPi. Kuv npaj rau qhov sov! Txais tos, Lub caij ntuj sov!
Nrog Cloud4RPi, koj tuaj yeem tswj hwm koj li Raspberry Pi thiab lwm yam khoom siv IoT nyob deb ntawm lub sijhawm. Mus ntsib peb lub xaib thiab txuas cov cuab yeej txwv tsis pub dawb.
Pom zoo:
Raspberry PI Kev ntsuas kub thiab vaum, Chaw Huab Cua Huab Cua, Wifi thiab Xov Tooj Txawb: 6 Kauj Ruam
Raspberry PI Kev ntsuas kub thiab vaum, Chaw Huab Cua Huab Cua, Wifi thiab Xov Tooj Txawb: Nrog Raspberry PI cov cuab yeej koj tuaj yeem teev cov ntsuas kub thiab cov av noo sab nraum, hauv chav, tsev cog khoom, lab, chav txias lossis lwm qhov chaw dawb kiag li. Qhov piv txwv no peb yuav siv los ntsuas qhov kub thiab txias. Cov cuab yeej yuav txuas nrog internet v
Huab Cua Huab Cua Huab Cua: 11 Kauj Ruam (nrog Duab)
Huab Cua Huab Cua Huab Cua: Txoj haujlwm no ua rau huab cua huab siv Raspberry Pi Zero W. Nws txuas rau Yahoo Huab Cua API thiab nyob ntawm qhov kev kwv yees rau hnub tom ntej hloov xim. Kuv tau tshoov siab los ntawm Wisconsin Gas Building uas muaj nplaim taws ntawm lub ru tsev uas hloov pauv
HRV (Lub Tsev Huab Cua Hloov Chaw) Arduino Tus Tswj Nrog Huab Cua Huab Cua: 7 Cov Kauj Ruam (nrog Duab)
HRV (Lub Tsev Huab Cua Hloov Chaw) Arduino Tus Tswj Nrog Air Economizer: HRV Arduino Tus Tswj Nrog Air Economizer Yog li kuv keeb kwm nrog txoj haujlwm no yog kuv nyob hauv Minnesota thiab kuv lub rooj tsav xwm hluav taws xob kib ntawm kuv LifeBreath 155Max HRV. Kuv tsis xav them $ 200 rau qhov tshiab Kuv ib txwm xav tau qee yam nrog kev lag luam huab cua kev ua txhaum
IoT Ua Yooj Yim: Txheeb Xyuas Cov Ntaub Ntawv Huab Cua Tej Zaum: UV thiab Huab Cua Kub & Vaum: 7 Kauj Ruam
IoT Ua Yooj Yim: Txheeb Xyuas Cov Ntaub Ntawv Huab Cua Nyob deb: UV thiab Huab Cua Kub & Vaum: Ntawm qhov kev qhia no, peb yuav ntes cov ntaub ntawv nyob deb li UV (Ultra-Violet hluav taws xob), huab cua kub thiab av noo. Cov ntaub ntawv no yuav yog ib qho tseem ceeb heev thiab yuav siv rau yav tom ntej Chaw Ua Haujlwm Huab Cua.Qhov thaiv daim duab qhia tau tias peb yuav tau txais dab tsi thaum kawg
Ua Huab Cua Huab Cua Hauv Qab 10 feeb: 3 Kauj Ruam
Ua Huab Cua Huab Cua Hauv 10 feeb: Hauv cov lus qhia no, peb yuav kawm paub yuav tsim huab cua huab cua li cas li 10 feeb. Nov yog txoj hauv kev yooj yim tshaj plaws kom sai sai pib nrog iot project. Txhua yam koj xav tau yog ib qho Slabs-32 board. Yog lawm yog lawm tsuas yog ib lub rooj tsav xwm txhim kho t