The Alpha Geek – Geeking Out

ESP32

1 2 3 9

Project #29 – DFRobot – RTC – Mk31

——

#DonLucElectronics #DonLuc #DFRobot #RTC #SD #ASM #SHTC3 #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #SparkFun #Adafruit #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

RTC

——

RTC

——

RTC

——

Real-Time Clock

A Real-Time Clock (RTC) is an electronic device, most often in the form of an integrated circuit, that measures the passage of time. Although the term often refers to the devices in personal computers, servers and embedded systems, RTCs are present in almost any electronic device which needs to keep accurate time of day.

Although keeping time can be done without an RTC, using one has benefits:

  • Reliably maintains and provides current time through disruptive system states such as hangs, sleep, reboots, or if given sufficient backup power, full shutdown and hardware reassembly, without the need to have its time set again.
  • Low power consumption, important when running from alternate power.
  • Frees the main system for time-critical tasks.
  • Sometimes more accurate than other methods.

DL2409Mk08

1 x FireBeetle 2 ESP32-C6
1 x Adalogger FeatherWing – RTC + SD
1 x CR1220 3 Volt Lithium Coin Cell Battery
1 x Fermion: SHTC3 Temperature & Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Gravity: Analog Soil Moisture Sensor
1 x 3 AAA Battery Holder with On/Off Switch and 2-Pin JST
3 x AAA Battery
1 x SparkFun Solderable Breadboard – Large
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

SCL – 20
SDA – 19
ASM – A1
LED – 15
DC – D2
CS – D6
RST – D3
VIN – +3.3V
GND – GND

DL2409Mk08p

DL2409Mk08p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - RTC - Mk31
29-31
DL2409Mk08p.ino
DL2409Mk08
1 x FireBeetle 2 ESP32-C6
1 x Adalogger FeatherWing - RTC + SD
1 x CR1220 3 Volt Lithium Coin Cell Battery
1 x Fermion: SHTC3 Temperature & Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Gravity: Analog Soil Moisture Sensor
1 x 3 AAA Battery Holder with On/Off Switch and 2-Pin JST
3 x AAA Battery
1 x SparkFun Solderable Breadboard - Large
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Fermion: SHTC3 Temperature & Humidity Sensor
#include"DFRobot_SHTC3.h"
// Date and Time Functions PCF8523 RTC
#include <RTClib.h>

// Date and Time PCF8523 RTC
RTC_PCF8523 rtc;
String dateRTC = "";
String timeRTC = "";

// Fermion: SHTC3 Temperature & Humidity Sensor
DFRobot_SHTC3 SHTC3;
uint32_t id = 0;
float temperature;
float humidity;

// Defined ESP32
#define TFT_DC  D2
#define TFT_CS  D6
#define TFT_RST D3

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// Gravity: Analog Soil Moisture Sensor
int iSoilMoisture = A1;
int iSoilMoistureVal = 0;
int zz = 0;
// Change Your Threshold Here
int Threshold = 300;
String SM = "";

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-31";

void loop() {

  // Date and Time PCF8523 RTC
  isRTC();
  
  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();
  
  // Gravity: Analog Soil Moisture Sensor
  isSoilMoisture();

  // DFRobot Display 240x320 - ASM - Temperature and Humidity - Date and Time
  isDisplayTH();

  // Delay 5 Second
  delay( 5000 );

}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - ASM - Temperature and Humidity
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Soil Moisture Sensor
    screen.setCursor(0, 30);
    screen.println("Soil Moisture Sensor");
    // Date and Time
    screen.setCursor(0, 60);
    screen.println( dateRTC + " - " + timeRTC );
    // Gravity: Analog Soil Moisture Sensor
    screen.setCursor(0, 90);
    screen.println( "ASM: " );
    screen.setCursor(60, 90);
    screen.println( iSoilMoistureVal );
    screen.setCursor(0, 120);
    screen.println( SM );
    // SHTC3 Temperature
    screen.setCursor(0, 150);
    screen.println( "Tem: " );
    screen.setCursor(60, 150);
    screen.println( temperature );
    screen.setCursor(120, 150);
    screen.println( "C" );
    // SHTC3 Humidity
    screen.setCursor(0, 180);
    screen.println( "Hum: " );
    screen.setCursor(60, 180);
    screen.println( humidity );
    screen.setCursor(120, 180);
    screen.println( "%RH" );

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getRTC.ino

// Date and Time PCF8523 RTC 
// Setup Date and Time PCF8523 RTC 
void isSetupRTC() {

  // Date and Time PCF8523 RTC   
  if (! rtc.begin()) {
    while (1);
  }  
  if (! rtc.initialized()) {
    
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2024, 9, 26, 9, 1, 0));
    
  }

  // When the RTC was stopped and stays connected to the battery, it has
  // to be restarted by clearing the STOP bit. Let's do this to ensure
  // the RTC is running.
  rtc.start();

   // The PCF8523 can be calibrated for:
  //  - Aging adjustment
  //  - Temperature compensation
  //  - Accuracy tuning
  // The offset mode to use, once every two hours or once every minute.
  // The offset Offset value from -64 to +63. 
  // See the Application Note for calculation of offset values.
  // https://www.nxp.com/docs/en/application-note/AN11247.pdf
  // The deviation in parts per million can be calculated over 
  // a period of observation. Both the drift (which can be negative)
  // and the observation period must be in seconds. For accuracy 
  // the variation should be observed over about 1 week.
  // Note: any previous calibration should cancelled prior to 
  // any new observation period.
  // Seconds plus or minus over oservation period - set to 
  // 0 to cancel previous calibration.
  float drift = 43;
  // total obsevation period in seconds (86400 = seconds in 1 day: 
  // 7 days = (7 * 86400) seconds )
  float period_sec = (7 * 86400);
  // Deviation in parts per million (μs)
  float deviation_ppm = (drift / period_sec * 1000000);
  // Use with offset mode PCF8523_TwoHours
  float drift_unit = 4.34;
  //For corrections every min the drift_unit is 4.069 ppm 
  // (use with offset mode PCF8523_OneMinute)
  // float drift_unit = 4.069; 
  int offset = round(deviation_ppm / drift_unit);

}
// Date and Time PCF8523 RTC 
void isRTC () {

  // Date and Time
  DateTime now = rtc.now();
  // Date
  dateRTC = now.year(), DEC; 
  dateRTC = dateRTC + "/";
  dateRTC = dateRTC + now.month(), DEC;
  dateRTC = dateRTC + "/";
  dateRTC = dateRTC + now.day(), DEC;
  // Time
  timeRTC = now.hour(), DEC;
  timeRTC = timeRTC + ":";
  timeRTC = timeRTC + now.minute(), DEC;
  timeRTC = timeRTC + ":";
  timeRTC = timeRTC + now.second(), DEC;
  
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  /**
   *    Mode  For configuring sensor working mode    
   *    SHTC3:
           PRECISION_HIGH_CLKSTRETCH_ON Clock Stretching Enabled 
   *       PRECISION_HIGH_CLKSTRETCH_OFF Clock Stretching Disabled 
   *       PRECISION_LOW_CLKSTRETCH_ON Clock Stretching Enabled & Low Power
   *       PRECISION_LOW_CLKSTRETCH_OFF Clock Stretching Disabled & Low Power
   */
  temperature = SHTC3.getTemperature(PRECISION_HIGH_CLKSTRETCH_ON);
  /**
   *    Mode  For configuring sensor working mode 
   *    SHTC3
   *       PRECISION_HIGH_CLKSTRETCH_ON Clock Stretching Enabled 
   *       PRECISION_HIGH_CLKSTRETCH_OFF Clock Stretching Disabled 
   *       PRECISION_LOW_CLKSTRETCH_ON Clock Stretching Enabled & Low Power
   *       PRECISION_LOW_CLKSTRETCH_OFF Clock Stretching Disabled & Low Power
   */
  humidity = SHTC3.getHumidity(PRECISION_HIGH_CLKSTRETCH_OFF);

}

