The Alpha Geek – Geeking Out

DFRobot

1 2 3 5

Project #25 – Movement – ADXL345 – Mk07

——

#DonLucElectronics #DonLuc #ADXL345 #Accelerometer #Movement #ESP32 #Bluetooth #Elecrow #DFRobot #Arduino #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant

——

ADXL345

——

ADXL345

——

ADXL345

——

Crowtail – 3-Axis Digital Accelerometer

Crowtail – 3-Axis Digital Accelerometer with specific Crowtail interface, It’s base on an advanced 3-axis IC ADXL345. This is a high resolution digital accelerometer providing you at max 3.9mg/LSB resolution and large ±16g measurement range. Have no worry to implement it into your free-fall detection project, cause it’s robust enough to survive up to 10,000g shock. Meanwhile, it’s agile enough to detect single and double taps. It’s ideal for motion detection, gesture detection as well as robotics. This digital 3-axis accelerometer has excellent EMI protection.
Its variable output makes it suitable for a wide range of applications:

  • 1. HDD shock protection
  • 2. Vibration sensor
  • 3. Game controller input
  • 4. Robotics
  • 5. Smart vehicles
  • 6. Anywhere you need to obtain motion-sensing and orientation information.
  • 7. The excellent sensitivity provide high-precision output up to ±16g.

DL2501Mk03

1 x DFRobot FireBeetle 2 ESP32-E
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Crowtail – I2C Hub 2.0
1 x Crowtail – 3-Axis Digital Accelerometer
1 x Lithium Ion Battery – 1000mAh
1 x Switch
1 x Bluetooth Serial Terminal
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-E

SCL – 22
SDA – 21
DC – D2
CS – D6
RST – D3
RX2 – Bluetooth
TX2 – Bluetooth
VIN – +3.3V
GND – GND

DL2501Mk03p

DL2501Mk03p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #25 - Movement - ADXL345 - Mk07
25-07
DL2501Mk03p.ino
DL2501Mk03
1 x DFRobot FireBeetle 2 ESP32-E
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Crowtail - I2C Hub 2.0
1 x Crowtail - 3-Axis Digital Accelerometer
1 x Lithium Ion Battery - 1000mAh
1 x Switch
1 x Bluetooth Serial Terminal
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Bluetooth Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
// Accelemeter ADXL345
#include <ADXL345.h>

// Variable ADXL345 library
ADXL345 adxl;
// Accelerometer ADXL345
// x, y, z
int x;
int y;
int z;
// Standard Gravity
// xyz
double xyz[3];
double ax;
double ay;
double az;
// FullString
String FullString = "";

// Bluetooth Serial
BluetoothSerial SerialBT;

// 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);

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

void loop() {

  // Accelemeter ADXL345
  isADXL345();

  // Delay 0.5 Second
  delay( 500 );

}

getAccelemeterADXL345.ino

