Rodney Copeland
Published

Send SMS Text Messages when MQ135 Air Sensor Exceeds Limit

Monitor MQ135 and other gas sensors using USB port and send SMS text messages to your mobile device when the value exceeds upper limit.

BeginnerFull instructions provided1 hour1,511
Send SMS Text Messages when MQ135 Air Sensor Exceeds Limit

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Wemos d1 ch340
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1
MQ135 Air Quality Sensor
×1
Project Enclosure Box
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

OnSiteMonitor Desktop Software
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3/4 inch drill bit.

Story

Read more

Code

MQ135 Air Quality Sensor Sketch for use with OnSiteMonitor

Arduino
Use Arduino IDE to upload the sketch to the NodeMCU board.
//****************************************************************************
// Project:  Meter Reader
// This project will send output to the Serial Port so data can be read
// from a USB port on a computer.  
//
// This sketch was developed to work with the OnSiteMonitor platform.
// The OnSiteMonitor application created to work with this sketch can run in 
// "Stanalone" or "OSM" mode. 
//
// Standalone mode reads and display the data.
// OSM mode  - data is passed to OnSiteMonitor for access to full functionality
// including alerting, events/actions.  The data is also available remotely 
// by phone or computer.
//****************************************************************************
//
String account_id = "{update me}";
String device_type = "OSM Meter Reader";
String device_id = "{update me}";
String command_class = "1";
const int gasPin = A0; //GAS sensor output pin to Arduino analog A0 pin

void setup()
{
  Serial.begin(9600); //Initialize serial port - 9600 bps
}

void loop()
{
  Serial.println(account_id + "~" + device_type + "~" + device_id + "~" + analogRead(gasPin));
  delay(1000); // Print value every 1 sec.
}

Credits

Rodney Copeland
2 projects • 4 followers
Rodney Copeland IT Professional with a special interest in the design and development of IoT automation.

Comments