'Air Quality'에 해당되는 글 2건

  1. 2016.09.21 ACS712T Current Sensor Module 20A (ACS712T) [B039]
  2. 2016.09.11 Air Quality Sensor (MQ135) [S037]

ACS712T Current Sensor Module 20A (ACS712T) [B039]



https://www.youtube.com/watch?v=6NuyGoSPYO4


* Specs

Supply Voltage (VCC) 5Vdc Nominal

Measurement Range -20 to +20 Amps

Voltage at 0A VCC/2 (nominally 2.5Vdc)

Scale Factor 100 mV per Amp

Chip ACS712ELC-10A


* Contents

- Connect

VCC ---- 5V 

OUT ----- A0 

GND ----- GND 


Power+VCC -> Load/Sensor -> ACS712T (UP)

Power GND  ---------------> ACS712T (DOWN)


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


const int analogIn = A0;

int mVperAmp = 100; // use 100 for 20A Module and 66 for 30A Module

int RawValue= 0;

int ACSoffset = 2512; // default 2500 but i checked when this is disconnected to 2512

double Voltage = 0;

double Amps = 0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(analogIn,INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("B039:ACS712T Current");


  RawValue = analogRead(analogIn);

  Voltage = (RawValue / 1023.0) * 5000; // Gets you mV

  Amps = ((Voltage - ACSoffset) / mVperAmp);


  lcd.setCursor(0,1);

  lcd.print("RawValue=" + (String)RawValue + "  ");


  lcd.setCursor(0,2);

  lcd.print("Voltage=" + (String)Voltage + "");


  lcd.setCursor(0,3);

  lcd.print("=>Current=" + (String)Amps + " A ");  


  delay(1500);

}

Posted by RDIoT
|

Air Quality Sensor (MQ135) [S037]



https://www.youtube.com/watch?v=JJonDVX8CYQ


*GitHubhttps://github.com/rdiot/rdiot-s037.git


* Specs

Sensitive material of MQ135 gas sensor is SnO2, which with lower conductivity in clean air. When the

target combustible gas exist, The sensor’s conductivity is more higher along with the gas concentration

rising. Please use simple electrocircuit, Convert change of conductivity to correspond output signal of

gas concentration.

MQ135 gas sensor has high sensitity to Ammonia, Sulfide and Benze steam, also sensitive to smoke

and other harmful gases. It is with low cost and suitable for different application. 



* Contents

- Library : https://github.com/GeorgK/MQ135


- DataSheet : http://www.cooking-hacks.com/skin/frontend/default/cooking/pdf/MQ-135.pdf


- Connect


- Key Code

#include <MQ135.h>

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int pin = A0;

int sensorValue;

int ledPin = 13;


MQ135 gasSensor = MQ135(pin);

float rzero = gasSensor.getRZero();

int ppm = gasSensor.getPPM();


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S037:MQ135");



  sensorValue = analogRead(pin);

  lcd.setCursor(0,1);

  lcd.print("A0=" + (String)sensorValue + " Resis="+(String)gasSensor.getResistance() +" ");


  float rzero = gasSensor.getRZero();

  digitalWrite(ledPin, HIGH);      // turn the ledPin on

  delay(100);                      // stop the program for some time

  digitalWrite(ledPin, LOW);       // turn the ledPin off

  delay(100);  // stop the program for some time

 

  lcd.setCursor(0,2);

  lcd.print("rzero=" + (String)rzero + "    ");

 


  float co2_ppm = gasSensor.getPPM();

  int ppm = co2_ppm / 4;

  //Vrl = val * ( 5.00 / 1024.0  );      // V

  //Rs = 20000 * ( 5.00 - Vrl) / Vrl ;   // Ohm 

  //ratio =  Rs/Ro;     

  lcd.setCursor(0,3);

  lcd.print("co2 ppm=" + (String)co2_ppm + "    ");

    

  delay(1000);

}

Posted by RDIoT
|