Cov txheej txheem:
- Kauj Ruam 1: Tus Tshiab Innards of the Lamp - Partlist
- Kauj Ruam 2: Kev Txuas Hluav Taws Xob
- Kauj Ruam 3: Qhov Nyuaj - Sib Sau Cov Khoom
- Kauj Ruam 4: Cov Khoom Muag - Firmware Muaj nyob ntawm Github
- Kauj Ruam 5: Lub Firmware - Yuav Siv Li Cas MQTT Kev Sib Txuas
Video: PhotonLamp - WS2812b Nruab Tus Tsim Teeb nrog MQTT Tswj: 5 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Ntau xyoo dhau los peb tau yuav lub teeb tsim qauv uas muaj lub teeb pom kev zoo li cov luam yeeb thiab tau ua los ntawm cov kua mis. Peb nyiam qhov tsim tshwj xeeb ntawm qhov ntxoov ntxoo thiab qhov pom ntawm lub teeb. Tab sis kuv tsis tau txaus siab tiag tiag nrog lub teeb uas los ntawm tsib tus qauv me me qhov muag teeb. Txij li qhov ntxoov ntxoo muaj lub vojvoog me me, koj tsis tau txais lub teeb pom kev tsis tu ncua tab sis koj tuaj yeem pom tib lub qhov muag teev los ntawm qhov ntxoov ntxoo. Thaum kuv dawm hla WS2812b LED kab txaij ib lub tswv yim tau yug: Kuv xav hloov/hloov dua tshiab lub teeb thiab hloov cov qauv teeb pom kev zoo los ntawm RGB LEDs. Tsis txhob hais tias lub teeb "tshiab" yuav tsum tswj tau los ntawm Wifi kom tau txais WAF siab dua 8-).
Kauj Ruam 1: Tus Tshiab Innards of the Lamp - Partlist
Txij li thaum kuv twb tau ua qee qhov haujlwm nrog Particle Photons (https://particle.io) kuv xaiv qhov no zoo li tus tswj hwm zoo raws li lub hauv paus ntawm kuv txoj haujlwm. Cov ntsiab lus kuv xav tau cov cuab yeej no los tsim kuv lub teeb hloov pauv:
- 1x 90cm yeeb nkab nrog M6 metric xov ntawm ib kawg
- 1 x Particle Photon
- 1x HC-SR04 ultrasonic sensor (rau qhov tshwj xeeb twist)
- qee cov xov hlau los txuas rau ntu
- 1 x AC/DC 5V/2A fais fab mov
- fais fab txuas rau lub hauv paus ntawm lub teeb kom ntsaws rau hauv lub hwj chim
- 1x WS2812b LED kab txaij nrog 30 LEDs ib 'meter' (3m ntev)
- Lub teeb tsim
Kauj Ruam 2: Kev Txuas Hluav Taws Xob
Kev teeb tsa txoj hlua yog yooj yim heev: Raws li tau qhia hauv daim duab fritzing koj yuav tsum txuas lub zog txuas nrog Photon ntawm tus pin VIN thiab GND thiab nrog + thiab - ntawm ib kawg ntawm thawj LED kab txaij. HC-SR04 txuas nrog ob txoj hlua ntev nrog tus pin D2 (TRIGGER ntawm HC-SR04) thiab D3 (ECHO ntawm HC-SR04) ntawm Photon. Tus pin D4 ntawm Photon txuas rau DI ntawm thawj LED kab txaij.
Kauj Ruam 3: Qhov Nyuaj - Sib Sau Cov Khoom
Cov kab txaij LED yog tus kheej-nplaum, tab sis kuv ruaj ntseg lawv nrog qee qhov txuas txuas ntxiv (saib cov duab nthuav dav). Txhawm rau khaws cov xov hlau kom luv li sai tau Kuv txiav txim siab xaim plaub kab coj hauv zigzag - tus pin D4 ntawm Photon txuas nrog DI ntawm thawj kab txaij, ua ntawm thawj kab ntawv txuas nrog rau qhov kawg ntawm cov yeeb nkab mus rau DI ntawm qhov kab thib ob. DO ntawm kab thib ob txuas nrog DI ntawm kab thib peb nyob hauv qab ntawm cov yeeb nkab. DO ntawm kab thib peb txuas nrog DI ntawm kab plaub kab saum toj ntawm cov yeeb nkab. VCC thiab GND kab ntawm txhua kab txaij tau txuas nrog tib txoj hauv kev. Cov xov hlau rau lub ntsuas hluav taws xob ultrasonic yog qhov ntev tshaj plaws thiab khiav los ntawm sab hauv ntawm cov yeeb nkab.
Lub hwj chim tau txuas nrog lub qhov (socket) uas kuv tau muab tso rau hauv lub qhov hauv qab ntawm lub teeb uas nyob hauv qhov qub version 220V fais fab cable tau hla mus. Cov hlua hluav taws xob mus los ntawm cov txuas no mus rau VIN/GND ntawm Photon, mus rau VCC/GND ntawm cov kab txaij coj mus rau lub ntsuas hluav taws xob.
Kauj Ruam 4: Cov Khoom Muag - Firmware Muaj nyob ntawm Github
Lub khoos phis tawj muaj nyob hauv no git chaw cia khoom ntawm Github:
github.com/happenpappen/PhotonLamp
Yog tias koj siv tus pin zoo tib yam los txuas cov kab hluav taws xob LED thiab HC-SR04, qhov tsuas yog qhov koj yuav tsum tau hloov ua ntej sau cov cai yog los tsim cov ntaub ntawv "MQTT_credentials.h" hauv "src" subdirectory uas muaj peb kab:
#define MQTT_HOST "" #define MQTT_USER "" #define MQTT_PASSWORD ""
Muaj ntau cov lus qhia zoo yuav teeb tsa lub mositto server li cas uas koj tuaj yeem nrhiav tau yooj yim los ntawm kev siv koj lub tshuab tshawb fawb uas koj nyiam …
Kauj Ruam 5: Lub Firmware - Yuav Siv Li Cas MQTT Kev Sib Txuas
Kuv siv Rasperry Pi 3 nrog mosquitto (https://www.mosquitto.org) ua MQTT server, thov xa mus rau nws cov ntaub ntawv yuav ua li cas teeb tsa nws. Koj tuaj yeem sau npe mus rau lub ncauj lus ([ntaus cim] = ID ntawm koj li Particle Photon):
/[ntaus cim]/#
kom pom tias nws tau ua tiav txuas rau lub server thiab yog nws muaj peev xwm tshaj tawm nws li xwm txheej:
Cov zis yuav tsum zoo li qhov no ([device id] = ID ntawm koj li Particle Photon):
/[ntaus cim]/xeev/DisplayMode 8
/[device id]/state/Brightness 250/[device id]/state/ForgroundColor 100, 023, 014/[device id]/state/BackgroundColor 034, 006, 034/[device id]/state/MaxDistance 92/[device id]/state/LastDistance 92/[device id]/state/CurrentDistance 92/[device id]/state/FirmwareVersion 0.6.3
Qhov tseeb tso tawm yuav nyob ntawm qhov version ntawm firmware uas koj siv.
Tab sis muaj kev lom zem ntau hauv nws: Los ntawm kev tshaj tawm rau:
/[ntaus cim]/teeb/[parameter] [tus nqi]
koj tuaj yeem hloov tus qauv uas tau nthuav tawm nrog rau qee yam xim.
Kom hloov xim xa:
/[device id of Particle Photon]/set/ForgroundColor/[liab], [ntsuab], [xiav]
/[ntaus cim ntawm Particle Photon]/setBackgroundColor/[liab], [ntsuab], [xiav]
Rau [liab], [ntsuab] thiab [xiav] ntxig cov zauv zauv ntawm qhov xim sib txawv.
Txhawm rau hloov cov qauv duab xa:
/[ntaus cim ntawm Particle Photon]/teeb/DisplayMode [tus nqi nruab nrab ntawm 1 thiab 11]
Tam sim no siv cov qauv zaub yog:
- Suab nrov
- Zaj sawv
- NoisePlusPalette
- Tib Xim
- Lub tog raj kheej
- Los nag
- Hluav Taws
- Kab rov tav
- Kab rov tav
- NtsugSplit
- Muab kauv (hauv kev txhim kho)
Ib txhia ntawm lawv yog los ntawm ntu piv txwv ntawm FastLED.
Txhawm rau hloov qhov ci ci xa:
/[device id]/set/Brightness [tus nqi ntawm 1 txog 100]
Pom zoo:
Nruab Nrab Nruab Nrab Chav Dej Teeb: 5 Kauj Ruam (nrog Duab)
Nruab Nrab Nruab Nrab Chav Dej Teeb: Peb ib txhia ntsib kev xav tau siv chav dej nyob nruab nrab hmo ntuj. Yog tias koj qhib lub teeb, tej zaum koj yuav tsis pom kev hmo ntuj. Lub teeb dawb lossis xiav ua rau koj plam qhov pw tsaug zog lawm, Melatonin, ua rau nws nyuaj rau rov mus pw. Yog li
Yuav Ua Li Cas Tsim Kev Tswj Tus Kheej 3D Luam Tus Kheej Tus Kheej Tus Kheej: 9 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Tsim Kev Tswj Tus Kheej 3D Luam Tus Kheej Tus Kheej Tus Kheej: Qhov no yog kev hloov pauv ntawm B-neeg hlau ua ntej. 100% Qhib QHOV CHAW / Arduino neeg hlau. CODE, 3D ntu thiab khoom siv hluav taws xob tau qhib yog li xav hloov kho nws lossis tsim qhov loj ntawm tus neeg hlau. Yog tias koj muaj kev ua xyem xyav, tswv yim lossis xav tau kev pab ua rau
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!)
Yuav Ua Li Cas: Tsim Tus Tsim Tus Zauv Tus lej Random Nrog Python: 8 Kauj Ruam
Yuav Ua Li Cas: Tsim Tus Tsim Tus Qauv Tsim Tus Kheej Nrog Python: Hauv qhov kev qhia no, koj yuav kawm paub yuav tsim lub tshuab hluav taws xob tus lej zais siv tus nab npawb li cas hauv ob peb kauj ruam yooj yim
Tsim Koj Tus Kheej Tus Kheej Robot !!! - Qhia, Duab, thiab Yees Duab: 58 Kauj Ruam (nrog Duab)
Tsim Koj Tus Kheej Tus Kheej Robot !!! - Tutorial, Duab, thiab Video: EDIT: Xav paub ntau ntxiv txog kuv cov phiaj xwm txheeb xyuas kuv lub vev xaib tshiab: narobo.comKuv tseem ua kev sab laj rau neeg hlau, tshuab me me, thiab tshwj xeeb cov haujlwm/cov khoom lag luam. Txheeb tawm kuv lub vev xaib - narobo.com kom paub meej ntxiv