getSoilMoisture.ino

// Gravity: Analog Soil Moisture Sensor
// Soil Moisture
void isSoilMoisture(){

  // Connect Soil Moisture Sensor to Analog 0
  zz = analogRead( iSoilMoisture );

  // iSoilMoistureVal => 0~900 Soil Moisture
  iSoilMoistureVal = map( zz, 0, 4095, 0, 900);

  // Threshold
  if (iSoilMoistureVal > Threshold)

    // 300~950 - Humid Soil
    SM = "Humid Soil";
    
  else {
    
    // 0-300 Dry Soil
    SM = "Dry Soil";

  }

}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // Fermion: SHTC3 Temperature & Humidity Sensor
  SHTC3.begin();
  /*SHTC3 is set to sleep mode by default. Please wake it up before use. 
  Use SHTC3.sleep() to let SHTC3 enter sleep mode; SHTC3 
  stops working in sleep mode*/
  SHTC3.wakeup();
  
  // Delay
  delay(100);

  // Setup Date and Time PCF8523 RTC 
  isSetupRTC();

  // Date and Time PCF8523 RTC
  isRTC();

  // Delay
  delay(100);

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Electronics, IoT, Teacher, Instructor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
DFRobot Luc.Paquin: https://edu.dfrobot.com/dashboard/makelogs
Hackster.io: https://www.hackster.io/neosteam-labs
ELECROW: https://www.elecrow.com/share/sharepj/center/no/760816d385ebb1edc0732fd873bfbf13
TikTok: www.tiktok.com/@luc.paquin8
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – Soil Moisture – Mk29

——

#DonLucElectronics #DonLuc #DFRobot #ASM #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Soil Moisture

——

Soil Moisture

——

Soil Moisture

——

Soil Moisture

Soil moisture is the critical parameter in agriculture. If there is a shortage or overabundance of water, plants may die. At the same time, this data depends on many external factors, primarily weather conditions and climate changes. That is why it is so vital to understand the most effective methods for analyzing soil moisture content.

This term refers to the entire quantity of water in the ground’s pores or on its surface. The moisture content of soil depends on such factors as weather, type of land, and plants. The parameter is vital in monitoring soil moisture activities, predicting natural disasters, managing water supply, etc. This data may signal a future flood or water deficit ahead of other indicators.

DL2409Mk04

1 x FireBeetle 2 ESP32-C6
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Gravity: Analog Soil Moisture Sensor
1 x 3 AAA Battery Holder with On/Off Switch and 2-Pin JST
3 x AAA Battery
1 x SparkFun Solderable Breadboard – Large
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

ASM – A1
LED – 15
DC – D2
CS – D6
RST – D3
VIN – +3.3V
GND – GND

DL2409Mk04p

DL2409Mk04p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - Soil Moisture - Mk29
29-29
DL2409Mk04p.ino
DL2409Mk04
1 x FireBeetle 2 ESP32-C6
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Gravity: Analog Soil Moisture Sensor
1 x 3 AAA Battery Holder with On/Off Switch and 2-Pin JST
3 x AAA Battery
1 x SparkFun Solderable Breadboard - Large
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// DFRobot Display GDL API
#include <DFRobot_GDL.h>

// Defined ESP32
#define TFT_DC  D2
#define TFT_CS  D6
#define TFT_RST D3

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// Gravity: Analog Soil Moisture Sensor
int iSoilMoisture = A1;
int iSoilMoistureVal = 0;
int zz = 0;
// Change Your Threshold Here
int Threshold = 300;
String SM = "";

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-29";

void loop() {

  // Gravity: Analog Soil Moisture Sensor
  isSoilMoisture();

  // DFRobot Display 240x320 - ASM
  isDisplayTH();

  // Delay 5 Second
  delay( 5000 );

}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - ASM
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Soil Moisture Sensor");
    // Gravity: Analog Soil Moisture Sensor
    screen.setCursor(0, 60);
    screen.println( "ASM: " );
    screen.setCursor(60, 60);
    screen.println( iSoilMoistureVal );
    screen.setCursor(0, 90);
    screen.println( SM );

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSoilMoisture.ino

// Gravity: Analog Soil Moisture Sensor
// Soil Moisture
void isSoilMoisture(){

  // Connect Soil Moisture Sensor to Analog 0
  zz = analogRead( iSoilMoisture );

  // iSoilMoistureVal => 0~900 Soil Moisture
  iSoilMoistureVal = map( zz, 0, 4095, 0, 900);

  // Threshold
  if (iSoilMoistureVal > Threshold)

    // 300~950 - Humid Soil
    SM = "Humid Soil";
    
  else {
    
    // 0-300 Dry Soil
    SM = "Dry Soil";

  }

}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
DFRobot Luc.Paquin: https://edu.dfrobot.com/dashboard/makelogs
Hackster.io: https://www.hackster.io/neosteam-labs
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – Soil Moisture Sensor – Mk28

——

#DonLucElectronics #DonLuc #DFRobot #ASM #Smoke #CH4 #VOC #SHTC3 #SD #FireBeetle2ESP32E #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Soil Moisture Sensor

——

Soil Moisture Sensor

——

Soil Moisture Sensor

——

Gravity: Analog Soil Moisture Sensor

A soil moisture sensor can read the amount of moisture present in the soil surrounding it. It’s an ideal for monitoring an urban garden, or your pet plant’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. This soil moisture arduino 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.

DL2409Mk02

1 x DFRobot FireBeetle 2 ESP32-E
1 x Gravity: Analog Soil Moisture Sensor
1 x Adafruit MicroSD card breakout board+
1 x MicroSD 2 GB
1 x Fermion: MEMS Smoke Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Lithium Ion Battery – 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-E

VOC – A1
CH4 – A2
SMO – A3
ASM – A4
LED – 2
SCK – 18
MOSI – 23
MISO – 19
CS – 13
SCL – 22
SDA – 21
DC – D2
CS – D6
RST – D3
VIN – +3.3V
GND – GND

DL2409Mk02p

DL2409Mk02p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - Soil Moisture Sensor - Mk28
29-28
DL2409Mk02p.ino
DL2409Mk02
1 x DFRobot FireBeetle 2 ESP32-E
1 x Gravity: Analog Soil Moisture Sensor
1 x Adafruit MicroSD card breakout board+
1 x MicroSD 2 GB
1 x Fermion: MEMS Smoke Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Lithium Ion Battery - 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// SHTC3 Temperature and Humidity Sensor
#include "SHTSensor.h"
// SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

// Gravity: Analog Soil Moisture Sensor
int iSoilMoisture = A4;
int iSoilMoistureVal = 0;
int zz = 0;

// MEMS Smoke Gas
int iSensorSmoke = A3;
int iSensorValueSmoke = 0;
int z = 0;

// MEMS CH4 Gas
int iSensorCH4 = A2;
int iSensorValueCH4 = 0;
int y = 0;

// MEMS VOC Gas
int iSensorVOC = A1;
int iSensorValueVOC = 0;
int x = 0;