// Accelemeter ADXL345
// Setup Accelemeter ADXL345
void isSetupADXL345(){

  // Power On
  adxl.powerOn();

  // Set activity inactivity thresholds (0-255)
  // 62.5mg per increment
  adxl.setActivityThreshold(75);
  // 62.5mg per increment
  adxl.setInactivityThreshold(75);
  // How many seconds of no activity is inactive?
  adxl.setTimeInactivity(10);
 
  //look of activity movement on this axes - 1 == on; 0 == off 
  adxl.setActivityX(1);
  adxl.setActivityY(1);
  adxl.setActivityZ(1);
 
  //look of inactivity movement on this axes - 1 == on; 0 == off
  adxl.setInactivityX(1);
  adxl.setInactivityY(1);
  adxl.setInactivityZ(1);
 
  // Look of tap movement on this axes - 1 == on; 0 == off
  adxl.setTapDetectionOnX(0);
  adxl.setTapDetectionOnY(0);
  adxl.setTapDetectionOnZ(1);
 
  // Set values for what is a tap, and what is a double tap (0-255)
  // 62.5mg per increment
  adxl.setTapThreshold(50);
  // 625us per increment
  adxl.setTapDuration(15);
  // 1.25ms per increment
  adxl.setDoubleTapLatency(80);
  // 1.25ms per increment
  adxl.setDoubleTapWindow(200);
 
  // set values for what is considered freefall (0-255)
  // (5 - 9) recommended - 62.5mg per increment
  adxl.setFreeFallThreshold(7);
  // (20 - 70) recommended - 5ms per increment
  adxl.setFreeFallDuration(45);
 
  // Setting all interrupts to take place on int pin 1
  // I had issues with int pin 2, was unable to reset it
  adxl.setInterruptMapping( ADXL345_INT_SINGLE_TAP_BIT,   ADXL345_INT1_PIN );
  adxl.setInterruptMapping( ADXL345_INT_DOUBLE_TAP_BIT,   ADXL345_INT1_PIN );
  adxl.setInterruptMapping( ADXL345_INT_FREE_FALL_BIT,    ADXL345_INT1_PIN );
  adxl.setInterruptMapping( ADXL345_INT_ACTIVITY_BIT,     ADXL345_INT1_PIN );
  adxl.setInterruptMapping( ADXL345_INT_INACTIVITY_BIT,   ADXL345_INT1_PIN );
 
  // Register interrupt actions - 1 == on; 0 == off  
  adxl.setInterrupt( ADXL345_INT_SINGLE_TAP_BIT, 1);
  adxl.setInterrupt( ADXL345_INT_DOUBLE_TAP_BIT, 1);
  adxl.setInterrupt( ADXL345_INT_FREE_FALL_BIT,  1);
  adxl.setInterrupt( ADXL345_INT_ACTIVITY_BIT,   1);
  adxl.setInterrupt( ADXL345_INT_INACTIVITY_BIT, 1);

}
// Accelemeter ADXL345
void isADXL345(){

  // Read the accelerometer values and store them in variables  x,y,z
  adxl.readXYZ(&x, &y, &z);
  // Output x,y,z values 
  Serial.print("Values of X , Y , Z: ");
  Serial.print(x);
  Serial.print(" , ");
  Serial.print(y);
  Serial.print(" , ");
  Serial.println(z);

  // FullString
  FullString = "Values of X , Y , Z: " + String(x) + " , " + 
  String(y) + " , " + String(z) + + "\r\n";

  // Accelemeter ADXL345
  isDisplayADXL345();

  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }
  // Standard Gravity
  // Acceleration
  adxl.getAcceleration(xyz);
  ax = xyz[0];
  ay = xyz[1];
  az = xyz[2];
  Serial.print("X=");
  Serial.print(ax);
    Serial.println(" g");
  Serial.print("Y=");
  Serial.print(ay);
    Serial.println(" g");
  Serial.print("Z=");
  Serial.println(az);
    Serial.println(" g");
  Serial.println("**********************");

  // FullString
  // xg
  FullString = "X = " + String(ax) + " g" + "\r\n";
  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }
  // yg
  FullString = "y = " + String(ay) + " g" + "\r\n";
  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }
  // zg
  FullString = "z = " + String(az) + " g" + "\r\n";
  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }

}

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);
  // Don Luc Electronics
  screen.setCursor(0, 30);
  screen.println("Don Luc Electronics");
  // Accelemeter ADXL345
  screen.setCursor(0, 60);
  screen.println("Accelemeter ADXL345");
  // Version
  screen.setCursor(0, 90);
  screen.println("Version");
  screen.setCursor(0, 120);
  screen.println( sver );

}
// Accelemeter ADXL345
void isDisplayADXL345(){

  // 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);
  // Accelemeter ADXL345
  screen.setCursor(0, 30);
  screen.println("Accelemeter ADXL345");
  // Accelemeter ADXL345 X
  screen.setCursor(0, 60);
  screen.println("X: ");
  screen.setCursor(30, 60);
  screen.println( x );
  // Accelemeter ADXL345 Y
  screen.setCursor(0, 90);
  screen.println( "Y: " );
  screen.setCursor(30, 90);
  screen.println( y );
  // Accelemeter ADXL345 Z
  screen.setCursor(0, 120);
  screen.println( "Z: " );
  screen.setCursor(30, 120);
  screen.println( z );
  // Standard Gravity
  // Accelemeter ADXL345 Xg
  screen.setCursor(0, 150);
  screen.println( "Xg: " );
  screen.setCursor(40, 150);
  screen.println( ax );
  // Accelemeter ADXL345 Yg
  screen.setCursor(0, 180);
  screen.println( "Yg: " );
  screen.setCursor(40, 180);
  screen.println( ay );
  // Accelemeter ADXL345 Zg
  screen.setCursor(0, 210);
  screen.println( "Zg: " );
  screen.setCursor(40, 210);
  screen.println( az );
  
}

