Project #15: Environment – Gas Sensor MQ3 – Mk30

——

#DonLucElectronics #DonLuc #GasSensorMQ3 #Arduino #EEPROM #Display #Elecrow #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant

——

Gas Sensor MQ3

——

Gas Sensor MQ3

——

Gas Sensor MQ3

——

Crowtail – Gas Sensor MQ3

The module contains a MQ-3 Gas Sensor and ETA1036. High sensitivity to alcohol and small sensitivity to benzine with a stable and long worklife are most important reasons to choose the MQ-3. The ETA1036 is a high efficiency synchronous step-up converter that can provide up to 3W of power to a boosted output from a low voltage source. The start-up voltage requires only 0.85v and the efficiency up to 96%. The MQ-3 is useful for alcohol detecting.

Crowtail – LED Matrix 2.0 – (Red)

A 8×8 LED matrix has lots of applications when we DIY some electronic kit. So we this Crowtail- 8×8 LED Matrix use the HT16K33 which is a neat little chip that has the ability to drive a multiplexed 8×8 matrix. The I2C communication protocol uses only 2 pins, and you can have up to 8 selectable I2C addresses so that a total of 8 matrices, each one controlling 8×8 LEDs for 64 total LEDs.

DL2505Mk05

1 x Crowduino Uno – SD
1 x Crowtail – Base Shield
1 x Crowtail – I2C LCD
1 x Crowtail – Gas Sensor MQ3
1 x Crowtail – LED Matrix 2.0
1 x Crowtail – LED(Green)
1 x USB Battery Pack
1 x USB Mini-B Cable

Crowduino Uno – SD

SCL – A5
SDA – A4
MQ3 – A0
LED – 6
VIN – +5V
GND – GND

DL2505Mk05p

DL2505Mk05p.ino

/****** Don Luc Electronics © ******
Software Version Information
Project #15: Environment - Gas Sensor MQ3 - Mk30
DL2505Mk05p.ino
DL2505Mk05
1 x Crowduino Uno - SD
1 x Crowtail - Base Shield
1 x Crowtail - I2C LCD
1 x Crowtail - Gas Sensor MQ3
1 x Crowtail - LED Matrix 2.0
1 x Crowtail - LED(Green)
1 x USB Battery Pack
1 x USB Mini-B Cable
*/

// Include the Library Code
// EEPROM library to read and write EEPROM with unique ID for unit
#include <EEPROM.h>
// Wire
#include <Wire.h>
// Liquid Crystal
#include "LiquidCrystal.h"
// Matrix Adafruit LED Backpack
#include "Adafruit_LEDBackpack.h"

// 8x8 Matrix 
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
// BMP
static const uint8_t PROGMEM
  smile_bmp[] =
  { B00111100,
    B01000010,
    B10100101,
    B10000001,
    B10100101,
    B10011001,
    B01000010,
    B00111100 },
  neutral_bmp[] =
  { B00111100,
    B01000010,
    B10100101,
    B10000001,
    B10111101,
    B10000001,
    B01000010,
    B00111100 },
  frown_bmp[] =
  { B00111100,
    B01000010,
    B10100101,
    B10000001,
    B10011001,
    B10100101,
    B01000010,
    B00111100 };

// MQ3 Alcohol
int iMQ3Alcohol = A0;
// MQ3 Value
float MQ3Value;
// Sober
#define Sober 120
// Drunk
#define Drunk 400

// Liquid Crystal
// Connect via i2c
LiquidCrystal lcd(0);

// LED Green
int iLEDGreen = 6;

// EEPROM Unique ID Information
String uid = "";

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

void loop() {

  // MQ3 Alcohol
  // isMQ3
  isMQ3();

  // Display Alcohol
  isDisplayAlcohol();

  // Delay
  delay( 2000 );

}

getDisplay.ino

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

  // Set up the LCD's number of rows and columns: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  // Cursor
  lcd.setCursor(0, 0);
  lcd.print("Don Luc Electron");
  // Cursor
  lcd.setCursor(0, 1);
  // Print a message to the LCD.
  lcd.print( sver );

}
// Display Alcohol
void isDisplayAlcohol(){

  // Clear
  lcd.clear();
  // Set the cursor to column 0, line 0
  lcd.setCursor(0, 0);
  lcd.print( "MQ3 Alcohol" );
  // Set the cursor to column 0, line 1
  lcd.setCursor(0, 1);
  lcd.print( MQ3Value );
  
}

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

getMQ3.ino

// MQ3 Alcohol
// isMQ3
void isMQ3(){

  // MQ3 Alcohol
  MQ3Value = digitalRead(iMQ3Alcohol);

  // Determine the status
  if (MQ3Value < Sober) {
    
    // Smile
    matrix.clear();
    matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    
  } else if (MQ3Value >= Sober && MQ3Value < Drunk) {

     // Neutral
     matrix.clear();
     matrix.drawBitmap(0, 0, neutral_bmp, 8, 8, LED_ON);
     matrix.writeDisplay();

    
  } else {

    // DRUNK
    matrix.clear();
    matrix.drawBitmap(0, 0, frown_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();

  }

}

setup.ino

// Setup
void setup()
{
 
  // Delay
  delay(100);
  
  // isUID EEPROM Unique ID
  isUID();
  
  // Delay
  delay(100);

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

  // Delay
  delay(100);

  // 8x8 Matrix 
  matrix.begin(0x70);
  // Smile
  matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_ON);
  matrix.writeDisplay();

  // Delay
  delay( 100 );

  // Display UID
  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
Hackster: https://www.hackster.io/luc-paquin
LinkedIn: https://www.linkedin.com/in/jlucpaquin/

Don Luc

Leave a Comment