// MicroSD Card
const int chipSelect = 13;
String zzzzzz = "";

// SHTC3 Temperature and Humidity Sensor
SHTSensor sht;
// Temperature
float T;
// Humidity
float H;

// Defined ESP32
#define TFT_DC  D2
#define TFT_CS  D6
#define TFT_RST D3

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// LED Green
int iLEDGreen = 2;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-28";

void loop() {

  // Gravity: Analog Soil Moisture Sensor
  isSoilMoisture();
  
  // MEMS Smoke Gas
  isSmoke();
  
  // MEMS CH4 Gas
  isCH4();
  
  // MEMS VOC Gas
  isVOC();
  
  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();

  // DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4, Smoke
  isDisplayTH();

  // MicroSD Card
  isSD();

  // Delay 5 Second
  delay( 5000 );

}

getCH4.ino

// MEMS CH4 Gas
// is CH4
void isCH4(){

  // MEMS CH4 Gas
  y = analogRead( iSensorCH4 );
  iSensorValueCH4 = map(y, 1, 4095, 1, 10000);
  
}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4, Smoke
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Don Luc Electronics");
    // Temperature
    screen.setCursor(0, 60);
    screen.println( "Temp: " );
    screen.setCursor(60, 60);
    screen.println( T );
    screen.setCursor(130, 60);
    screen.println("Celsius");
    // Humidity
    screen.setCursor(0, 90);
    screen.println("Humi: ");
    screen.setCursor(60, 90);
    screen.println( H );
    screen.setCursor(130, 90);
    screen.println("% RH");
    // MEMS VOC Gas
    screen.setCursor(0, 120);
    screen.println( "VOC: " );
    screen.setCursor(60, 120);
    screen.println( iSensorValueVOC );
    screen.setCursor(130, 120);
    screen.println("ppm");
    // MEMS CH4 Gas
    screen.setCursor(0, 150);
    screen.println( "CH4: " );
    screen.setCursor(60, 150);
    screen.println( iSensorValueCH4 );
    screen.setCursor(130, 150);
    screen.println("ppm");
    // MEMS Smoke Gas
    screen.setCursor(0, 180);
    screen.println( "SMO: " );
    screen.setCursor(60, 180);
    screen.println( iSensorValueSmoke );
    screen.setCursor(130, 180);
    screen.println("ppm");
    // Gravity: Analog Soil Moisture Sensor
    screen.setCursor(0, 210);
    screen.println( "ASM: " );
    screen.setCursor(60, 210);
    screen.println( iSoilMoistureVal );
    screen.setCursor(130, 210);

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSD.ino

// MicroSD Card
// MicroSD Setup
void isSetupSD() {

    // MicroSD Card
    pinMode( chipSelect , OUTPUT );
    if(!SD.begin( chipSelect )){
        ;  
        return;
    }
    
    uint8_t cardType = SD.cardType();

    // CARD NONE
    if(cardType == CARD_NONE){
        ; 
        return;
    }

    // SD Card Type
    if(cardType == CARD_MMC){
        ; 
    } else if(cardType == CARD_SD){
        ; 
    } else if(cardType == CARD_SDHC){
        ; 
    } else {
        ; 
    } 

    // Size
    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
 
}
// MicroSD Card
void isSD() {

  zzzzzz = "";

  //DFR|EEPROM Unique ID|Version|
  //Temperature C|% RH|VOC|CH4|Smoke|Soil Moisture|*\r
  zzzzzz = "DFR|" + uid + "|" + sver + "|"
  + String( T ) + "|" + String( H ) + "|"
  + String( iSensorValueVOC ) + "|" + String( iSensorValueCH4 ) + "|"
  + String( iSensorValueSmoke ) + "|" + String( iSoilMoistureVal ) + "|*\r";;

  // msg + 1
  char msg[zzzzzz.length() + 1];

  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);

  // Append File
  appendFile(SD, "/dfrdata.txt", msg );
  
}
// List Dir
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    
    // List Dir
    dirname;
    
    File root = fs.open(dirname);
    
    if(!root){
        return;
    }
    
    if(!root.isDirectory()){
        return;
    }

    File file = root.openNextFile();
    
    while(file){
        if(file.isDirectory()){
            file.name();
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            file.name();
            file.size();
        }
        file = root.openNextFile();
    }
    
}
// Write File
void writeFile(fs::FS &fs, const char * path, const char * message){
    
    // Write File
    path;
    
    File file = fs.open(path, FILE_WRITE);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}
// Append File
void appendFile(fs::FS &fs, const char * path, const char * message){
    
    // Append File
    path;
    
    File file = fs.open(path, FILE_APPEND);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  if (sht.readSample()) {
     
     // Temperature
     T = sht.getTemperature();
     // Humidity
     H = sht.getHumidity();

  }

}

getSmoke.ino

// Smoke
// isSmoke
void isSmoke(){

  // MEMS Smoke Gas
  z = analogRead( iSensorSmoke );
  iSensorValueSmoke = map(x, 1, 4095, 1, 1000);
  
}

getSoilMoisture.ino

// Gravity: Analog Soil Moisture Sensor
// Soil Moisture
void isSoilMoisture(){

  // Connect Soil Moisture Sensor to Analog 4
  zz = analogRead( iSoilMoisture );

  // iSoilMoistureVal => 0~900 Soil Moisture
  iSoilMoistureVal = map( zz, 0, 4095, 0, 900);

}

getVOC.ino

// MEMS VOC Gas
// is VOC
void isVOC(){

  // MEMS VOC Gas
  x = analogRead( iSensorVOC );
  iSensorValueVOC = map(x, 1, 4095, 1, 500);
  
}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );

  // SHTC3 Temperature and Humidity Sensor
  sht.init();
  // SHT3x
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // MicroSD Card
  isSetupSD();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
DFRobot Luc.Paquin: https://edu.dfrobot.com/dashboard/makelogs
Hackster.io: https://www.hackster.io/neosteam-labs
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – Micro SD Card Breakout Board – Mk27

——

#DonLucElectronics #DonLuc #DFRobot #Smoke #CH4 #VOC #SHTC3 #SD #FireBeetle2ESP32E #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Micro SD Card Breakout Board

——

Micro SD Card Breakout Board

——

Micro SD Card Breakout Board

——

Adafruit MicroSD card breakout board+

Not just a simple breakout board, this microSD adapter goes the extra mile, designed for ease of use.

  • Onboard 5 Volt -> 3 Volt regulator provides 150mA for power-hungry cards
  • 3 Volt level shifting means you can use this with ease on either 3 Volt or 5 Volt systems
  • Uses a proper level shifting chip, not resistors: less problems, and faster read/write access
  • Use 3 or 4 digital pins to read and write 2Gb+ of storage
  • Activity LED lights up when the SD card is being read or written
  • Four #2 mounting holes
  • Push-push socket with card slightly over the edge of the PCB so its easy to insert and remove
  • Comes with 0.1″ header, unattached, so you can get it on a breadboard or use wires, your choice
  • Tested and assembled here at the Adafruit factory
  • Works great with Arduino, with tons of example code and wiring diagrams

DL2408Mk06

1 x DFRobot FireBeetle 2 ESP32-E
1 x Adafruit MicroSD card breakout board+
1 x MicroSD 2 GB
1 x Fermion: MEMS Smoke Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Lithium Ion Battery – 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-E