setup.ino

// Setup
void setup()
{
 
  // Serial Begin
  Serial.begin(115200);
  Serial.println("Starting BLE work!");

  // Bluetooth Serial
  SerialBT.begin("DL2501Mk03");
  Serial.println("Bluetooth Started! Ready to pair...");
  
  // Delay
  delay(100);

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

  // Delay
  delay(100);

  // Setup Accelemeter ADXL345
  isSetupADXL345();

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

  // Delay 5 Second
  delay( 5000 );

}

——

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

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

  • 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 – 2025
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/
Patreon: https://patreon.com/DonLucElectronics59
DFRobot: https://learn.dfrobot.com/user-10186.html
Hackster.io: https://www.hackster.io/neosteam-labs
Elecrow: https://www.elecrow.com/share/sharepj/center/no/760816d385ebb1edc0732fd873bfbf13
TikTok: https://www.tiktok.com/@luc.paquin8
Twitch: https://www.twitch.tv/lucpaquin
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #11: ESP32 – Bluetooth IoT – Mk12

——

#DonLucElectronics #DonLuc #ESP32 #Bluetooth #Elecrow #DFRobot #Arduino #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant

——

Bluetooth IoT

——

Bluetooth IoT

——

Bluetooth IoT

——

Bluetooth

Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks. In the most widely used mode, transmission power is limited to 2.5 milliwatts, giving it a very short range of up to 10 metres. It employs UHF radio waves in the ISM bands, from 2.402 GHz to 2.48 GHz.

You can pair all kinds of Bluetooth devices with your PC, including keyboards, mice, phones, speakers, IoT, and a whole lot more. To do this, your PC needs to have Bluetooth. Some PCs, such as laptops and tablets, have Bluetooth built in. If your PC doesn’t, you can plug a USB Bluetooth adapter into the USB port on your PC to get it.

DL2501Mk01

1 x DFRobot FireBeetle 2 ESP32-E
1 x Fermion: 2.0″ 320×240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Crowtail- Rotary Angle Sensor 2.0 – 10K Ohm
1 x Crowtail- LED 2.0 – Yellow
1 x Crowtail- LED 2.0 – Green
1 x Lithium Ion Battery – 1000mAh
1 x Switch
1 x Bluetooth Serial Terminal for Windows 10
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-E

POT – A0
LEG – 16
LEY – 17
DC – D2
CS – D6
RST – D3
RX2 – Bluetooth
TX2 – Bluetooth
VIN – +3.3V
GND – GND

DL2501Mk01p

DL2501Mk01p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #11: ESP32 - Bluetooth IoT - Mk12
11-12
DL2501Mk01p.ino
DL2501Mk01
1 x DFRobot FireBeetle 2 ESP32-E
1 x Fermion: 2.0" 320x240 IPS TFT LCD
1 x GDL Line 10 CM
1 x Crowtail- Rotary Angle Sensor 2.0 - 10K Ohm
1 x Crowtail- LED 2.0 - Yellow
1 x Crowtail- LED 2.0 - Green
1 x Lithium Ion Battery - 1000mAh
1 x Switch
1 x Bluetooth Serial Terminal for Windows 10
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// Arduino
#include <Arduino.h>
// Wire
#include <Wire.h>
// DFRobot Display GDL API
#include <DFRobot_GDL.h>
// Bluetooth Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

// Bluetooth Serial
BluetoothSerial SerialBT;

// 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);

// Potentiometer
int iPot = A0;
int iPotVal = 0;
// Change Your Threshold Here
int Threshold = 2000;
// Full String
String FullString = "";

