Hi Guys ! i am currently working on a water quality project, i am using mq135 sensor to detect nh3 or Ammonia present in an aquarium . i bought a windshield cleaner with ammonia for detecting samples, but
the mq135 show 100+ value of PPM. can you give me ideas or better answers to display the right amount of PPM of nh3 ?
Here's my code below. i know its kinda simple because i am just starting my project. sorry if it bothers you.
int sensorValue;
void setup()
{
Serial.begin(9600);
Â
}
void loop()
{
sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(1000);
}
The sensor does NOT return PPM. You need to map the value that you read from the sensor to PPM, somehow. The datasheet for the sensor will explain the relationship between the value you read and PPM.
If you need help understanding the relationship, you'll need to post a link to the datasheet.
Can you post a link to the device you are actually using, as well as a schematic?
The MQ135-datasheet1.pdf file shows, on the first page, how the sensor needs to be connected to the Arduino. At a minimum, VRL and GND needed to be connected to the Arduino, AND a suitable value for RL needs to be selected.
You then take a reading with the sensor in 100PPM Ammonia. That gives you a value, Ro. Then, you take a reading in the unknown air. That gives you Rs.
You then use the chart on page 2, left side. The value of Rs/Ro is found on the vertical axis. Where the horizontal line intersects the colored line corresponding to the gas you are measuring gives you a point. The vertical line through that point tells you the concentration of the gas.
Note that the chart is not linear in either direction.