VOC – A1
CH4 – A2
SMO – A3
LED – 2
SCK – 18
MOSI – 23
MISO – 19
CS – 13
SCL – 22
SDA – 21
DC – D2
CS – D6
RST – D3
VIN – +3.3V
GND – GND

DL2408Mk06p

DL2408Mk06p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - Micro SD Card Breakout Board - Mk27
29-27
DL2408Mk06p.ino
DL2408Mk06
1 x DFRobot FireBeetle 2 ESP32-E
1 x Adafruit MicroSD card breakout board+
1 x MicroSD 2 GB
1 x Fermion: MEMS Smoke Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Lithium Ion Battery - 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// SHTC3 Temperature and Humidity Sensor
#include "SHTSensor.h"
// SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

// MEMS Smoke Gas
int iSensorSmoke = A3;
int iSensorValueSmoke = 0;
int z = 0;

// MEMS CH4 Gas
int iSensorCH4 = A2;
int iSensorValueCH4 = 0;
int y = 0;

// MEMS VOC Gas
int iSensorVOC = A1;
int iSensorValueVOC = 0;
int x = 0;

// MicroSD Card
const int chipSelect = 13;
String zzzzzz = "";

// SHTC3 Temperature and Humidity Sensor
SHTSensor sht;
// Temperature
float T;
// Humidity
float H;

// Defined ESP32
#define TFT_DC  D2
#define TFT_CS  D6
#define TFT_RST D3

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// LED Green
int iLEDGreen = 2;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-27";

void loop() {

  // MEMS Smoke Gas
  isSmoke();
  
  // MEMS CH4 Gas
  isCH4();
  
  // MEMS VOC Gas
  isVOC();
  
  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();

  // DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4, Smoke
  isDisplayTH();

  // MicroSD Card
  isSD();

  // Delay 5 Second
  delay( 5000 );

}

getCH4.ino

// MEMS CH4 Gas
// is CH4
void isCH4(){

  // MEMS CH4 Gas
  y = analogRead( iSensorCH4 );
  iSensorValueCH4 = map(y, 1, 4095, 1, 10000);
  
}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4, Smoke
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 60);
    screen.println( sver );
    // Temperature
    screen.setCursor(0, 90);
    screen.println( "Temp: " );
    screen.setCursor(60, 90);
    screen.println( T );
    screen.setCursor(130, 90);
    screen.println("Celsius");
    // Humidity
    screen.setCursor(0, 120);
    screen.println("Humi: ");
    screen.setCursor(60, 120);
    screen.println( H );
    screen.setCursor(130, 120);
    screen.println("% RH");
    // MEMS VOC Gas
    screen.setCursor(0, 150);
    screen.println( "VOC: " );
    screen.setCursor(60, 150);
    screen.println( iSensorValueVOC );
    screen.setCursor(130, 150);
    screen.println("ppm");
    // MEMS CH4 Gas
    screen.setCursor(0, 180);
    screen.println( "CH4: " );
    screen.setCursor(60, 180);
    screen.println( iSensorValueCH4 );
    screen.setCursor(130, 180);
    screen.println("ppm");
    // MEMS Smoke Gas
    screen.setCursor(0, 210);
    screen.println( "SMO: " );
    screen.setCursor(60, 210);
    screen.println( iSensorValueSmoke );
    screen.setCursor(130, 210);
    screen.println("ppm");

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSD.ino

// MicroSD Card
// MicroSD Setup
void isSetupSD() {

    // MicroSD Card
    pinMode( chipSelect , OUTPUT );
    if(!SD.begin( chipSelect )){
        ;  
        return;
    }
    
    uint8_t cardType = SD.cardType();

    // CARD NONE
    if(cardType == CARD_NONE){
        ; 
        return;
    }

    // SD Card Type
    if(cardType == CARD_MMC){
        ; 
    } else if(cardType == CARD_SD){
        ; 
    } else if(cardType == CARD_SDHC){
        ; 
    } else {
        ; 
    } 

    // Size
    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
 
}
// MicroSD Card
void isSD() {

  zzzzzz = "";

  //DFR|EEPROM Unique ID|Version|
  //Temperature C|% RH|VOC|CH4|Smoke|*\r
  zzzzzz = "DFR|" + uid + "|" + sver + "|"
  + String( T ) + "|" + String( H ) + "|"
  + String( iSensorValueVOC ) + "|" + String( iSensorValueCH4 ) + "|"
  + String( iSensorValueSmoke ) + "|*\r";;

  // msg + 1
  char msg[zzzzzz.length() + 1];

  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);

  // Append File
  appendFile(SD, "/dfrdata.txt", msg );
  
}
// List Dir
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    
    // List Dir
    dirname;
    
    File root = fs.open(dirname);
    
    if(!root){
        return;
    }
    
    if(!root.isDirectory()){
        return;
    }

    File file = root.openNextFile();
    
    while(file){
        if(file.isDirectory()){
            file.name();
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            file.name();
            file.size();
        }
        file = root.openNextFile();
    }
    
}
// Write File
void writeFile(fs::FS &fs, const char * path, const char * message){
    
    // Write File
    path;
    
    File file = fs.open(path, FILE_WRITE);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}
// Append File
void appendFile(fs::FS &fs, const char * path, const char * message){
    
    // Append File
    path;
    
    File file = fs.open(path, FILE_APPEND);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  if (sht.readSample()) {
     
     // Temperature
     T = sht.getTemperature();
     // Humidity
     H = sht.getHumidity();

  }

}

getSmoke.ino

// Smoke
// isSmoke
void isSmoke(){

  // MEMS Smoke Gas
  z = analogRead( iSensorSmoke );
  iSensorValueSmoke = map(x, 1, 4095, 1, 1000);
  
}

getVOC.ino

// MEMS VOC Gas
// is VOC
void isVOC(){

  // MEMS VOC Gas
  x = analogRead( iSensorVOC );
  iSensorValueVOC = map(x, 1, 4095, 1, 500);
  
}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );

  // SHTC3 Temperature and Humidity Sensor
  sht.init();
  // SHT3x
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // MicroSD Card
  isSetupSD();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
DFRobot Luc.Paquin: https://edu.dfrobot.com/dashboard/makelogs
Hackster.io: https://www.hackster.io/neosteam-labs
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – MEMS Smoke – Mk26

——

#DonLucElectronics #DonLuc #DFRobot #Smoke #CH4 #VOC #SHTC3 #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

MEMS Smoke

——

MEMS Smoke

——

MEMS Smoke

——

Fermion: MEMS Smoke Gas Detection Sensor

Fermion: MEMS Smoke Gas Detection Sensor employs state-of-the-art microelectromechanical system (MEMS) technology, endowing the sensor with compact dimensions, low power consumption, minimal heat generation, short preheating time, and swift response recovery. The sensor can measure smoke concentration qualitatively and is suitable for smoke alarm and other application scenarios. Kindly remove the protective film before usage. It is advisable to preheat the module for at least 24 hours. Detection range: 10-1000 ppm.

DL2408Mk04

1 x FireBeetle 2 ESP32-C6
1 x Fermion: MEMS Smoke Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery – 1000mAh
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

VOC – 2
CH4 – 3
SMO – 4
SCK – 23
MOSI – 22
MISO – 21
CS – 18
SCL – 20
SDA – 19
DC – 8
CS – 1
RST – 14
VIN – +3.3V
GND – GND

——

DL2408Mk04p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - MEMS Smoke - Mk26
29-26
DL2408Mk04p.ino
DL2408Mk04
1 x FireBeetle 2 ESP32-C6
1 x Fermion: MEMS Smoke Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery - 1000mAh
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// SHTC3 Temperature and Humidity Sensor
#include "SHTSensor.h"
// SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

