{"id":4984,"date":"2026-10-07T08:52:25","date_gmt":"2026-10-07T15:52:25","guid":{"rendered":"https:\/\/www.donluc.com\/?p=4984"},"modified":"2026-10-07T08:52:25","modified_gmt":"2026-10-07T15:52:25","slug":"project-15-environment-rtc-mk50","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=4984","title":{"rendered":"Project #15: Environment \u2013 RTC \u2013 Mk50"},"content":{"rendered":"<div style=\"width: 1200px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4984-1\" width=\"1200\" height=\"675\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #RTC #C4002 #BME280 #ENS160 #Environment #FireBeetle2ESP32E #ESP32 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03a.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03a.jpg\" alt=\"RTC\" width=\"720\" height=\"665\" class=\"alignnone size-full wp-image-4986\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03a.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03a-300x277.jpg 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\/2026\/10\/DL2609Mk03b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03b.jpg\" alt=\"RTC\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4987\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03b.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03b-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03c.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03c.jpg\" alt=\"RTC\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4988\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03c.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/10\/DL2609Mk03c-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Gravity: I2C SD2405 RTC Module<\/strong><\/p>\n<p>The I2C SD2405 RTC module features accurate real-time clock, dual power supply, low power consumption, periodic interrupts, and a high precision time trimming circuit. The SD2405AL is dual power supply system. When the primary power supply goes down to an assigned value or resumes from low power, the system can switch between the primary power supply and battery automatically. Even there is no external power, it can still work for 5~8 years, 1uA ultra-low power consumption.<\/p>\n<p><strong>DL2609Mk03<\/strong><\/p>\n<p>1 x DFRobot FireBeetle 2 ESP32-E<br \/>\n1 x Fermion: 3.5\u201d 480&#215;320 TFT LCD Capacitive<br \/>\n1 x GDL Line 10 CM<br \/>\n1 x Gravity: I2C SD2405 RTC Module<br \/>\n1 x Fermion: C4002 mmWave Human Presence Sensor<br \/>\n1 x Fermion: ENS160+BME280 Envirotal Sensor<br \/>\n1 x Gravity: IO Shield for FireBeetle 2<br \/>\n1 x Terminal Block Board for FireBeetle 2 ESP32-E IoT<br \/>\n1 x Lithium Ion Battery &#8211; 1000mAh<br \/>\n1 x USB 3.0 to Type-C Cable<\/p>\n<p><strong>DL2609Mk03p<\/strong><\/p>\n<p><strong>DL2609Mk03p.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 #15: Environment \u2013 RTC \u2013 Mk50\r\n15-50\r\nDL2609Mk03p.ino\r\nDL2609Mk03\r\n1 x DFRobot FireBeetle 2 ESP32-E\r\n1 x Fermion: 3.5\u201d 480x320 TFT LCD Capacitive\r\n1 x GDL Line 10 CM\r\n1 x Gravity: I2C SD2405 RTC Module\r\n1 x Fermion: C4002 mmWave Human Presence Sensor\r\n1 x Fermion: ENS160+BME280 Envirotal Sensor\r\n1 x Gravity: IO Shield for FireBeetle 2\r\n1 x Terminal Block Board for FireBeetle 2 ESP32-E IoT\r\n1 x Lithium Ion Battery - 1000mAh\r\n1 x USB 3.0 to Type-C Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ DFRobot Display GDL API\r\n#include &lt;DFRobot_GDL.h&gt;\r\n\/\/ C4002 mmWave Human Presence\r\n#include &quot;DFRobot_C4002.h&quot;\r\n\/\/ BME280 Environmental\r\n#include &lt;DFRobot_BME280.h&gt;\r\n\/\/ ENS160 Air Quality Sensor\r\n#include &lt;DFRobot_ENS160.h&gt;\r\n\/\/ RTC (Real-Time Clock)\r\n#include &quot;GravityRtc.h&quot;\r\n\r\n\/\/ RTC Initialization\r\nGravityRtc rtc;\r\n\/\/ Date and Time\r\nString dateRTC = &quot;&quot;;\r\nString timeRTC = &quot;&quot;;\r\n\r\n\/\/ ENS160 Air Quality Sensor\r\n\/\/ I2C communication.\r\n#define I2C_COMMUNICATION  \r\n\/\/ I2C address is 0x53\r\nDFRobot_ENS160_I2C ENS160(&amp;Wire, 0x53);\r\n\/\/ Status\r\nuint8_t Status;\r\n\/\/ AQI\r\nuint8_t AQI;\r\n\/\/ TVOC\r\nuint16_t TVOC;\r\n\/\/ ECO2\r\nuint16_t ECO2;\r\n\r\n\/\/ BME280 Environmental\r\ntypedef DFRobot_BME280_IIC BME;\r\n\/\/ Wire\r\nBME   bme(&amp;Wire, 0x76);\r\n\/\/ Sea Level Pressure\r\n#define SEA_LEVEL_PRESSURE 1015.0f\r\n\/\/ Temperature\r\nfloat   temp = bme.getTemperature();\r\n\/\/ Pressure\r\nuint32_t    press = bme.getPressure();\r\n\/\/ Altitude\r\nfloat alti;\r\n\/\/ Humidity\r\nfloat humi;\r\n\r\n\/\/ C4002 mmWave Human Presence\r\nDFRobot_C4002 c4002(&amp;Serial1, 115200, \/*D0*\/ D11, \/*D1*\/ D10);\r\n\/\/float light;\r\nString sLight;\r\n\/\/ Get Target State\r\nString sTarget;\r\n\/\/ Get Presence distance gate target info\r\nString sPreDis;\r\n\/\/ Get motion distance gate index\r\nString sMot;\r\n\r\n\/\/ Defined ESP32\r\n#define TFT_DC  D2\r\n#define TFT_CS  D6\r\n#define TFT_RST D3\r\n\r\n\/*dc=*\/ \/*cs=*\/ \/*rst=*\/\r\n\/\/ DFRobot Display 320x480\r\nDFRobot_ILI9488_320x480_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;15-50&quot;;\r\n\r\nvoid loop() {\r\n  \r\n  \/\/ isBME280\r\n  isBME280();\r\n\r\n  \/\/ isENS160\r\n  isENS160();\r\n  \r\n  \/\/ isC4002\r\n  isC4002();\r\n\r\n  \/\/ RTC (Real-Time Clock)\r\n  isRTC();\r\n  \r\n  \/\/ isDisplay C4002\r\n  isDisplayC4002();\r\n\r\n  \/\/ Delay 0.1 Second\r\n  delay( 100 );\r\n  \r\n}\r\n<\/pre>\n<p><strong>getBME280.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ BME280 Environmental\r\n\/\/ isBME280\r\nvoid isBME280(){\r\n\r\n  \/\/ Temperature\r\n  temp = bme.getTemperature();\r\n  \/\/ Pressure\r\n  press = bme.getPressure();\r\n  \/\/ Altitude\r\n  alti = bme.calAltitude(SEA_LEVEL_PRESSURE, press);\r\n  \/\/ Humidity\r\n  humi = bme.getHumidity();\r\n\r\n}\r\n<\/pre>\n<p><strong>getC4002.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ C4002 mmWave Human Presence\r\n\/\/ isSetupC4002\r\nvoid isSetupC4002(){\r\n\r\n  \/\/ C4002 mmWave Human Presence\r\n  \/\/ Initialize the C4002 sensor\r\n  while (c4002.begin() != true) {\r\n    Serial.println(&quot;C4002 begin failed!&quot;);\r\n    delay(1000);\r\n  }\r\n  \/\/Serial.println(&quot;C4002 begin success!&quot;);\r\n  delay(50);\r\n\r\n  \/\/ Set the run led to On\r\n\r\n  if (c4002.setRunLedState(eLedOn)) {\r\n    \/\/Serial.println(&quot;Set run led success!&quot;);\r\n  } else {\r\n    Serial.println(&quot;Set run led failed!&quot;);\r\n  }\r\n  delay(50);\r\n\r\n  \/\/ Set the out led to On\r\n  if (c4002.setOutLedState(eLedOn)) {\r\n    \/\/Serial.println(&quot;Set out led success!&quot;);\r\n  } else {\r\n    Serial.println(&quot;Set out led failed!&quot;);\r\n  }\r\n  delay(50);\r\n\r\n  \/\/ Set the Resolution mode to 20cm.\r\n  \/\/ eResolution20Cm: This indicates that the resolution of the &quot;distance gate&quot;\r\n  \/\/ is 20cm. With a resolution of 20 cm, it supports up to 25 distance gates, \r\n  \/\/with a maximum distance of 4.9 meters\r\n  \/\/c4002.setResolutionMode(eResolution20Cm);\r\n  if (c4002.setResolutionMode(eResolution20Cm)) {\r\n    \/\/Serial.println(&quot;Set resolution mode success!&quot;);\r\n  } else {\r\n    Serial.println(&quot;Set resolution mode failed!&quot;);\r\n  }\r\n  delay(50);\r\n\r\n  \/\/ Set the detect range to 0-200 cm\r\n  uint16_t clostRange = 0;\r\n  uint16_t farRange   = 200;\r\n  if (c4002.setDetectRange(clostRange, farRange)) {    \/\/ Max detect range(0-1100cm)\r\n    \/\/Serial.println(&quot;Set detect range success!&quot;);\r\n  } else {\r\n    Serial.println(&quot;Set detect range failed!&quot;);\r\n  }\r\n\r\n  \/\/ Set the light threshold to 0 lux.range: 0-50 lux\r\n  if (c4002.setLightThresh(0)) {\r\n    \/\/Serial.println(&quot;Set light threshold success!&quot;);\r\n  } else {\r\n    Serial.println(&quot;Set light threshold failed!&quot;);\r\n  }\r\n  delay(50);\r\n\r\n  \/\/ Resolution mode:eResolution20Cm\r\n  \/\/ Enable the &#039;distance gate&#039;\r\n  \/\/ Resolution mode:eResolution20Cm,This means that the number of &#039;distance gates&#039; \r\n  \/\/ we can operate is 25\r\n  \/\/disable : C4002_DISABLE, enable: C4002_ENABLE\r\n  uint8_t gateState[25] = { C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, \r\n  C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE,\r\n   C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, \r\n   C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE,\r\n   C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE, C4002_ENABLE };\r\n\r\n  \/\/ Operation motion distance gate\r\n  if (c4002.configureGate(eMotionDistGate, gateState)) { \r\n    \/\/Serial.println(&quot;Enable motion distance gate success!&quot;);\r\n  }\r\n\r\n  \/\/ Delay\r\n  delay(50);\r\n\r\n  \/\/ Operation presence distance gate\r\n  if (c4002.configureGate(ePresenceDistGate, gateState)) { \r\n    \/\/Serial.println(&quot;Enable presence distance gate success!&quot;);\r\n  }\r\n  \r\n  \/\/ Delay\r\n  delay(50);\r\n\r\n  \/\/ Set the target disappear delay time to 1s\uff0crange: 0-65535s\r\n  if (c4002.setTargetDisappearDelay(1)) {\r\n    \/\/Serial.println(&quot;Set target disappear delay time success!&quot;);\r\n  } else {\r\n    Serial.println(&quot;Set target disappear delay time failed!&quot;);\r\n  }\r\n \r\n  \/\/ Delay\r\n  delay(50);\r\n\r\n  \/\/ Set the report period to 10 * 0.1s = 1s\r\n  if (c4002.setReportPeriod(10)) {\r\n    \/\/Serial.println(&quot;Set report period success!&quot;);\r\n  } else {\r\n    Serial.println(&quot;Set report period failed!&quot;);\r\n  }\r\n\r\n}\r\n\/\/ isC4002\r\nvoid isC4002(){\r\n\r\n  \/\/ Get all the results of the C4002 sensor\r\n  sRetResult_t retResult = c4002.getNoteInfo();\r\n\r\n  if (retResult.noteType == eResult) {\r\n    \/\/Serial.println(&quot;------- Get all results --------&quot;);\r\n    \/\/ get the light intensity\r\n    float light = c4002.getLightIntensity();\r\n    \/\/Serial.print(&quot;Light: &quot;);\r\n    \/\/Serial.print(light);\r\n    \/\/Serial.println(&quot; lux&quot;);\r\n    sLight = light;\r\n\r\n    \/\/ get Target state\r\n    eTargetState_t targetState = c4002.getTargetState();\r\n    \/\/Serial.print(&quot;Target state: &quot;);\r\n    if (targetState == eNoTarget) {\r\n\r\n      \/\/Serial.println(&quot;No Target&quot;);\r\n      sTarget = &quot;No Target&quot;;\r\n\r\n    } else if (targetState == ePresence) {\r\n      \r\n      \/\/Serial.println(&quot;Static Presence&quot;);\r\n      sTarget = &quot;Static Presence&quot;;\r\n\r\n    } else if (targetState == eMotion) {\r\n      \r\n      \/\/Serial.println(&quot;Motion&quot;);\r\n      sTarget = &quot;Motion&quot;;\r\n\r\n    }\r\n\r\n    \/\/ Get Presence distance gate target info\r\n    sPresenceTarget_t presenceTarget = c4002.getPresenceTargetInfo();\r\n    \/\/Serial.print(&quot;Presence distance: &quot;);\r\n    \/\/Serial.print(presenceTarget.distance);\r\n    sPreDis = presenceTarget.distance;\r\n    \/\/Serial.println(&quot; m&quot;);\r\n\r\n    \/\/ Get motion distance gate index\r\n    sMotionTarget_t motionTarget = c4002.getMotionTargetInfo();\r\n\r\n    \/\/Serial.print(&quot;Motion direction: &quot;);\r\n    if (motionTarget.direction == eAway) {\r\n      \r\n      \/\/Serial.println(&quot;Away!&quot;);\r\n      sMot = &quot;Away!&quot;;\r\n\r\n    } else if (motionTarget.direction == eNoDirection) {\r\n      \r\n      \/\/Serial.println(&quot;No Direction!&quot;);\r\n      sMot = &quot;No Direction!&quot;;\r\n\r\n    } else if (motionTarget.direction == eApproaching) {\r\n      \r\n      \/\/Serial.println(&quot;Approaching!&quot;);\r\n      sMot = &quot;Approaching!&quot;;\r\n\r\n    }\r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>getDisplay.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ DFRobot Display 320x480\r\n\/\/ DFRobot Display 320x480 - UID\r\nvoid isDisplayUID(){\r\n\r\n  \/\/ DFRobot Display 240x320\r\n  \/\/ Text Display\r\n  \/\/ Text Wrap\r\n  screen.setTextWrap(false);\r\n  \/\/ Rotation\r\n  screen.setRotation(3);\r\n  \/\/ Fill Screen =&gt; black\r\n  screen.fillScreen(0x0000);\r\n  \/\/ Text Color =&gt; white\r\n  screen.setTextColor(0xffff);\r\n    \/\/ Font =&gt; Free Sans Bold 12pt\r\n  screen.setFont(&amp;FreeSansBold12pt7b);\r\n  \/\/ TextSize =&gt; 1.5\r\n  screen.setTextSize(1.5);\r\n  \/\/ Don Luc Electronics\r\n  screen.setCursor(0, 30);\r\n  screen.println(&quot;Don Luc Electronics&quot;);\r\n  \/\/ BME280 Environmental\r\n  screen.setCursor(0, 60);\r\n  screen.println(&quot;Real-Time Clock&quot;);\r\n  \/\/ Version\r\n  screen.setCursor(0, 90);\r\n  screen.println(&quot;Version&quot;);\r\n  screen.setCursor(0, 120);\r\n  screen.println( sver );\r\n\r\n}\r\n\/\/ isDisplay C4002\r\nvoid isDisplayC4002(){\r\n\r\n  \/\/ DFRobot Display 320x480\r\n  \/\/ Text Display\r\n  \/\/ Text Wrap\r\n  screen.setTextWrap(false);\r\n  \/\/ Rotation\r\n  screen.setRotation(3);\r\n  \/\/ Fill Screen =&gt; white\r\n  screen.fillScreen(0xffff);\r\n  \/\/ Text Color =&gt; blue\r\n  screen.setTextColor(0x001F);\r\n    \/\/ Font =&gt; Free Sans Bold 12pt\r\n  screen.setFont(&amp;FreeSansBold12pt7b);\r\n  \/\/ TextSize =&gt; 1.5\r\n  screen.setTextSize(1.5);\r\n  \/\/ ENS160 Air Quality Sensor\r\n  screen.setCursor(0, 30);\r\n  screen.println(&quot;Real-Time Clock&quot;);\r\n  \/\/ Status\r\n  screen.setCursor(0, 60);\r\n  screen.print(&quot;Light &quot;);\r\n  screen.setCursor(70, 60);\r\n  screen.print( sLight );\r\n  screen.setCursor(250, 60);\r\n  screen.println(&quot;lux&quot;);\r\n  \/\/ Target\r\n  screen.setCursor(0, 90);\r\n  screen.print(&quot;Target &quot;);\r\n  screen.setCursor(90, 90);\r\n  screen.println( sTarget );\r\n  \/\/ Presence\r\n  screen.setCursor(0, 120);\r\n  screen.print(&quot;Presence: &quot;);\r\n  screen.setCursor(130, 120);\r\n  screen.println( sPreDis );\r\n  screen.setCursor(250, 120);\r\n  screen.println( &quot;CM&quot; );\r\n  \/\/ Motion\r\n  screen.setCursor(0, 150);\r\n  screen.print(&quot;Motion: &quot;);\r\n  screen.setCursor(110, 150);\r\n  screen.println( sMot );\r\n  \/\/ Temperature\r\n  screen.setCursor(0, 180);\r\n  screen.print(&quot;Temperature: &quot;);\r\n  screen.setCursor(170, 180);\r\n  screen.println( temp );\r\n  screen.setCursor(250, 180);\r\n  screen.println( &quot;C&quot; );\r\n  \/\/ Humidity\r\n  screen.setCursor(0, 210);\r\n  screen.print(&quot;Humidity: &quot;);\r\n  screen.setCursor(170, 210);\r\n  screen.println( humi );\r\n  screen.setCursor(250, 210);\r\n  screen.println( &quot;%&quot; );\r\n  \/\/ TVOC - Return value range: 0\u201365000, unit: ppb\r\n  screen.setCursor(0, 240);\r\n  screen.print(&quot;TVOC: &quot;);\r\n  screen.setCursor(140, 240);\r\n  screen.println( TVOC );\r\n  screen.setCursor(250, 240);\r\n  screen.println( &quot;ppb&quot; );\r\n  \/\/ ECO2 = Return value range: 400\u201365000, unit: ppm\r\n  \/\/ Five levels: Excellent(400 - 600), Good(600 - 800), Moderate(800 - 1000), \r\n  \/\/ Poor(1000 - 1500), Unhealthy(&gt; 1500)\r\n  screen.setCursor(0, 270);\r\n  screen.print(&quot;ECO2: &quot;);\r\n  screen.setCursor(140, 270);\r\n  screen.println( ECO2 );\r\n  screen.setCursor(250, 270);\r\n  screen.println( &quot;ppb&quot; );\r\n  \/\/ Real-Time Clock\r\n  screen.setCursor(0, 300);\r\n  screen.print( dateRTC );\r\n  screen.setCursor(250, 300);\r\n  screen.println( timeRTC );\r\n  \/\/screen.setCursor(250, 270);\r\n  \/\/screen.println( &quot;ppb&quot; );\r\n\r\n}\r\n<\/pre>\n<p><strong>getENS160.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ ENS160 Air Quality Sensor\r\n\/\/ isENS160\r\nvoid isENS160(){\r\n\r\n  \/\/ Status - Return value: 0-Normal operation 1-Warm-Up phase \r\n  \/\/ 2-Initial Start-Up phase\r\n  Status = ENS160.getENS160Status();\r\n\r\n  \/\/ AQI - Return value: 1-Excellent, 2-Good, 3-Moderate, 4-Poor, 5-Unhealthy\r\n  AQI = ENS160.getAQI();\r\n\r\n  \/\/ TVOC - Return value range: 0\u201365000, unit: ppb\r\n  TVOC = ENS160.getTVOC();\r\n\r\n  \/\/ ECO2 = Return value range: 400\u201365000, unit: ppm\r\n  \/\/ Five levels: Excellent(400 - 600), Good(600 - 800), Moderate(800 - 1000), \r\n  \/\/ Poor(1000 - 1500), Unhealthy(&gt; 1500)\r\n  ECO2 = ENS160.getECO2();\r\n\r\n}\r\n<\/pre>\n<p><strong>getRTC.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Real-Time Clock\r\n\/\/ Date and Time RTC\r\nvoid isRTC () {\r\n\r\n  \/\/ Date and Time\r\n  dateRTC = &quot;&quot;;\r\n  timeRTC = &quot;&quot;;\r\n  rtc.read();\r\n  \r\n  \/\/ Date\r\n  dateRTC = rtc.year; \r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  dateRTC = dateRTC + rtc.month;\r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  dateRTC = dateRTC + rtc.day;\r\n\r\n  \/\/ Time\r\n  timeRTC = rtc.hour;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  timeRTC = timeRTC + rtc.minute;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  timeRTC = timeRTC + rtc.second;\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  \/\/ Delay\r\n  delay(100);\r\n\r\n  Serial.begin(115200);\r\n\r\n    \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ C4002 mmWave Human Presence\r\n  isSetupC4002();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ BME280 Environmental\r\n  bme.begin();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ ENS160 Air Quality Sensor\r\n  ENS160.begin();\r\n  \/**\r\n   * Set power mode\r\n   * mode Configurable power mode:\r\n   * ENS160_SLEEP_MODE: DEEP SLEEP mode (low power standby)\r\n   * ENS160_IDLE_MODE: IDLE mode (low-power)\r\n   * ENS160_STANDARD_MODE: STANDARD Gas Sensing Modes\r\n   *\/\r\n  ENS160.setPWRMode(ENS160_STANDARD_MODE);\r\n\r\n  \/**\r\n   * Users write ambient temperature and relative humidity into ENS160 for\r\n   * calibration and compensation of the measured gas data.\r\n   * ambientTemp Compensate the current ambient temperature, float type, unit: C\r\n   * relativeHumidity Compensate the current ambient humidity, float type, unit: %rH\r\n   * Temperature\r\n   * Humidity=\r\n   *\/\r\n  ENS160.setTempAndHum(temp, humi);\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ Setup RTC\r\n  rtc.setup();\r\n\r\n  \/\/Set the RTC time automatically: Calibrate RTC time by your computer time\r\n  rtc.adjustRtc(F(__DATE__), F(__TIME__));\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ DFRobot Display 320x480\r\n  screen.begin();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ DFRobot Display 320x480 - UID\r\n  \/\/ Don Luc Electronics\r\n  \/\/ Versioc\r\n  isDisplayUID();\r\n  \r\n  \/\/ Delay\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>Consultant, R&#038;D, Electronics, IoT, Teacher and Instructor<\/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 , Underwater and UAV Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial,  Marine and UAV<\/li>\n<li>Machine Learning<\/li>\n<li>Artificial Intelligence (AI)<\/li>\n<li>RTOS<\/li>\n<li>Sensors, 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; 2026<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/LucPaquinCVEng2026Mk01.pdf<br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.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>DFRobot:<\/strong> https:\/\/learn.dfrobot.com\/user-10186.html<br \/>\n<strong>TikTok:<\/strong> https:\/\/www.tiktok.com\/@luc.paquin8<br \/>\n<strong>Hackster:<\/strong> https:\/\/www.hackster.io\/luc-paquin<br \/>\n<strong>LinkedIn:<\/strong> https:\/\/www.linkedin.com\/in\/jlucpaquin\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #RTC #C4002 #BME280 #ENS160 #Environment #FireBeetle2ESP32E #ESP32 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212; &#8212;&#8212; Gravity: I2C SD2405 RTC Module The I2C SD2405 RTC module features accurate real-time clock, dual power supply, low power consumption, periodic interrupts, and a high precision time trimming circuit. The SD2405AL is dual &#8230; <a title=\"Project #15: Environment \u2013 RTC \u2013 Mk50\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=4984\" aria-label=\"Read more about Project #15: Environment \u2013 RTC \u2013 Mk50\">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":[106,50,49,317,38,80,59,115,5,287,58,82,10],"tags":[6,92,102,4,320,87,19,107,83,85,24,93,9,84,27,332,248,33,34,108],"class_list":["post-4984","post","type-post","status-publish","format-standard","hentry","category-environment","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-components","tag-consultant","tag-dfrobot","tag-display","tag-electronics","tag-environment","tag-esp32","tag-fritzing","tag-microcontroller","tag-pir-motion-sensor","tag-programming","tag-programming-esp32","tag-projects-2","tag-rtc","tag-sensors","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4984","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=4984"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4984\/revisions"}],"predecessor-version":[{"id":4989,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4984\/revisions\/4989"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}