一区二区三区三上|欧美在线视频五区|国产午夜无码在线观看视频|亚洲国产裸体网站|无码成年人影视|亚洲AV亚洲AV|成人开心激情五月|欧美性爱内射视频|超碰人人干人人上|一区二区无码三区亚洲人区久久精品

電子發(fā)燒友App

硬聲App

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>電子資料>在Arduino IoT Cloud的幫助下創(chuàng)建植物通訊器

在Arduino IoT Cloud的幫助下創(chuàng)建植物通訊器

2023-01-31 | zip | 0.63 MB | 次下載 | 免費

資料介紹

描述

Arduino IoT Cloud 的幫助下創(chuàng)建植物通訊器!

正如英國詩人威廉華茲華斯曾經(jīng)說過的:

“你的思想是花園,你的思想是種子,收獲可以是花朵或雜草?!?/font>

讓我們的植物保持活力可能是一項相當(dāng)大的挑戰(zhàn),因為我們與植物之間缺乏清晰的溝通。讓他們開心的一種方法是把我們的植物帶在身邊,但也許我們不想帶著從冬季夾克口袋里伸出來的大仙人掌或蕨類植物四處走動。此外,大多數(shù)植物不喜歡寒冷。在花了幾個月時間嘗試與我們的吊蘭進行通信之后,我們放棄了,而是將 IoT Bundle 組件與 Arduino IoT Cloud 一起使用來創(chuàng)建一個設(shè)備,該設(shè)備可以遠(yuǎn)程調(diào)查任何植物的健康狀況。

簡而言之

在這個實驗中,我們將學(xué)習(xí)如何保護我們的植物并確保它們存活下來,以及如何使用 Arduino 魔法。通過監(jiān)測濕度、溫度和光照,我們可以確保我們的植物生長良好。

到該項目結(jié)束時,您的工廠將以可視化方式與您交流其需求,并通過 Arduino IoT CLoud 向您展示其目前的工作情況。

組件

注意:要實現(xiàn)此項目中演示的所有功能,您需要訂閱 Arduino IoT Cloud。通過刪除其中一個變量(光、溫度或濕度),可以在沒有 Arduino IoT Cloud 訂閱的情況下執(zhí)行該項目。

學(xué)習(xí)目標(biāo)

  • 介紹 Arduino 物聯(lián)網(wǎng)
  • 介紹 Arduino IoT Remote 應(yīng)用程序
  • DIY 濕度傳感器
  • 創(chuàng)建 Arduino 物聯(lián)網(wǎng)云儀表板

想知道更多?

教程是讓您熟悉 Arduino RP2040 和物聯(lián)網(wǎng)的一系列實驗的一部分。所有實驗都可以使用 IoT Bundle 中包含的組件來構(gòu)建。

設(shè)置 Arduino 物聯(lián)網(wǎng)云

如果您是 Arduino IoT Cloud 的新手,請查看我們的入門指南

我們將從按照以下步驟設(shè)置 Arduino IoT Cloud 開始:

  • 登錄到您的 Arduino 創(chuàng)建帳戶
  • 創(chuàng)建一個東西
  • 連接設(shè)備
  • 添加變量
  • 添加網(wǎng)絡(luò)憑據(jù)
設(shè)置 Arduino 物聯(lián)網(wǎng)云
?

變量

我們將從添加四個變量開始:

pYYBAGPXKvuAM-TlAAFTqquRI2Q290.png
?

設(shè)置硬件和草圖

DIY土壤水分

放置在土盆中的兩根導(dǎo)線構(gòu)成一個可變電阻器,其阻值隨土壤濕度而變化。這個可變電阻器以分壓器配置連接,Arduino 收集與兩條線之間的電阻成比例的電壓。這意味著土壤越潮濕,Arduino 測量到的電壓就越低,因為土壤中的電阻會隨著水分的增加而降低。土壤越干燥,電阻越高。使用 1 兆歐電阻器和兩根電線,我們可以創(chuàng)建我們的 DIY 土壤濕度傳感器。

pYYBAGPXKyGAXNhTAAe96khjXK8064.png
?

該值將用于設(shè)置閾值,以便 Arduino 知道您的植物何時需要水。將下面顯示的代碼添加到您的草圖中并測試植物的水分含量。這些值顯示在串行監(jiān)視器中。

#include "thingProperties.h"
int moisturePin = A2;
/* Set this threeshold accordingly to the resistance you used */
/* The easiest way to calibrate this value is to test the sensor in both dry and wet earth */
int threshold = 800;
void setup() {
  /* Initialize serial and wait for port to open: */
  Serial.begin(9600);
  /* This delay gives the chance to wait for a Serial Monitor without blocking if none   is found */
  delay(1500);
  /* Defined in thingProperties.h */
  initProperties();
  /* Connect to Arduino IoT Cloud */
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  /*
  The following function allows you to obtain more information
  related to the state of network and IoT Cloud connection and errors
  the higher number the more granular information you’ll get.
  The default is 0 (only errors).
  Maximum is 4
  */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}