// MEMS Smoke Gas
int iSensorSmoke = 4;
int iSensorValueSmoke = 0;
int z = 0;

// MEMS CH4 Gas
int iSensorCH4 = 3;
int iSensorValueCH4 = 0;
int y = 0;

// MEMS VOC Gas
int iSensorVOC = 2;
int iSensorValueVOC = 0;
int x = 0;

// MicroSD Card
const int chipSelect = 18;
String zzzzzz = "";

// SHTC3 Temperature and Humidity Sensor
SHTSensor sht;
// Temperature
float T;
// Humidity
float H;

// Defined ESP32
#define TFT_DC 8
#define TFT_CS 1
#define TFT_RST 14

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-26";

void loop() {

  // MEMS Smoke Gas
  isSmoke();
  
  // MEMS CH4 Gas
  isCH4();
  
  // MEMS VOC Gas
  isVOC();
  
  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();

  // DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4, Smoke
  isDisplayTH();

  // MicroSD Card
  isSD();

  // Delay 5 Second
  delay( 5000 );

}

getCH4.ino

// MEMS CH4 Gas
// is CH4
void isCH4(){

  // MEMS CH4 Gas
  y = analogRead( iSensorCH4 );
  iSensorValueCH4 = map(y, 1, 4095, 1, 10000);
  
}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4, Smoke
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 60);
    screen.println( sver );
    // Temperature
    screen.setCursor(0, 90);
    screen.println( "Temp: " );
    screen.setCursor(60, 90);
    screen.println( T );
    screen.setCursor(130, 90);
    screen.println("Celsius");
    // Humidity
    screen.setCursor(0, 120);
    screen.println("Humi: ");
    screen.setCursor(60, 120);
    screen.println( H );
    screen.setCursor(130, 120);
    screen.println("% RH");
    // MEMS VOC Gas
    screen.setCursor(0, 150);
    screen.println( "VOC: " );
    screen.setCursor(60, 150);
    screen.println( iSensorValueVOC );
    screen.setCursor(130, 150);
    screen.println("ppm");
    // MEMS CH4 Gas
    screen.setCursor(0, 180);
    screen.println( "CH4: " );
    screen.setCursor(60, 180);
    screen.println( iSensorValueCH4 );
    screen.setCursor(130, 180);
    screen.println("ppm");
    // MEMS Smoke Gas
    screen.setCursor(0, 210);
    screen.println( "SMO: " );
    screen.setCursor(60, 210);
    screen.println( iSensorValueSmoke );
    screen.setCursor(130, 210);
    screen.println("ppm");

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSD.ino

// MicroSD Card
// MicroSD Setup
void isSetupSD() {

    // MicroSD Card
    pinMode( chipSelect , OUTPUT );
    if(!SD.begin( chipSelect )){
        ;  
        return;
    }
    
    uint8_t cardType = SD.cardType();

    // CARD NONE
    if(cardType == CARD_NONE){
        ; 
        return;
    }

    // SD Card Type
    if(cardType == CARD_MMC){
        ; 
    } else if(cardType == CARD_SD){
        ; 
    } else if(cardType == CARD_SDHC){
        ; 
    } else {
        ; 
    } 

    // Size
    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
 
}
// MicroSD Card
void isSD() {

  zzzzzz = "";

  //DFR|EEPROM Unique ID|Version|
  //Temperature C|% RH|VOC|CH4|Smoke|*\r
  zzzzzz = "DFR|" + uid + "|" + sver + "|"
  + String( T ) + "|" + String( H ) + "|"
  + String( iSensorValueVOC ) + "|" + String( iSensorValueCH4 ) + "|"
  + String( iSensorValueSmoke ) + "|*\r";;

  // msg + 1
  char msg[zzzzzz.length() + 1];

  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);

  // Append File
  appendFile(SD, "/dfrdata.txt", msg );
  
}
// List Dir
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    
    // List Dir
    dirname;
    
    File root = fs.open(dirname);
    
    if(!root){
        return;
    }
    
    if(!root.isDirectory()){
        return;
    }

    File file = root.openNextFile();
    
    while(file){
        if(file.isDirectory()){
            file.name();
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            file.name();
            file.size();
        }
        file = root.openNextFile();
    }
    
}
// Write File
void writeFile(fs::FS &fs, const char * path, const char * message){
    
    // Write File
    path;
    
    File file = fs.open(path, FILE_WRITE);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}
// Append File
void appendFile(fs::FS &fs, const char * path, const char * message){
    
    // Append File
    path;
    
    File file = fs.open(path, FILE_APPEND);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  if (sht.readSample()) {
     
     // Temperature
     T = sht.getTemperature();
     // Humidity
     H = sht.getHumidity();

  }

}

getSmoke.ino

// Smoke
// isSmoke
void isSmoke(){

  // MEMS Smoke Gas
  z = analogRead( iSensorSmoke );
  iSensorValueSmoke = map(x, 1, 4095, 1, 1000);
  
}

getVOC.ino

// MEMS VOC Gas
// is VOC
void isVOC(){

  // MEMS VOC Gas
  x = analogRead( iSensorVOC );
  iSensorValueVOC = map(x, 1, 4095, 1, 500);
  
}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );

  // SHTC3 Temperature and Humidity Sensor
  sht.init();
  // SHT3x
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // MicroSD Card
  isSetupSD();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
DFRobot Luc.Paquin: https://edu.dfrobot.com/dashboard/makelogs
Hackster.io: https://www.hackster.io/neosteam-labs
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – MEMS CH4 – Mk25

——

#DonLucElectronics #DonLuc #DFRobot #CH4 #VOC #SHTC3 #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

MEMS CH4

——

MEMS CH4

——

MEMS CH4

——

Fermion: MEMS Methane CH4 Gas Detection Sensor

Fermion: MEMS Methane CH4 Gas Detection Sensor employs state-of-the-art micro-electromechanical system (MEMS) technology, endowing the sensor with compact dimensions, low power consumption, minimal heat generation, short preheating time, and swift response recovery. The sensor can qualitatively measure methane gas concentration and is suitable for combustible gas leakage monitoring devices, gas leak detectors, fire/safety detection systems and other applications. Detection range: 1-10000 ppm. It is advisable to preheat the module for at least 24 hours.

DL2408Mk02

1 x FireBeetle 2 ESP32-C6
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery – 1000mAh
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

VOC – 2
CH4 – 3
SCK – 23
MOSI – 22
MISO – 21
CS – 18
SCL – 20
SDA – 19
DC – 8
CS – 1
RST – 14
VIN – +3.3V
GND – GND

——

DL2408Mk02p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - MEMS CH4 - Mk25
29-25
DL2408Mk02p.ino
DL2408Mk02
1 x FireBeetle 2 ESP32-C6
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery - 1000mAh
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// SHTC3 Temperature and Humidity Sensor
#include "SHTSensor.h"
// SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

// MEMS CH4 Gas
int iSensorCH4 = 3;
int iSensorValueCH4 = 0;
int y = 0;

// MEMS VOC Gas
int iSensorVOC = 2;
int iSensorValueVOC = 0;
int x = 0;

// MicroSD Card
const int chipSelect = 18;
String zzzzzz = "";

// SHTC3 Temperature and Humidity Sensor
SHTSensor sht;
// Temperature
float T;
// Humidity
float H;

