Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
supersjimmieS

supersjimmie

@supersjimmie
About
Posts
5
Topics
0
Shares
0
Groups
0
Followers
1
Following
0

Posts

Recent Best Controversial

  • Air Quality Sensor
    supersjimmieS supersjimmie

    For those who are trying to use an MQ135 module from e-bay or other sellers, on a small pcb with a chip, LED and potmeter:
    It took me a while until I figured out that the little chip has a very big influence on the value that you read on the A-out pin.
    Only after removing the connection between the A-out pin and the little chip, I got normal measurements.

    I also replaced the small resistor marked "102" with a 10k resistor, to make measurements more compatible with code that uses a 10k pull down resistor. But that was already a known issue, found on many other places.

    Hardware calibration aqi gas sensor hcho air quality

  • Air Quality Sensor
    supersjimmieS supersjimmie

    @epierre I striped-down that AirQuality-Multiple_Gas_Sensor1_4.ino to use only MQ135.
    When used inside, the analogRead is 473, so a reasonble value.
    But the MQCalibration function returns 0. Which means the MQResistanceCalculation also returns 0.

    MQResistenceCalculation only does one calc:
    return (long)((long)(1024 * 1000 * (long)rl_value)/raw_adc-(long)rl_value);
    rl_value = float RL4 = 0.990
    raw_adc = 473 (measured as said above)
    (1024 * 1000 * 0.990) / 473 - 0.990 = 2142.266
    I checked that raw_adc is filled with the correct value (to be sure it is not lost somewhere).

    What looks to fix this, I changed everything to float . So:
    return (float)((float)(1024 .* 1000. * (float)rl_value)/raw_adc-(float)rl_value);
    Which can be simplyfied as:
    return ((1024 * 1000*rl_value)/raw_adc-rl_value);
    I went to float, because the function is created as float MQResistenceCalculation.

    This now gives some ppm values that are within a reasonable range (about 2000 here).

    Now I have to figure out how to do calibration on this method again...

    Hardware calibration aqi gas sensor hcho air quality

  • Air Quality Sensor
    supersjimmieS supersjimmie

    Thanks, but when calibrating something strange happens when I put the module outside:

    valr 270
    Vrl   / Rs       / ratio  / ppm
    61355 / 95673.00 / 0.00 / 399.00
    valr 265
    Vrl   / Rs       / ratio  / ppm
    62928 / 98126.00 / 0.00 / 399.00
    valr 260
    Vrl   / Rs       / ratio  / ppm
    64561 / 100673.00 / 0.00 / 399.00
    valr 256
    Vrl   / Rs       / ratio  / ppm
    378 / 589.00 / 0.00 / 399.00
    valr 252
    Vrl   / Rs       / ratio  / ppm
    1773 / 2764.00 / 0.00 / 399.00
    

    As you can see, the valr decreases slowly, but suddenly Vlr and Rs jump over.
    Vlr is the value of 'val', which is: uint16_t val = ((float)22000*(1023-valr)/valr);
    uint16_t is 16bit, so max 65535. It looks like my environment needs more than that?
    (in fact, your code defines the defaultro as 68550, which is also too much for a uint16?)

    Hardware calibration aqi gas sensor hcho air quality

  • Air Quality Sensor
    supersjimmieS supersjimmie

    @epierre Thanks, I thought it would be something like that, but that didn't work.
    I then got

    valr 242
    Vrl / Rs / ratio:5464 / 8520.00 / 0.00
    

    Nothing like around 400ppm.

    Hardware calibration aqi gas sensor hcho air quality

  • Air Quality Sensor
    supersjimmieS supersjimmie

    @epierre I am testing a stripped-down version of your code from your AirQuality-MQ135.ino. I stripped it to make it run just stand-alone.
    What I don't understand is how to do the calibration. When I run it in outside environment (with 10k resistor), I get these values:

    valr 223
    Vrl / Rs / ratio:13387 / 20875.00 / 0.00
    

    What would be the next step for calibration?

    Hardware calibration aqi gas sensor hcho air quality
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular