{"id":3862,"date":"2024-03-05T09:03:38","date_gmt":"2024-03-05T17:03:38","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3862"},"modified":"2024-03-05T09:03:38","modified_gmt":"2024-03-05T17:03:38","slug":"project-29-dfrobot-gravity-soil-moisture-sensor-mk04","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3862","title":{"rendered":"Project #29 &#8211; DFRobot &#8211; Gravity Soil Moisture Sensor &#8211; Mk04"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3862-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #DFRobot #SoilMoistureSensor #FireBeetle2ESP32E #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04a.png\" alt=\"Gravity Soil Moisture Sensor\" width=\"720\" height=\"496\" class=\"alignnone size-full wp-image-3864\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04a-300x207.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04b.png\" alt=\"Gravity Soil Moisture Sensor\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3865\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04c.png\" alt=\"Gravity Soil Moisture Sensor\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3866\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/03\/DL2402Mk04c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Gravity: Analog Soil Moisture Sensor<\/strong><\/p>\n<p>A soil moisture sensor can read the amount of moisture present in the soil surrounding it. It&#8217;s an ideal for monitoring an urban garden, or your pet plant&#8217;s water level. This is a must have component for a IOT Garden \/ Agriculture. The new soil moisture sensor uses Immersion Gold which protects the nickel from oxidation. Electroless nickel immersion gold has several advantages over more conventional surface platings such as HASL, including excellent surface planarity, good oxidation resistance, and usability for untreated contact surfaces such as membrane switches and contact points.<\/p>\n<p>This Soil Moisture Sensor uses the two probes to pass current through the soil, and then it reads that resistance to get the moisture level. More water makes the soil conduct electricity more easily, while dry soil conducts electricity poorly. This sensor will be helpful to remind you to water your indoor plants or to monitor the soil moisture in your garden.<\/p>\n<p><strong>DL2402Mk04<\/strong><\/p>\n<p>1 x DFRobot FireBeetle 2 ESP32-E<br \/>\n1 x Gravity: Analog Soil Moisture Sensor<br \/>\n1 x 1 x Lithium Ion Battery &#8211; 1000mAh<br \/>\n1 x Rocker Switch &#8211; SPST<br \/>\n1 x Resistor 10K Ohm<br \/>\n1 x USB 3.1 Cable A to C<\/p>\n<p><strong>DFRobot FireBeetle 2 ESP32-E<\/strong><\/p>\n<p>LED &#8211; 2<br \/>\nRSW &#8211; 17<br \/>\nSMS &#8211; A0<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2402Mk04p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/****** Don Luc Electronics \u00a9 ******\r\nSoftware Version Information\r\nProject #29 - DFRobot - Gravity Soil Moisture Sensor - Mk04\r\n29-04\r\nDL2402Mk04p.ino\r\n1 x DFRobot FireBeetle 2 ESP32-E\r\n1 x Gravity: Analog Soil Moisture Sensor\r\n1 x Rocker Switch - SPST\r\n1 x Resistor 10K Ohm\r\n1 x 1 x Lithium Ion Battery - 1000mAh\r\n1 x USB 3.1 Cable A to C\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Bluetooth LE keyboard\r\n#include &lt;BleKeyboard.h&gt;\r\n\r\n\/\/ Bluetooth LE Keyboard\r\nBleKeyboard bleKeyboard;\r\nString sKeyboard = &quot;&quot;;\r\n\/\/ Send Size\r\nbyte sendSize = 0;\r\n\r\n\/\/ Gravity: Analog Soil Moisture Sensor\r\nint iSoilMoisture = A0;\r\nint iSoilMoistureVal = 0;\r\n\r\n\/\/ The number of the Rocker Switch pin\r\nint iSwitch = 17;\r\n\/\/ Variable for reading the button status\r\nint SwitchState = 0;\r\n\r\n\/\/ Define LED\r\nint iLED = 2;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;29-04&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Gravity: Analog Soil Moisture Sensor\r\n  isSoilMoisture();\r\n\r\n  \/\/ Read the state of the Switch value:\r\n  SwitchState = digitalRead(iSwitch);\r\n\r\n  \/\/ Check if the button is pressed. If it is, the SwitchState is HIGH:\r\n  if (SwitchState == HIGH) {\r\n\r\n    \/\/ Bluetooth LE Keyboard\r\n    isBluetooth();\r\n\r\n  }\r\n  \r\n  \/\/ Delay 1 Second\r\n  delay(1000);\r\n\r\n}\r\n<\/pre>\n<p><strong>getBleKeyboard.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Ble Keyboard\r\n\/\/ Bluetooth\r\n\/\/ isBluetooth\r\nvoid isBluetooth() {\r\n\r\n  \/\/ ESP32 BLE Keyboard\r\n  if(bleKeyboard.isConnected()) {\r\n\r\n    \/\/ Send Size Length\r\n    sendSize = sKeyboard.length();\r\n\r\n    \/\/ Send Size, charAt\r\n    for(byte i = 0; i &lt; sendSize+1; i++){\r\n\r\n       \/\/ Write\r\n       bleKeyboard.write(sKeyboard.charAt(i));\r\n       delay(50);\r\n    \r\n    }\r\n    bleKeyboard.write(KEY_RETURN);\r\n\r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>getSoilMoisture.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Gravity: Analog Soil Moisture Sensor\r\n\/\/ Soil Moisture\r\nvoid isSoilMoisture(){\r\n\r\n  \/\/ Connect Soil Moisture Sensor to Analog 0\r\n  iSoilMoistureVal = analogRead( iSoilMoisture );\r\n\r\n  \/\/ SData =&gt; 0~900 Soil Moisture\r\n  float SData = map( iSoilMoistureVal, 1, 3000, 0, 900);\r\n\r\n  \/\/ bleKeyboard\r\n  \/\/ DFR|Version|Soil Moisture|*\r\n  sKeyboard = &quot;DFR|&quot; + sver + &quot;|&quot; + String(SData) + &quot;|*&quot;;\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n  \r\n  \/\/ Give display time to power on\r\n  delay(100);\r\n\r\n  \/\/ Bluetooth LE keyboard\r\n  bleKeyboard.begin();\r\n\r\n  \/\/ Give display time to power on\r\n  delay(100);\r\n  \r\n  \/\/ Initialize the Switch pin as an input\r\n  pinMode(iSwitch, INPUT);\r\n  \r\n  \/\/ Initialize digital pin iLED as an output\r\n  pinMode(iLED, OUTPUT);\r\n  \/\/ Outputting high, the LED turns on\r\n  digitalWrite(iLED, HIGH);\r\n\r\n  \/\/ Delay 5 Second\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Teacher, Instructor, E-Mentor, R&#038;D and Consulting<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Automation<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>Artificial Intelligence (AI)<\/li>\n<li>RTOS<\/li>\n<li>eHealth Sensors, Biosensor, and Biometric<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Consulting<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2024<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #DFRobot #SoilMoistureSensor #FireBeetle2ESP32E #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Gravity: Analog Soil Moisture Sensor A soil moisture sensor can read the amount of moisture present in the soil surrounding it. It&#8217;s an ideal for monitoring an urban garden, or your pet plant&#8217;s water level. This &#8230; <a title=\"Project #29 &#8211; DFRobot &#8211; Gravity Soil Moisture Sensor &#8211; Mk04\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3862\" aria-label=\"Read more about Project #29 &#8211; DFRobot &#8211; Gravity Soil Moisture Sensor &#8211; Mk04\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[318,50,49,317,38,80,59,115,5,287,58,82,10],"tags":[6,92,242,102,4,320,19,83,85,325,24,9,84,27,33,34,108],"class_list":["post-3862","post","type-post","status-publish","format-standard","hentry","category-ddfrobot","category-arduino","category-consultant","category-dfrobot","category-digitalelectronics","category-esp32","category-fritzing","category-e-mentor","category-microcontrollers","category-program","category-arduino-programming","category-program-esp32","category-projects","tag-arduino","tag-battery","tag-bluetooth","tag-components","tag-consultant","tag-dfrobot","tag-electronics","tag-esp32","tag-fritzing","tag-gravity-soil-moisture-sensor","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3862"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3862\/revisions"}],"predecessor-version":[{"id":4076,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3862\/revisions\/4076"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}