// Defined ESP32
#define TFT_DC 8
#define TFT_CS 1
#define TFT_RST 14

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-25";

void loop() {

  // MEMS CH4 Gas
  isCH4();
  
  // MEMS VOC Gas
  isVOC();
  
  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();

  // DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4
  isDisplayTH();

  // MicroSD Card
  isSD();

  // Delay 5 Second
  delay( 5000 );

}

getCH4.ino

// MEMS CH4 Gas
// is CH4
void isCH4(){

  // MEMS CH4 Gas
  y = analogRead( iSensorCH4 );
  iSensorValueCH4 = map(y, 1, 4095, 1, 10000);
  
}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - Temperature and Humidity, VOC, CH4
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 60);
    screen.println( sver );
    // Temperature
    screen.setCursor(0, 90);
    screen.println( "Temp: " );
    screen.setCursor(60, 90);
    screen.println( T );
    screen.setCursor(130, 90);
    screen.println("Celsius");
    // Humidity
    screen.setCursor(0, 120);
    screen.println("Humi: ");
    screen.setCursor(60, 120);
    screen.println( H );
    screen.setCursor(130, 120);
    screen.println("% RH");
    // MEMS VOC Gas
    screen.setCursor(0, 150);
    screen.println( "VOC: " );
    screen.setCursor(60, 150);
    screen.println( iSensorValueVOC );
    screen.setCursor(130, 150);
    screen.println("ppm");
    // MEMS CH4 Gas
    screen.setCursor(0, 180);
    screen.println( "CH4: " );
    screen.setCursor(60, 180);
    screen.println( iSensorValueCH4 );
    screen.setCursor(130, 180);
    screen.println("ppm");

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSD.ino

// MicroSD Card
// MicroSD Setup
void isSetupSD() {

    // MicroSD Card
    pinMode( chipSelect , OUTPUT );
    if(!SD.begin( chipSelect )){
        ;  
        return;
    }
    
    uint8_t cardType = SD.cardType();

    // CARD NONE
    if(cardType == CARD_NONE){
        ; 
        return;
    }

    // SD Card Type
    if(cardType == CARD_MMC){
        ; 
    } else if(cardType == CARD_SD){
        ; 
    } else if(cardType == CARD_SDHC){
        ; 
    } else {
        ; 
    } 

    // Size
    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
 
}
// MicroSD Card
void isSD() {

  zzzzzz = "";

  //DFR|EEPROM Unique ID|Version|
  //Temperature C|% RH|VOC|CH4|*\r
  zzzzzz = "DFR|" + uid + "|" + sver + "|"
  + String( T ) + "|" + String( H ) + "|"
  + String( iSensorValueVOC ) + "|" + String( iSensorValueCH4 ) + "|*\r";

  // msg + 1
  char msg[zzzzzz.length() + 1];

  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);

  // Append File
  appendFile(SD, "/dfrdata.txt", msg );
  
}
// List Dir
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    
    // List Dir
    dirname;
    
    File root = fs.open(dirname);
    
    if(!root){
        return;
    }
    
    if(!root.isDirectory()){
        return;
    }

    File file = root.openNextFile();
    
    while(file){
        if(file.isDirectory()){
            file.name();
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            file.name();
            file.size();
        }
        file = root.openNextFile();
    }
    
}
// Write File
void writeFile(fs::FS &fs, const char * path, const char * message){
    
    // Write File
    path;
    
    File file = fs.open(path, FILE_WRITE);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}
// Append File
void appendFile(fs::FS &fs, const char * path, const char * message){
    
    // Append File
    path;
    
    File file = fs.open(path, FILE_APPEND);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  if (sht.readSample()) {
     
     // Temperature
     T = sht.getTemperature();
     // Humidity
     H = sht.getHumidity();

  }

}

getVOC.ino

// MEMS VOC Gas
// is VOC
void isVOC(){

  // MEMS VOC Gas
  x = analogRead( iSensorVOC );
  iSensorValueVOC = map(x, 1, 4095, 1, 500);
  
}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );

  // SHTC3 Temperature and Humidity Sensor
  sht.init();
  // SHT3x
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // MicroSD Card
  isSetupSD();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
DFRobot Luc.Paquin: https://edu.dfrobot.com/dashboard/makelogs
Hackster.io: https://www.hackster.io/neosteam-labs
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – MEMS VOC – Mk23

——

#DonLucElectronics #DonLuc #DFRobot #VOC #SHTC3 #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

MEMS VOC

——

MEMS VOC

——

MEMS VOC

——

Fermion: MEMS Volatile Organic Compounds VOC Gas Detection Sensor

Fermion: MEMS Volatile Organic Compounds VOC Gas Sensor employs state-of-the-art microelectromechanical system (MEMS) technology, endowing the sensor with compact dimensions, low power consumption, minimal heat generation, short preheating time, and swift response recovery. The sensor can qualitatively measure VOC gas concentration and is suitable for indoor air quality detection, fresh air system, air purifier and other application scenarios. Kindly remove the protective film before usage. Gas detected: ethanol, formaldehyde, toluene, etc. Detection range: 1-500 ppm. It is advisable to preheat the module for at least 24 hours.

DL2407Mk07

1 x FireBeetle 2 ESP32-C6
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery – 1000mAh
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

VOC – 2
SCK – 23
MOSI – 22
MISO – 21
CS – 18
SCL – 20
SDA – 19
DC – 8
CS – 1
RST – 14
VIN – +3.3V
GND – GND

——

DL2407Mk07p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - MEMS VOC - Mk23
29-23
DL2407Mk07p.ino
DL2407Mk07
1 x FireBeetle 2 ESP32-C6
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery - 1000mAh
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// SHTC3 Temperature and Humidity Sensor
#include "SHTSensor.h"
// SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

// MEMS VOC Gas
int iSensorVOC = 2;
int iSensorValueVOC = 0;
int x = 0;

// MicroSD Card
const int chipSelect = 18;
String zzzzzz = "";

// SHTC3 Temperature and Humidity Sensor
SHTSensor sht;
// Temperature
float T;
// Humidity
float H;

// Defined ESP32
#define TFT_DC 8
#define TFT_CS 1
#define TFT_RST 14

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-23";

void loop() {

  // MEMS VOC Gas
  isVOC();
  
  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();

  // DFRobot Display 240x320 - Temperature and Humidity
  isDisplayTH();

  // MicroSD Card
  isSD();

  // Delay 5 Second
  delay( 5000 );

}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - Temperature and Humidity
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 60);
    screen.println( sver );
    // Temperature
    screen.setCursor(0, 90);
    screen.println( "Temp: " );
    screen.setCursor(60, 90);
    screen.println( T );
    screen.setCursor(125, 90);
    screen.println("Celsius");
    // Humidity
    screen.setCursor(0, 120);
    screen.println("Humi: ");
    screen.setCursor(60, 120);
    screen.println( H );
    screen.setCursor(125, 120);
    screen.println("% RH");
    // MEMS VOC Gas
    screen.setCursor(0, 150);
    screen.println( "VOC: " );
    screen.setCursor(60, 150);
    screen.println( iSensorValueVOC );
    screen.setCursor(125, 150);
    screen.println("ppm");

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSD.ino