// LED Yellow
int iLEDY = 17;

// LED Green
int iLEDG = 16;

// Software Version Information
String sver = "11-12";

void loop() {

  // Potentiometer
  isPotentiometer();

  // Delay 2 Second
  delay( 2000 );

}

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("Don Luc Electronics");
  // Don Luc Electronics
  screen.setCursor(0, 60);
  screen.println("DFRobot Display");
  // Version
  screen.setCursor(0, 90);
  screen.println("Version");
  screen.setCursor(0, 120);
  screen.println( sver );

}
// isDisplay Green
void isDisplayG(){

  // 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");
  // LED Yellow
  screen.setCursor(0, 60);
  screen.println("LED Green");
  // Potentiometer Value
  screen.setCursor(0, 90);
  screen.println( iPotVal );

}
// isDisplay Yellow
void isDisplayY(){

  // 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");
  // LED Yellow
  screen.setCursor(0, 60);
  screen.println("LED Yellow");
  // Potentiometer Value
  screen.setCursor(0, 90);
  screen.println( iPotVal );

}

getPotentiometer.ino

// Potentiometer
// Potentiometer
void isPotentiometer(){

  // Connect Potentiometer to Analog 0
  iPotVal = analogRead( iPot );

  // Threshold
  if (iPotVal > Threshold) {

    // LED Yellow
    digitalWrite(iLEDY, LOW);
    // isDisplay Green
    isDisplayG();
    // LED Green
    digitalWrite(iLEDG, HIGH);
    // FullString
    FullString = "LED Green = " + String(iPotVal) + "\r\n";
  
  }
  else {
    
    // LED Green
    digitalWrite(iLEDG, LOW);
    // isDisplay Yellow
    isDisplayY();
    // LED Yellow
    digitalWrite(iLEDY, HIGH);
    // FullString
    FullString = "LED Yellow = " + String(iPotVal) + "\r\n";
    
  }

  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }

}

setup.ino

