Cov txheej txheem:
Video: Txuas Koj Cov Magicbit rau Cov Khoom Siv: 3 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Hauv qhov haujlwm no peb yuav xa cov ntaub ntawv los ntawm cov ntsuas hluav taws xob txuas nrog rau magicbit uas peb tuaj yeem pom pom qhov muag ntawm cov khoom ntoo.
Khoom siv:
- Magicbit
- DHT11 Kub & Vaum Sensor (4 pins)
Kauj ruam 1: Zaj dab neeg
Taw qhia
ThingsBoard yog qhov qhib-qhov server-sab platform uas tso cai rau koj los saib xyuas thiab tswj IoT cov cuab yeej. Nws yog pub dawb rau kev siv tus kheej thiab kev lag luam thiab koj tuaj yeem siv nws nyob txhua qhov chaw. Yog tias qhov no yog koj thawj qhov kev paub nrog lub platform peb pom zoo los tshuaj xyuas nplooj ntawv dab tsi-yog-yam khoom thiab pib-pib qhia.
Daim ntawv thov ua piv txwv no yuav tso cai rau koj kom pom cov ntaub ntawv huab cua/ntsuas kub los ntawm DHT11 lub cim siv koj lub cuab yeej khawv koob thiab ThingsBoard web UI.
Daim ntawv thov uas tau khiav ntawm Magicbit ntaus ntawv tau sau siv ThingsBoard Arduino SDK uas yog qhov yooj yim heev thiab nkag siab yooj yim.
Thaum koj ua tiav qhov piv txwv no/qhia, koj yuav pom koj cov ntaub ntawv sensor ntawm cov dashboard hauv qab no.
Mus ntsib Thingsboard Demo official page thiab tau sau npe.
Tom qab kos npe rau ntawm Sab laug Sab Bar koj yuav pom Devices. Nyem pab kiag li lawm thiab ntxiv ib lub cuab yeej tshiab.
Ntawm daim ntawv pov thawj tab zuam Ntxiv daim ntawv pov thawj thiab xaiv Access Token los ntawm lub npov nco. Xijpeem koj tuaj yeem ntxiv koj tus kheej Access Token lossis tso qhov khoob rau nws pib tsim cov cim.
Teem lub cuab yeej rau magicbit hauv npe. Mus rau ntawm lub dashboard tab thiab import dashboard.
Ua raws cov theem hauv qab no hauv cov duab rau Ntshuam lub dashboard. Nrhiav qhov demo JSON cov ntaub ntawv hu ua "magicbit_temperature_humidity_demo_dashboard.json" hauv cov ntawv txuas.
Txuas koj cov khawv koob me ntsis nrog DHT11 tus qauv raws li hauv qab no rau tus pin 33.
Hauv Arduino IDE rub tawm cov tsev qiv ntawv saum toj no.
Cov hauv qab no yog Arduino code koj yuav siv.
Nco tseg Koj yuav tsum hloov kho qhov txuas hauv qab no thiab hloov pauv hauv daim duab:
- WIFI_AP - lub npe ntawm koj qhov chaw nkag
- WIFI_PASSWORD - nkag lo lus zais
- TOKEN - $ ACCESS_TOKEN los ntawm Cov Txheej Txheem Txheej Txheem txheej txheem.
- THINGSBOARD_SERVER - ThingsBoard HOST/IP chaw nyob uas nkag tau mus rau hauv koj lub network wifi. Qhia meej demo.thingsboard.io yog tias koj tab tom siv cov neeg ua haujlwm nyob demo.
Kauj ruam 2: Arduino Code
#suav nrog // DHT rau Lub Tsev Qiv Ntawv#suav nrog // WiFi tswj rau ESP32#suav nrog // ThingsBoard SDK#txhais DHTPIN 33 // dab tsi tus lej digital peb txuas nrog rau#txhais DHTTYPE DHT11 // DHT 11DHT dht (DHTPIN, DHTTYPE); // Helper macro los laij array loj#txhais COUNT_OF (x) ((sizeof (x)/ sizeof (0 [x]))/ ((size_t) (! (Sizeof (x) % sizeof (0 [x]))))) // WiFi nkag mus taw qhia#txhais WIFI_AP_NAME "4G" // "WIFI_AP" // WiFi lo lus zais#txhais WIFI_PASSWORD "yeej tsis muab" // "WIFI_PASSWORD" // Saib https://thingsboard.io/docs/getting- pib-qhia/helloworld /// kom nkag siab yuav ua li cas thiaj li nkag tau token#txhais TOKEN "XZjQ26r9XJcsNkWGuASY" // "TOKEN" // ThingsBoard server piv txwv.#txhais THINGSBOARD_SERVER "demo.thingsboard.io" // Baud tus nqi rau debug serial #define SERIAL_DEBUG_BAUD 115200 // Pib Pib Yam KhoomBoard clientWiFiClient espClient; // Pib pib ThingsBoard piv txwv liThingsBoard tb (espClient); // Lub xov tooj cua Wifi's statusint status = WL_IDLE_STATUS; // Lub sijhawm xa cov ntaub ntawv ntsuas kub/av noo.int xa_delay =; unsigned ntev millis_counter; tsis muaj dab tsi InitWiFi () {Serial.println ("Txuas rau AP …"); // sim txuas rau WiFi network WiFi.begin (WIFI_AP_NAME, WIFI_PASSWORD); thaum (WiFi.status ()! = WL_CONNECTED) {ncua (500); Serial.print ("."); } Serial.println ("Txuas rau AP");} tsis muaj qhov txuas rov qab () {// Loop kom txog thaum peb rov txuas dua xwm txheej = WiFi.status (); yog (xwm txheej! = WL_CONNECTED) {WiFi.begin (WIFI_AP_NAME, WIFI_PASSWORD); thaum (WiFi.status ()! = WL_CONNECTED) {ncua (500); Serial.print ("."); } Serial.println ("Txuas rau AP"); }} // Teeb tsa daim ntawv thov tsis muaj teeb tsa () {// Pib ua ntu zus rau kev debugging Serial.begin (SERIAL_DEBUG_BAUD); WiFi.begin (WIFI_AP_NAME, WIFI_PASSWORD); InitWiFi (); // Pib ntsuas qhov ntsuas kub dht.begin ();} // Daim ntawv thov tseem ceeb loopvoid loop () {// Txuas dua rau WiFi, yog xav tau yog (WiFi.status ()! = WL_CONNECTED) {rov txuas dua (); rov qab; } // Rov txuas rau ThingsBoard, yog xav tau yog (! Tb.connected ()) {// Txuas mus rau ThingsBoard Serial.print ("Txuas rau:"); Serial.print (THINGSBOARD_SERVER); Serial.print ("nrog token"); Serial.println (TOKEN); yog (! tb.connect (THINGSBOARD_SERVER, TOKEN)) {Serial.println ("Ua tsis tau txuas"); rov qab; }} // Txheeb xyuas seb nws yog lub sijhawm xa DHT11 qhov kub thiab txias yog (millis ()-millis_counter> xa_delay) {Serial.println ("Xa cov ntaub ntawv …"); // Uploads tshiab telemetry rau ThingsBoard siv MQTT. // Saib https://thingsboard.io/docs/reference/mqtt-api/#telemetry-upload-api // kom paub meej ntxiv ntab h = dht.readHumidity (); // Nyeem kub li Celsius (lub neej ntawd) ntab t = dht.readTemperature (); yog (isnan (h) || isnan (t)) {Serial.println ("Ua tsis tau tejyam nyeem los ntawm DHT sensor!"); } lwm {Serial.print ("Kub:"); Serial.print (t); Serial.print ("Vaum"); Serial.println (h); tb.sendTelemetryFloat ("kub", t); tb.sendTelemetryFloat ("av noo", h); } millis_counter = millis (); // rov pib dua millis counter} // Txheej txheem lus tb.loop ();}
Kauj Ruam 3: Kev Pom Cov Ntaub Ntawv
Nyob rau hauv-demo server:
- ID nkag mus: koj lub npe-demo username (email)
- lo lus zais: koj tus lej-demo password
Saib nplooj ntawv-nyob demo kom paub meej ntxiv yuav ua li cas kom tau koj tus as khauj.
Mus rau "Devices" ntu thiab nrhiav "Magicbit", qhib cov ntsiab lus ntaus ntawv thiab hloov mus rau "Tseeb telemetry" tab. Yog tias txhua yam tau teeb tsa kom raug koj yuav tsum tuaj yeem pom qhov txiaj ntsig kawg ntawm "kub" thiab "av noo".
Tom qab, qhib "Dashboards" ntu tom qab ntawd nrhiav thiab qhib "magicbit_temperature_humidity_demo_dashboard". Raws li qhov tshwm sim, koj yuav pom daim ntawv teev sijhawm teev qhia qhov ntsuas kub thiab av noo (zoo ib yam li daim duab qhia chaw hauv kev taw qhia).
Pom zoo:
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev -- Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: 4 Cov Kauj Ruam
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev || Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: Nov Yog Qhov Tuchless Hloov Rau Cov Khoom Siv Hauv Tsev. Koj Siv Tau Qhov No Mus Rau Txhua Qhov Chaw Hauv Pej Xeem Kom Pab Tau Tawm Tsam Ib Yam Kab Mob. Lub Circuit Court Raws Li Tsaus Sensor Circuit Ua Los Ntawm Op-Amp Thiab LDR. Qhov Tseem Ceeb Thib Ob Ntawm Qhov Circuit Court SR Flip-Flop Nrog Sequencell
Kev Sib Txuas Txuas Txuas Txuas Siv Bluefruit: 4 Cov Kauj Ruam
Kev Sib Txuas Tsis Sib Txuas Siv Bluefruit: Nov yog cov lus qhia yooj yim los ntawm kauj ruam qhia los hloov koj cov xov hlau nrog bluetooth tsis muaj zog txuas: Nws coj kuv ib pliag los daws qhov no vim tias tsis muaj cov ntaub ntawv hais txog kev ua qhov no nrog bluetooth niaj hnub tsis muaj zog thev naus laus zis raws li Bluefrui
Siv Koj Mac OSX Ua Tus Hlau Txuas Txuas rau Koj XBOX 360: 6 Cov Kauj Ruam
Siv Koj Mac OSX Raws li Wirelss Adapter rau Koj XBOX 360: Kuv tau pom lwm phau ntawv qhia yuav ua li cas ntawm no tab sis nws tau ua tsis txaus ntshai heev thiab tawm ntau yam khoom, yog li kuv txiav txim siab ua kuv tus kheej
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Qhov Chaw Mounted Footrest: 9 Cov Kauj Ruam (nrog Duab)
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Lub Hauv Paus Mounted Footrest: Mid-drive fais fab log lub rooj zaum (PWC) tau dhau los ua neeg nyiam nyob rau xyoo tas los no. Txawm li cas los xij, vim qhov kev tso rau pem hauv ntej casters, cov tsoos sab-mounted footrests tau hloov los ntawm ib qho chaw nruab nrab-footrest. Hmoov tsis zoo, center-mou
Rov Siv Cov Khoom Siv Yas Zib Zib Zib Zib Hnab Rau Hauv Cov Chaw Muag Khoom Chaw Muag Khoom: 6 Kauj Ruam
Reuse Recycle Plastic Chewing Gum Cannister Into Solder Station Dispenser: Cov lus qhia no yuav qhia koj yuav ua li cas siv cov yas zom zom tuaj yeem ua kom khaws cov kab laug sab zoo thiab huv. Qhov no yuav ua haujlwm ntawm lwm yam khoom siv spooled thiab; Txoj hlua, Hlau, Cables