// MicroSD Card
// MicroSD Setup
void isSetupSD() {

    // MicroSD Card
    pinMode( chipSelect , OUTPUT );
    if(!SD.begin( chipSelect )){
        ;  
        return;
    }
    
    uint8_t cardType = SD.cardType();

    // CARD NONE
    if(cardType == CARD_NONE){
        ; 
        return;
    }

    // SD Card Type
    if(cardType == CARD_MMC){
        ; 
    } else if(cardType == CARD_SD){
        ; 
    } else if(cardType == CARD_SDHC){
        ; 
    } else {
        ; 
    } 

    // Size
    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
 
}
// MicroSD Card
void isSD() {

  zzzzzz = "";

  //DFR|EEPROM Unique ID|Version|
  //Temperature C|% RH|VOC|*\r
  zzzzzz = "DFR|" + uid + "|" + sver + "|"
  + String( T ) + "|" + String( H ) + "|"
  + String( iSensorValueVOC ) + "|*\r";

  // msg + 1
  char msg[zzzzzz.length() + 1];

  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);

  // Append File
  appendFile(SD, "/dfrdata.txt", msg );
  
}
// List Dir
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    
    // List Dir
    dirname;
    
    File root = fs.open(dirname);
    
    if(!root){
        return;
    }
    
    if(!root.isDirectory()){
        return;
    }

    File file = root.openNextFile();
    
    while(file){
        if(file.isDirectory()){
            file.name();
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            file.name();
            file.size();
        }
        file = root.openNextFile();
    }
    
}
// Write File
void writeFile(fs::FS &fs, const char * path, const char * message){
    
    // Write File
    path;
    
    File file = fs.open(path, FILE_WRITE);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}
// Append File
void appendFile(fs::FS &fs, const char * path, const char * message){
    
    // Append File
    path;
    
    File file = fs.open(path, FILE_APPEND);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  if (sht.readSample()) {
     
     // Temperature
     T = sht.getTemperature();
     // Humidity
     H = sht.getHumidity();

  }

}

getVOC.ino

// MEMS VOC Gas
// is VOC
void isVOC(){

  // MEMS VOC Gas
  x = analogRead( iSensorVOC );
  iSensorValueVOC = map(x, 1, 4095, 1, 500);
  
}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );

  // SHTC3 Temperature and Humidity Sensor
  sht.init();
  // SHT3x
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // MicroSD Card
  isSetupSD();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – SD Card – Mk22

——

#DonLucElectronics #DonLuc #DFRobot #SHTC3 #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

SD Card

——

SD Card

——

SD Card

——

SD Card

Secure Digital, officially abbreviated as SD, is a proprietary, non-volatile, flash memory card format the SD Association (SDA) developed for use in portable devices. Because of their small physical dimensions, SD cards became widely used in many consumer electronic devices, such as Arduino, digital cameras, camcorders, video game consoles, mobile phones, action cameras such as the GoPro Hero series, and camera drones.

DL2407Mk06

1 x FireBeetle 2 ESP32-C6
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery – 1000mAh
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

SCK – 23
MOSI – 22
MISO – 21
CS – 18
SCL – 20
SDA – 19
DC – 8
CS – 1
RST – 14
VIN – +3.3V
GND – GND

——

DL2407Mk06p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - SD Card - Mk22
29-22
DL2407Mk06p.ino
DL2407Mk06
1 x FireBeetle 2 ESP32-C6
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x MicroSD 2 GB
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery - 1000mAh
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// SHTC3 Temperature and Humidity Sensor
#include "SHTSensor.h"
// SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

// MicroSD Card
const int chipSelect = 18;
String zzzzzz = "";

// SHTC3 Temperature and Humidity Sensor
SHTSensor sht;
// Temperature
float T;
// Humidity
float H;

// Defined ESP32
#define TFT_DC 8
#define TFT_CS 1
#define TFT_RST 14

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-22";

void loop() {

  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();

  // DFRobot Display 240x320 - Temperature and Humidity
  isDisplayTH();

  // MicroSD Card
  isSD();

  // Delay 5 Second
  delay( 5000 );

}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - Temperature and Humidity
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 60);
    screen.println( sver );
    // Temperature
    // Text Color => red
    screen.setTextColor(0xf800);
    screen.setCursor(0, 90);
    screen.println( "Temperature" );
    screen.setCursor(0, 120);
    screen.println( T );
    screen.setCursor(100, 120);
    screen.println("Celsius");
    // Humidity
    // Text Color => blue
    screen.setTextColor(0x001f);
    screen.setCursor(0, 150);
    screen.println("Humidity");
    screen.setCursor(0, 180);
    screen.println( H );
    screen.setCursor(100, 180);
    screen.println("% RH");

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSD.ino

// MicroSD Card
// MicroSD Setup
void isSetupSD() {

    // MicroSD Card
    pinMode( chipSelect , OUTPUT );
    if(!SD.begin( chipSelect )){
        ;  
        return;
    }
    
    uint8_t cardType = SD.cardType();

    // CARD NONE
    if(cardType == CARD_NONE){
        ; 
        return;
    }

    // SD Card Type
    if(cardType == CARD_MMC){
        ; 
    } else if(cardType == CARD_SD){
        ; 
    } else if(cardType == CARD_SDHC){
        ; 
    } else {
        ; 
    } 

    // Size
    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
 
}
// MicroSD Card
void isSD() {

  zzzzzz = "";

  //DFR|EEPROM Unique ID|Version|
  //Temperature C|% RH|*\r
  zzzzzz = "DFR|" + uid + "|" + sver + "|"
  + String( T ) + "|" + String( H ) + "|*\r";

  // msg + 1
  char msg[zzzzzz.length() + 1];

  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);

  // Append File
  appendFile(SD, "/dfrdata.txt", msg );
  
}
// List Dir
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    
    // List Dir
    dirname;
    
    File root = fs.open(dirname);
    
    if(!root){
        return;
    }
    
    if(!root.isDirectory()){
        return;
    }

    File file = root.openNextFile();
    
    while(file){
        if(file.isDirectory()){
            file.name();
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            file.name();
            file.size();
        }
        file = root.openNextFile();
    }
    
}
// Write File
void writeFile(fs::FS &fs, const char * path, const char * message){
    
    // Write File
    path;
    
    File file = fs.open(path, FILE_WRITE);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}
// Append File
void appendFile(fs::FS &fs, const char * path, const char * message){
    
    // Append File
    path;
    
    File file = fs.open(path, FILE_APPEND);
    
    if(!file){
        return;
    }
    
    if(file.print(message)){
        ;  
    } else {
        ;  
    }
    
    file.close();
    
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  if (sht.readSample()) {
     
     // Temperature
     T = sht.getTemperature();
     // Humidity
     H = sht.getHumidity();

  }

}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );

  // SHTC3 Temperature and Humidity Sensor
  sht.init();
  // SHT3x
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Delay
  delay(100);

  // MicroSD Card
  isSetupSD();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – SHTC3 – Mk21

——

#DonLucElectronics #DonLuc #DFRobot #SHTC3 #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

SHTC3

——

SHTC3

——

SHTC3

——

Fermion: SHTC3 Temperature and Humidity Sensor

The SHTC3 digital humidity sensor from Sensirion builds on the success of the proven SHTC1 sensor and offers consistent high accuracy within the measuring range. The sensor covers a humidity measurement range of 0 to 100% RH and a temperature detection range of -40 Celsius to 125 Celsius with a typical accuracy of ±2% RH and ±0.2 Celsius. The board supply voltage of 3.3 Volt to 5 Volt and a current consumption below 0.15mA in low power mode make the SHTC3 perfectly suitable for mobile or wireless battery-driven applications.

DL2407Mk05

1 x FireBeetle 2 ESP32-C6
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery – 1000mAh
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