// Setup
void setup()
{
 
  // Serial Begin
  Serial.begin(115200);
  Serial.println("Starting BLE work!");

  // Bluetooth Serial
  SerialBT.begin("Don Luc Electronics");
  Serial.println("Bluetooth Started! Ready to pair...");
  
  // Delay
  delay(100);

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

  // Delay
  delay(100);

  // Initialize the LED Yellow
  pinMode(iLEDY, OUTPUT);

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

  // DFRobot Display 240x320 - UID
  // Don Luc Electronics
  // Version
  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/
Patreon: https://patreon.com/DonLucElectronics59
DFRobot: https://learn.dfrobot.com/user-10186.html
Hackster.io: https://www.hackster.io/neosteam-labs
Elecrow: https://www.elecrow.com/share/sharepj/center/no/760816d385ebb1edc0732fd873bfbf13
TikTok: https://www.tiktok.com/@luc.paquin8
Twitch: https://www.twitch.tv/lucpaquin
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Patreon: Intermediate

——

#DonLucElectronics #DonLuc #ESP8266 #ESP32 #Arduino #Elecrow #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant

——

Patreon: Intermediate

——

Patreon: Intermediate

——

Patreon: Intermediate

——

Patreon: Intermediate

Intermediate: Internet of Things (IoT). Internet of Things (IoT) describes devices with sensors, processing ability, software and other technologies that connect and exchange data with other devices and systems over the Internet or other communication networks.

Internet of Things (IoT)

Internet of Things (IoT), the vast array of physical objects equipped with sensors and software that enable them to interact with little human intervention by collecting and exchanging data via a network. The Internet of Things (IoT) includes the many “Smart”, computer-like devices so commonplace today, which can connect with the Internet or interact via wireless networks; these “Things” include phones, appliances, thermostats, lighting systems, irrigation systems, security cameras, vehicles, even animals and cities. Today, smart watches track exercise and steps, smart speakers add items to shopping lists and switch lights on and off, and transponders allow cars to pass through tollbooths and pay the fee electronically.

Espressif Systems

Espressif Systems, a company with headquarters in Shanghai, China made its debut in the microcontroller scene with their range of inexpensive and feature-packed WiFi microcontrollers.

ESP8266

The ESP8266 is a low-cost Wi-Fi microcontroller, with built-in TCP/IP networking software, and microcontroller capability.

Programming

Arduino — A C++-based firmware. With this core, the ESP8266 CPU and its Wi-Fi components can be programmed like any other Arduino device.

ESP32

ESP32 is a series of low-cost, low-power system-on-chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs either a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations, an Xtensa LX7 dual-core microprocessor, or a single-core RISC-V microprocessor.

Programming

Arduino – A C++-based firmware. With this core, Arduino core for the ESP32, ESP32-S2, ESP32-S3, ESP32-C3, Etc.

DL2412Mk02

1 x DFRobot FireBeetle 2 ESP32-E
1 x Crowtail- Rotary Angle Sensor 2.0 – 10K Ohm
1 x Crowtail- OLED
1 x Crowtail- LED 2.0 – Yellow
1 x Crowtail- LED 2.0 – Green
1 x Lithium Ion Battery – 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C

FireBeetle 2 ESP32-E

POT – A0
LEG – 16
LEY – 17
SCL – 22
SDA – 21
VIN – +3.3V
GND – GND

——

DL2412Mk02p

DL2412Mk02p.ino

/****** Don Luc Electronics © ******
Software Version Information
Patreon: Intermediate
Intermediate
DL2412Mk02p.ino
DL2412Mk02
1 x DFRobot FireBeetle 2 ESP32-E
1 x Crowtail- Rotary Angle Sensor 2.0 - 10K Ohm
1 x Crowtail- OLED
1 x Crowtail- LED 2.0 - Yellow
1 x Crowtail- LED 2.0 - Green
1 x Lithium Ion Battery - 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// Arduino
#include <Arduino.h>
// Crowtail- OLED
#include <U8x8lib.h>
// SPI
#include <SPI.h>

// Crowtail- OLED
// U8x8 Contructor List 
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);

// Potentiometer
int iPot = A0;
int iPotVal = 0;
// Change Your Threshold Here
int Threshold = 2000;

// LED Yellow
int iLEDY = 17;

// LED Green
int iLEDG = 16;

// Software Version Information
String sver = "Intermediate";

void loop() {

  // Potentiometer
  isPotentiometer();

  // Delay 0.5 Second
  delay( 500 );

}

getDisplay.ino

// getDisplay
// Crowbits-OLED 128X64 UID
void isDisplayUID(){

  // Clear
  u8x8.clear();
  // Font
  u8x8.setFont(u8x8_font_chroma48medium8_r);
  // Draw
  u8x8.drawString(0,0,"Don Luc Electron");
  // Draw
  u8x8.drawString(0,35,"Intermediate");

}
// isDisplay Green
void isDisplayG(){

  // Clear
  u8x8.clear();
  // Font
  u8x8.setFont(u8x8_font_chroma48medium8_r);
  // Cursor
  u8x8.setCursor(0,0);
  // Print
  u8x8.print("Don Luc Electron");
  // Cursor
  u8x8.setCursor(0,30);
  // Print
  u8x8.print("LED Green");
  // Cursor
  u8x8.setCursor(0,35);
  // Print
  u8x8.print(iPotVal);
  
}
// isDisplay Yellow
void isDisplayY(){

  // Clear
  u8x8.clear();
  // Font
  u8x8.setFont(u8x8_font_chroma48medium8_r);
  // Cursor
  u8x8.setCursor(0,0);
  // Print
  u8x8.print("Don Luc Electron");
  // Cursor
  u8x8.setCursor(0,30);
  // Print
  u8x8.print("LED Yellow");
  // Cursor
  u8x8.setCursor(0,35);
  // Print
  u8x8.print(iPotVal);

}

getPotentiometer.ino

// Potentiometer
// Potentiometer
void isPotentiometer(){

  // Connect Potentiometer to Analog 0
  iPotVal = analogRead( iPot );

  // Threshold
  if (iPotVal > Threshold) {

    // LED Yellow
    digitalWrite(iLEDY, LOW);
    // isDisplay Green
    isDisplayG();
    // LED Green
    digitalWrite(iLEDG, HIGH);
    
  }
  else {
    
    // LED Green
    digitalWrite(iLEDG, LOW);
    // isDisplay Yellow
    isDisplayY();
    // LED Yellow
    digitalWrite(iLEDY, HIGH);
    
  }

}

setup.ino

// Setup
void setup()
{
 
  // Delay
  delay(100);

  // Crowtail- OLED
  u8x8.begin();
  u8x8.setPowerSave(0);

  // Delay
  delay(100);

  // Initialize the LED Yellow
  pinMode(iLEDY, OUTPUT);

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

  // Crowbits-OLED 128X64
  // Don Luc Electronics
  // Version
  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/
Patreon: https://patreon.com/DonLucElectronics59
DFRobot: https://learn.dfrobot.com/user-10186.html
Hackster.io: https://www.hackster.io/neosteam-labs
Elecrow: https://www.elecrow.com/share/sharepj/center/no/760816d385ebb1edc0732fd873bfbf13
TikTok: https://www.tiktok.com/@luc.paquin8
Twitch: https://www.twitch.tv/lucpaquin
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #15: Environment – Soil Moisture Sensor – Mk20

——

#DonLucElectronics #DonLuc #Arduino #ASM #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant

——

Soil Moisture Sensor

——

Soil Moisture Sensor

——

Soil Moisture Sensor

——

Soil Moisture Sensor

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.

DL2411Mk03

1 x SparkFun RedBoard Qwiic
1 x Gravity: Analog Soil Moisture Sensor
2 x LED
1 x ProtoScrewShield
1 x USB Battery Pack
1 x USB Micro-B Cable

SparkFun RedBoard Qwiic

ASM – A0
LEDP- 13
LEDG- 12
VIN – +5V
GND – GND

DL2411Mk03p

DL2411Mk03p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #15: Environment – Soil Moisture Sensor – Mk20
15-20
DL2411Mk03p.ino
DL2411Mk03
1 x SparkFun RedBoard Qwiic
1 x Gravity: Analog Soil Moisture Sensor
2 x LED
1 x ProtoScrewShield
1 x USB Battery Pack
1 x USB Micro-B Cable
*/

// Include the Library Code

// Gravity: Analog Soil Moisture Sensor
int iSoilMoisture = A0;
int iSoilMoistureVal = 0;
int zz = 0;
// Change Your Threshold Here
int Threshold = 300;

// LED ProtoScrewShield Yellow
int iLEDProto = 13;

// LED Green
int iLEDGreen = 12;

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

void loop() {

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

  // Delay 1 Second
  delay( 1000 );

}

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, 715, 0, 900);

  // Serial
  Serial.print("Moisture Sensor Value: ");

  // Threshold
  if (iSoilMoistureVal > Threshold) {

    // 300~900 - Humid Soil
    // LEDProto
    digitalWrite(iLEDProto, LOW);
    // Serial
    Serial.print( "Humid Soil " );
    Serial.println( iSoilMoistureVal );
    // LEDGreen
    digitalWrite(iLEDGreen, HIGH);
    
  }
  else {
    
    // 0-300 Dry Soil
    // LEDGreen
    digitalWrite(iLEDGreen, LOW);
    // Serial
    Serial.print( "Dry Soil " );
    Serial.println( iSoilMoistureVal );
    // LEDProto
    digitalWrite(iLEDProto, HIGH);
    
  }

}

