Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
TIMOTHY MWALA
Published © GPL3+

Build Your Own Air-Quality-Meter

Measure and monitor indoor air quality effortlessly with our DIY project using SGP30, ensuring a healthier and safer living environment!

BeginnerFull instructions provided1 hour1,267
Build Your Own Air-Quality-Meter

Things used in this project

Hardware components

Tripler Adapter
×1
sgp30
×1
ESP8266 D1-mini
×1
OLED display
×1

Software apps and online services

Webflashing tool
Arduino IDE
Arduino IDE

Story

Read more

Schematics

SGP30_D1-Mini_0.66-OLED_cloudfree

I recommend using a tripler as it is easy to mount and run your project

Code

SGP30_D1-Mini_0.66-OLED_cloudfree

C/C++
cloud free Air quality meter
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_SGP30.h>

#define OLED_RESET 0 // GPIO0
Adafruit_SSD1306 display(OLED_RESET);

Adafruit_SGP30 sgp30; 

void setup()
{

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  if (sgp30.begin() == false)
  {

    while (1)
      ;
  }


}

void loop()
{

  delay(1000);

  display.clearDisplay();
  display.setTextSize(1);
  display.setCursor(40, 10);
  display.setTextColor(WHITE);

  if (sgp30.IAQmeasure())
  {

    display.println("CO2: ");
    display.setTextSize(1);
    display.setCursor(75, 10);
    display.println(sgp30.eCO2);

    display.setTextSize(1);
     display.setCursor(40, 23);
    display.println("TVOC: ");

    display.setTextSize(1);
     display.setCursor(75, 23);
    display.println(sgp30.TVOC);

    display.display();
  }
  else
  {
    display.println("Error!");
    display.display();

    while (1)
    {
      ;
    }
    
  }
  
  
}

Air Quality Meter

this is an SGP30 and D1 mini setup with an OLED to display the air quality

Credits

TIMOTHY MWALA
29 projects • 17 followers
I am an Embedded engineer who like prototyping
Contact

Comments

Please log in or sign up to comment.