BRUH DIY Multisensor

It’s been 15 hours but no change in value, its still showing “705.52” and sensor is very hot.

I define pin D4 in the sketch and D4 is connected with DOUT pin of MQ-135.

Should I define A0 pin and connect with AOUT of MQ-135?

Did you wire it to the Vin pin or 3v3 ? The datasheet says it works on 5V, so it should be on Vin. Maybe it does not get enough power to work properly.
Are you sure also that it is well wired (no ground and Vcc inversion or something ?)
Did you try with only the sensor wired to the NodeMCU ? And with a different NodeMCU module ?

On top of that, Dout is for digital, it basically only sends LOW and HIGH signal. Aout is for analog, so if you wire to it you will get a changing reading. Note also that you probably have to put some resistor at some point to calibrate it

I wired it to the Vin pin and only MQ-135 is attached with NodeMCU.
I am going to define A0 pin in the sketch and connect to the Aout, hopefully it will work and will try different NodeMCU as well.

Thank you

check the mysensors page for gaz detection

1 Like

The output is analog, so it needs an analog pin.

@lambtho Nice, I use MySensors on my nano with the sensors from this project and a RFM96HCW radio :smiley:

I got it working, just change the pin to analog and leave it for 24 hours to burn-in…
see below ppm value:

is this value normal for indoor?

Thanks to @firstof9 and @lambtho

1 Like

Have a look at this article I found awhile ago https://www.kane.co.uk/knowledge-centre/what-are-safe-levels-of-co-and-co2-in-rooms

Per this post, ~100-150 ppm is fine in normal air.

Hope this helps.

2 Likes

mine is showing 130 to 145 . it’s mean sensor is working fine.

when I smoke it goes to 170

Hi Thomas (@lambtho) I have used the code below that you provided to @mudasar8k and things are working fine. However I wanted to find out:

If itspossible to get the sensor to detect the temperature every 5 mins and display it on HA every 5mins? How can I achieve this?

Yes it should be possible. I am not a specialist of arduino coding so I can’t give you an answer right away, but I will look at it this weekend as I would also be interested in forcing the update

I just foud this somewhere…

#define FIVEMIN (1000UL * 60 * 5)
unsigned long rolltime = millis() + FIVEMIN;
void loop() {
 
 // signed comparison for proper handling of timer rollover
 
  if((long)(millis() - rolltime) >= 0) {

   //  Do your five minute roll stuff here

   rolltime += FIVEMIN;

 }
 
}

I am also a noob when it comes to using arduino.

So Ben’s code needs to be inserted after the line “Do your 5 min roll stuff here” I suppose?!

Well if you take his original code here:

you would put at line 138

#define FIVEMIN (1000UL * 60 * 5)
unsigned long rolltime = millis() + FIVEMIN;

and then on 438

if((long)(millis() - rolltime) >= 0) {
sendState();
rolltime += FIVEMIN;
 }

That should do the trick :wink: . I’m at work now, so I can’t test it. But it should do fine.
So basically it runs like this:
The function millis() returns the time the code has been running. So you initialize rolltime as millis()+5min
Then in the loop you check if millis() is > rolltime. If it is, you sendState() and update rolltime of 5 minutes for next time.

So basically, it will force an update every five minutes, and also as usual when there is a large change in temp/humidity/light/whatever
And if you want to roll every 10 min instead of 5 just change
#define FIVEMIN (1000UL * 60 * 10) (you can change de name of the variable to TENMIN to be more consistant too :stuck_out_tongue: )

1 Like

Perfect! Thanks for this will try it when I get home

1 Like

BRUH added heatIndex/Real Feel functionality in the code.

check this:

3 Likes

so, did you get time to try it ?

not yet will try it tomorrow, did you try it?

not yet… plenty of stuff to do today, so I won’t be able to test before tomorrow :smiley:

EDIT: @bachoo786, I tried the code to force update every 5 min, everything is working fine as expected.

1 Like

Just want to share my battery powered multisensor outdoor, it can be charges via micro USB :slight_smile:

3 Likes

how often do you need to charge ? could you provide a schematics of the wiring for the battery and a list of the components required ?