setup.ino

// Setup
void setup()
{
 
  // Delay
  delay(100);

  // Serial
  Serial.begin(57600);

  // Initialize the LED iLEDProto
  pinMode(iLEDProto, OUTPUT);

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

  // Delay 1 Second
  delay( 1000 );

}

——

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/
Patreon: https://patreon.com/DonLucElectronics59
DFRobot: https://learn.dfrobot.com/user-10186.html
Hackster.io: https://www.hackster.io/neosteam-labs
Elecrow: https://www.elecrow.com/share/sharepj/center/no/760816d385ebb1edc0732fd873bfbf13
TikTok: https://www.tiktok.com/@luc.paquin8
Twitch: https://www.twitch.tv/lucpaquin
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Project #30 – UNIHIKER – MEMS – Mk07

——

#DonLucElectronics #DonLuc #UNIHIKER #CH4 #VOC #Display #IoT #Project #Debian #Python #Thonny #DFRobot #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

MEMS

——

MEMS

——

MEMS

——

MEMS

MEMS (Micro-Electromechanical Systems) is the technology of microscopic devices incorporating both electronic and moving parts. MEMS are made up of components between 1 and 100 micrometres in size, and MEMS devices generally range in size from 20 micrometres to a millimetre, although components arranged in arrayscan be more than 1000 mm2. They usually consist of a central unit that processes data, an integrated circuit chip such as microprocessor, and several components that interact with the surroundings, such as microsensors.