SCL – 20
SDA – 19
DC – 8
CS – 1
RST – 14
VIN – +3.3V
GND – GND

——

DL2407Mk05p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - SHTC3 - Mk21
29-21
DL2407Mk05p.ino
DL2407Mk05
1 x FireBeetle 2 ESP32-C6
1 x Fermion: SHTC3 Temperature and Humidity Sensor
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery - 1000mAh
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// SHTC3 Temperature and Humidity Sensor
#include "SHTSensor.h"

// SHTC3 Temperature and Humidity Sensor
SHTSensor sht;
// Temperature
float T;
// Humidity
float H;

// Defined ESP32
#define TFT_DC 8
#define TFT_CS 1
#define TFT_RST 14

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-21";

void loop() {

  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();

  // DFRobot Display 240x320 - Temperature and Humidity
  isDisplayTH();

  // Delay 5 Second
  delay( 5000 );

}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - Temperature and Humidity
void isDisplayTH() {
  
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => black
    screen.fillScreen(0x0000);
    // Text Color => white
    screen.setTextColor(0xffff);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // Don Luc Electronics
    screen.setCursor(0, 30);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 60);
    screen.println( sver );
    // Temperature
    // Text Color => red
    screen.setTextColor(0xf800);
    screen.setCursor(0, 90);
    screen.println( "Temperature" );
    screen.setCursor(0, 120);
    screen.println( T );
    screen.setCursor(100, 120);
    screen.println("Celsius");
    // Humidity
    // Text Color => blue
    screen.setTextColor(0x001f);
    screen.setCursor(0, 150);
    screen.println("Humidity");
    screen.setCursor(0, 180);
    screen.println( H );
    screen.setCursor(100, 180);
    screen.println("% RH");

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getSHTC3.ino

// SHTC3 Temperature and Humidity Sensor
// SHTC3
void isSHTC3(){

  // SHTC3 Temperature and Humidity Sensor
  if (sht.readSample()) {
     
     // Temperature
     T = sht.getTemperature();
     // Humidity
     H = sht.getHumidity();

  }

}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Wire
  Wire.begin();

  // Delay
  delay( 100 );

  // SHTC3 Temperature and Humidity Sensor
  sht.init();
  // SHT3x
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);

  // Delay
  delay( 100 );
  
  // DFRobot Display 240x320
  screen.begin();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #29 – DFRobot – ESP32-C6 and LCD Display – Mk20

——

#DonLucElectronics #DonLuc #DFRobot #FireBeetle2ESP32C6 #Display #EEPROM #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

ESP32-C6 and LCD Display

——

ESP32-C6 and LCD Display

——

ESP32-C6 and LCD Display

——

FireBeetle 2 ESP32-C6

The FireBeetle 2 ESP32-C6 is a versatile low-power IoT controller board designed for Smart Home Automation, control and monitoring system. It features a 160MHz RISC-V 32-bit processor, providing excellent energy efficiency and flexibility for Internet of Things (IoT) projects. The board supports multiple communication protocols, including Wi-Fi 6, Bluetooth 5, Zigbee 3.0, and Thread 1.3, enabling versatile wireless connectivity.

Fermion: 2.0″ 320×240 IPS TFT LCD

This 2.0 inches LCD display adopts ST7789V driver chip and has 320 x 240 color pixels, performing excellently in the angle of view. It supports SPI communication mode and GDI port, plug, and play. The module can be powered by 3.3 Volt ~ 5 Volt, compatible with multiple main-controllers like Arduino UNO, Leonardo, ESP32, ESP8266, FireBeetle M0, and so on. Besides, there is an onboard MicroSD card slot for displaying more pictures.

DL2407Mk04

1 x FireBeetle 2 ESP32-C6
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery – 1000mAh
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-C6

DC – 8
CS – 1
RST – 14
VIN – +3.3V
GND – GND

DL2407Mk04p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - ESP32-C6 and  LCD Display - Mk20
29-20
DL2407Mk04p.ino
DL2407Mk04
1 x FireBeetle 2 ESP32-C6
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x 1 x Lithium Ion Battery - 1000mAh
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// EEPROM Library to Read and Write EEPROM
// with Unique ID for Unit
#include "EEPROM.h"
// DFRobot Display GDL API
#include <DFRobot_GDL.h>

// Defined ESP32
#define TFT_DC 8
#define TFT_CS 1
#define TFT_RST 14

/*dc=*/ /*cs=*/ /*rst=*/
// DFRobot Display 240x320
DFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);

// VID
int VID = 0;
String zzzzzz = "";

// LED Green
int iLEDGreen = 15;

// EEPROM Unique ID Information
#define EEPROM_SIZE 64
String uid = "";

// Software Version Information
String sver = "29-20";

void loop() {

  // VID
  VID = VID + 1;

  // DFRobot Display 240x320 - VID
  isDisplayVID();

  // Delay 5 Second
  delay( 5000 );

}

getDisplay.ino

// DFRobot Display 240x320
// DFRobot Display 240x320 - UID
void isDisplayUID() {

    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => ghostwhite
    screen.fillScreen(0xf7bf);
    // Text Color => black
    screen.setTextColor(0x0000);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println("Version");
    screen.setCursor(0, 120);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 150);
    screen.println("EEPROM");
    screen.setCursor(0, 180);
    screen.println( uid );

}
// DFRobot Display 240x320 - VID
void isDisplayVID() {

    // zzzzzz = VID
    zzzzzz = String(VID);
    
    // DFRobot Display 240x320
    // Text Display
    // Text Wrap
    screen.setTextWrap(false);
    // Rotation
    screen.setRotation(3);
    // Fill Screen => ghostwhite
    screen.fillScreen(0xf7bf);
    // Text Color => black
    screen.setTextColor(0x0000);
    // Font => Free Mono 9pt
    screen.setFont(&FreeMono9pt7b);
    // TextSize => 1.5
    screen.setTextSize(1.5);
    // DFRobot Display
    screen.setCursor(0, 30);
    screen.println("DFRobot Display");
    // Don Luc Electronics
    screen.setCursor(0, 60);
    screen.println("Don Luc Electronics");
    // Version
    screen.setCursor(0, 90);
    screen.println( sver );
    // EEPROM
    screen.setCursor(0, 120);
    screen.println( uid );
    // Text Color => red
    screen.setTextColor(0xf800);
    // VID
    screen.setCursor(0, 150);
    screen.println("VID");
    screen.setCursor(0, 180);
    screen.println( zzzzzz );

}

getEEPROM.ino

// EEPROM
// isUID EEPROM Unique ID
void isUID() {
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 7; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

setup.ino

// Setup
void setup()
{
  
  // Give display time to power on
  delay(100);

  // EEPROM Size
  EEPROM.begin(EEPROM_SIZE);
  
  // EEPROM Unique ID
  isUID();
  
  // Delay
  delay( 100 );

  // Delay
  delay( 100 );

  // DFRobot Display 240x320
  screen.begin();

  // Initialize the LED Green
  pinMode(iLEDGreen, OUTPUT);

  // iLEDGreen HIGH
  digitalWrite(iLEDGreen, HIGH );

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  // EEPROM
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Teacher, Instructor, E-Mentor, R&D and Consulting

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Automation
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • Artificial Intelligence (AI)
  • RTOS
  • Sensors, eHealth Sensors, Biosensor, and Biometric
  • Research & Development (R & D)
  • Consulting

Follow Us

Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

1 2 3 9
Categories
Archives