void loop() {
  ArduinoCloud.update();
  moisture = get_average_moisture();
  Serial.print("moisture ");
  Serial.println(moisture);
  /* assign the message variable based on water levels */
  if (moisture > threshold) {
  message = "Warning your plant needs water!"; /* Insert here your emergency message */
  } else {
  message = "Your plant has enough water!";
  }
  Serial.println(message);
}
int get_average_moisture() {
  int tempValue = 0; /* variable to temporarily store moisture value */
  /* make an average of 10 values to be more accurate */
  for (int a = 0; a < 10; a++) {
  tempValue += analogRead(moisturePin);
  delay(100);
 }
  return tempValue / 10;
}
/*
Since Message is READ_WRITE variable, onMessageChange() is
executed every time a new value is received from IoT Cloud.
*/
void onMessageChange()  {
  /* Add your code here to act upon Message change */
}

光和溫度傳感器

請參見下面的示意圖以連接兩個傳感器。我們將使用這兩個函數(shù)從傳感器讀取值:

poYBAGPXKzWACc7QAAjA3JPqvPM938.png
?
#include "thingProperties.h"
int lightPin = A0; /*the analog pin the light sensor is connected to */
int tempPin = A1; /*the analog pin the TMP36's Vout (sense) pin is connected to */
int moisturePin = A2;
/* Set this threshold accordingly to the resistance you used */
/* The easiest way to calibrate this value is to test the sensor in both dry and wet earth */
int threshold = 800;
void setup() {
  /* Initialize serial and wait for port to open: */
  Serial.begin(9600);
  /* This delay gives the chance to wait for a Serial Monitor without blocking if none is found */
  delay(1500);
  /* Defined in thingProperties.h */
  initProperties();
  /* Connect to Arduino IoT Cloud */
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
  */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}
void loop() {
  ArduinoCloud.update();
  light = analogRead(lightPin); /* assign light variable to light sensor values */
  Serial.print("light ");
  Serial.println(light);
  temperature = get_temperature(); /* assign temperature variable to temperature in Celsius */
  Serial.print("temperature ");
  Serial.println(temperature);
  
  moisture = get_average_moisture();
  /* assign the message variable based on water levels */
  if (moisture > threshold) {
    message = "Warning your plant needs water!"; /* Insert here your emergency message */
  } else {
    message = "Your plant has enough water!";
  }
}
int get_average_moisture() {
  int tempValue = 0; /* variable to temporarly store moisture value */
  /* make an average of 10 values to be more accurate */
  for (int a = 0; a < 10; a++) {
    tempValue += analogRead(moisturePin);
    delay(100);
  }
  return tempValue / 10;
}
float get_temperature() {
  int reading = analogRead(tempPin);
  float voltage = reading * 3.3;
  voltage /= 1024.0;
  /* temperature in Celsius */
  float temperatureC = (voltage - 0.5) * 100 ; /*converting from 10 mv per degree wit 500 mV offset */
  /* Convert to Fahrenheit */
  float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
  return temperatureC;
}
void onMessageChange()  {
  /* Add your code here to act upon Message change */
}

請注意,您可以通過在“get_temperature()”函數(shù)末尾返回 temperatureF 而不是 temperatureC 來使用華氏度單位。

儀表板

部署項目的最后一步是使用 Arduino IoT 儀表板添加控制面板。我們可以導(dǎo)航到Dashboards -> Build Dashboard -> ADD,然后我們可以添加四個小部件并將它們鏈接到變量,如下所示:

  • 圖形小部件 -> 溫度變量
  • 圖形小部件 -> 濕度變量
  • 儀表小部件 -> 光變量
  • Messenger 小部件 -> 消息變量
?

現(xiàn)在,我們可以看到傳感器數(shù)據(jù)的可視化表示。

?

祝賀您現(xiàn)在已經(jīng)構(gòu)建了自己的 DIY 植物通訊器,展示了您的植物如何使用 IoT Bundle 和 IoT Cloud 進行操作。

想知道更多?

本教程是讓您熟悉 Arduino IoT Bundle 的一系列實驗的一部分。所有實驗都可以使用 IoT Bundle 中包含的組件來構(gòu)建。


下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1山景DSP芯片AP8248A2數(shù)據(jù)手冊
  2. 1.06 MB  |  532次下載  |  免費
  3. 2RK3399完整板原理圖(支持平板,盒子VR)
  4. 3.28 MB  |  339次下載  |  免費
  5. 3TC358743XBG評估板參考手冊
  6. 1.36 MB  |  330次下載  |  免費
  7. 4DFM軟件使用教程
  8. 0.84 MB  |  295次下載  |  免費
  9. 5元宇宙深度解析—未來的未來-風(fēng)口還是泡沫
  10. 6.40 MB  |  227次下載  |  免費
  11. 6迪文DGUS開發(fā)指南
  12. 31.67 MB  |  194次下載  |  免費
  13. 7元宇宙底層硬件系列報告
  14. 13.42 MB  |  182次下載  |  免費
  15. 8FP5207XR-G1中文應(yīng)用手冊
  16. 1.09 MB  |  178次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應(yīng)用800例(新編版)
  4. 0.00 MB  |  33566次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關(guān)電源設(shè)計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數(shù)字電路基礎(chǔ)pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅(qū)動電路設(shè)計》 溫德爾著
  16. 0.00 MB  |  6656次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
  4. 78.1 MB  |  537798次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420027次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191187次下載  |  免費
  13. 7十天學(xué)會AVR單片機與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費