DL2410Mk01

1 x UNIHIKER
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C

UNIHIKER

ADC1 – 21
ADC2 – 22
VIN – +5V
GND – GND

DL2410Mk01p

DL2410Mk01p.py

****** Don Luc Electronics © ******
Software Version Information
Project #30 - UNIHIKER - MEMS - Mk07
30-07
DL2410Mk01.py
DL2410Mk01
1 x UNIHIKER
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C

-*- coding: utf-8 -*-
"""
# Import the unihiker library
from unihiker import GUI

# Import the time library
import time

# Import the Board module from the pinpong.board package 
from pinpong.board import Board

# Import all modules from the pinpong.extension.unihiker package
from pinpong.extension.unihiker import *

# Initialize the board by selecting the board type and port number;
# if not specified, the program will automatically detect it
Board().begin()

# Initialize pin 21 as analog input mode
# Fermion: MEMS Methane CH4 Gas Detection Sensor
adc0 = Pin(Pin.P21, Pin.ANALOG)

# Initialize pin 22 as analog input mode
# Fermion: MEMS VOC Gas Detection Sensor
adc1 = Pin(Pin.P22, Pin.ANALOG)

# Instantiate the GUI class and create a gui object
gui = GUI()

# Display the initial background image 'DL2410Mk01p'
img = gui.draw_image(x=0, y=0, w=240, h=320, image='DL2410Mk01p.png')

# Fermion: MEMS Methane CH4 Gas Detection Sensor
# Display the initial Fermion: MEMS Methane CH4 Gas Detection Sensor valueCH4
valueCH4 = gui.draw_text(x=30, y=151, text='0', font_size=18)

# MEMS VOC
# Display the initial Fermion: MEMS VOC Gas Detection Sensor valueVOC
valueVOC = gui.draw_text(x=30, y=221, text='0', font_size=18)

while True:

    # Fermion: MEMS Methane CH4 Gas Detection Sensor
    # Read analog value
    CH4Sensor = adc0.read_analog()
    valueCH4.config(text=CH4Sensor)
    
    # Fermion: MEMS VOC Gas Detection Sensor
    # Read analog value
    VOCSensor = adc1.read_analog()
    valueVOC.config(text=VOCSensor)
    
    # Delay for 1 second to keep the screen content displayed for a longer time
    time.sleep(1)

——

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 – 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 #30 – UNIHIKER – MEMS CH4 – Mk06

——

#DonLucElectronics #DonLuc #UNIHIKER #CH4 #Display #IoT #Project #Debian #Python #Thonny #DFRobot #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.

DL2409Mk07

1 x UNIHIKER
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C

UNIHIKER

ADC – 21
VIN – +5V
GND – GND

DL2409Mk07p

DL2409Mk07p.py

"""
****** Don Luc Electronics © ******
Software Version Information
Project #30 - UNIHIKER - Fermion: MEMS CH4 - Mk06
30-06
DL2409Mk07.py
DL2409Mk07
1 x UNIHIKER
1 x Fermion: MEMS Methane CH4 Gas Detection Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C

-*- coding: utf-8 -*-
"""
# Import the unihiker library
from unihiker import GUI

# Import the time library
import time

# Import the Board module from the pinpong.board package 
from pinpong.board import Board

# Import all modules from the pinpong.extension.unihiker package
from pinpong.extension.unihiker import *

# Initialize the board by selecting the board type and port number;
# if not specified, the program will automatically detect it
Board().begin()

# Initialize pin 21 as analog input mode
# Fermion: MEMS Methane CH4 Gas Detection Sensor
adc0 = Pin(Pin.P21, Pin.ANALOG)

# Instantiate the GUI class and create a gui object
gui = GUI()

# Display the initial background image 'DL2409Mk07p'
img = gui.draw_image(x=0, y=0, w=240, h=320, image='DL2409Mk07p.png')

# Fermion: MEMS Methane CH4 Gas Detection Sensor
# Display the initial Fermion: MEMS Methane CH4 Gas Detection Sensor valueCH4
valueCH4 = gui.draw_text(x=30, y=151, text='0', font_size=18)

while True:

    # Fermion: MEMS Methane CH4 Gas Detection Sensor
    # Read analog value
    CH4Sensor = adc0.read_analog()
    valueCH4.config(text=CH4Sensor)
    
    # Delay for 1 second to keep the screen content displayed for a longer time
    time.sleep(1)

——

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 – SHTC3 – Mk30

——

#DonLucElectronics #DonLuc #DFRobot #ASM #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.

DL2409Mk06

1 x FireBeetle 2 ESP32-C6
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

DL2409Mk06p

DL2409Mk06p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #29 - DFRobot - SHTC3 - Mk30
29-30
DL2409Mk06p.ino
DL2409Mk06
1 x FireBeetle 2 ESP32-C6
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"

// 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-30";

void loop() {

  // SHTC3 Temperature and Humidity Sensor
  isSHTC3();
  
  // Gravity: Analog Soil Moisture Sensor
  isSoilMoisture();

  // DFRobot Display 240x320 - ASM - 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 - 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");
    // 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 );
    // SHTC3 Temperature
    screen.setCursor(0, 120);
    screen.println( "Tem: " );
    screen.setCursor(60, 120);
    screen.println( temperature );
    screen.setCursor(120, 120);
    screen.println( "C" );
    // SHTC3 Humidity
    screen.setCursor(0, 150);
    screen.println( "Hum: " );
    screen.setCursor(60, 150);
    screen.println( humidity );
    screen.setCursor(120, 150);
    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
  /**
   *    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);

  // 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 #30 – UNIHIKER – MEMS VOC – Mk05

——

#DonLucElectronics #DonLuc #UNIHIKER #VOC #Display #IoT #Project #Debian #Python #Thonny #DFRobot #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.

DL2409Mk05

1 x UNIHIKER
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C

UNIHIKER

ADC – 21
VIN – +5V
GND – GND

DL2409Mk05p

DL2409Mk05p.py

"""
****** Don Luc Electronics © ******
Software Version Information
Project #30 - UNIHIKER - Fermion: MEMS VOC - Mk05
30-05
DL2409Mk05.py
DL2409Mk05
1 x UNIHIKER
1 x Fermion: MEMS VOC Gas Detection Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C

-*- coding: utf-8 -*-
"""
# Import the unihiker library
from unihiker import GUI

# Import the time library
import time

# Import the Board module from the pinpong.board package 
from pinpong.board import Board

# Import all modules from the pinpong.extension.unihiker package
from pinpong.extension.unihiker import *

# Initialize the board by selecting the board type and port number;
# if not specified, the program will automatically detect it
Board().begin()

# Initialize pin 21 as analog input mode
# Fermion: MEMS VOC Gas Detection Sensor
adc0 = Pin(Pin.P21, Pin.ANALOG)

# Instantiate the GUI class and create a gui object
gui = GUI()

# Display the initial background image 'DL2409Mk05p'
img = gui.draw_image(x=0, y=0, w=240, h=320, image='DL2409Mk05p.png')

# MEMS VOC
# Display the initial Fermion: MEMS VOC Gas Detection Sensor valueVOC
valueVOC = gui.draw_text(x=30, y=151, text='0', font_size=18)

while True:

    # Fermion: MEMS VOC Gas Detection Sensor
    # Read analog value
    VOCSensor = adc0.read_analog()
    valueVOC.config(text=VOCSensor)
    
    # Delay for 1 second to keep the screen content displayed for a longer time
    time.sleep(1)

——

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

1 2 3 5
Categories
Archives