BRUH DIY Multisensor

yep +10char

1 Like

@lambtho with your help I did it just changed mqtt topic and sensorname.

Thank you @lambtho

1 Like

Hi can I ask you how often does your humidity readings change? Because when I blow on my dht22 sensor I get a lag of good 10mins before the value changes. Is that normal?

I haven’t linked mine to HA yet just playing around in the Arduino serial monitor.

Also the temperature readings I get are incorrect, the readings I get are way warmer than the actual readings in the room. Is yours the same?

Thanks.

It took me a while before mine could show on the arduino IDE platform. I actually restarted my computer 10 or more times.

It’s instantaneous change with mine… If I remeber correctly in BRUH’s code the sensor only updates when it records a 2% difference. I will look into forcing an update every 2 min, even if the value has not change (in order to have more coherent graphs in case of a fast decrease/increase after a long steady state.

For the temp readings, it depends on the enclosure you are using. Try putting the DHT outside the box, an normally you will have a more accurate reading (typically less than 0.5°C difference with my thermostat).
The nodemcu generates a bit a heat while it is working, this leads to a 3-4°C increase of temperature in the enclosure. So I did a small calibration (basically put one sensor node in the enclosure and near it a second one without enclosure and with the DHT as far as possible from the nodemcu). Then I recorded the average difference between the two readings during one day and I updated the code of the nodemcu in the enclosure to substract it from the reading.

Right so it seems the humidity results seem correct but the temperature results are not correct as I have not put the DHT sensor in any inclosure and it gives me high results.

can you define ‘way warmer’ or ‘high temperature’ ? and what unit are you looking for, celcius or fahrenheit ?

If it is values around 65-75-80°, that’s because bruh’s code returns °F and not °C. In order to change, you must modify the line in arduino ide (somewhere around line 415 I think)

For °F
float newTempValue = dht.readTemperature(true);

For °C, remove the true
float newTempValue = dht.readTemperature();

Anyone have an idea why this sensor runs fine off of my computer’s usb port but is very finicky with any other power supply I try, including a 5V 3A one that I just purchased? it seems to get stuck in the wdt reset loop, which I thought could be an indication of underpower… but, 3A… hmm

I’ll check it out! I printed a simple enclosure for a DHT22 and an esp8266…: https://www.thingiverse.com/thing:2404553

well its not the values of 65-70-80 degrees but just high by 7-8 degrees.

I have done that for Celsius and removed the “true”.

I am guessing its the DHT sensor that is giving me inaccurate readings.

Is it in direct sunlight (seems stupid, but sometimes it is the most simplest explanation :smiley: ) or any other external possibility (just next to a radiator, behind a tv, a computer or something that heat) ?

lol nope its just in my living room away from sun light and I have not put it in the enclosure yet.

@revz, could just be a crappy USB power supply. Some of these things generate horrible power that could be adequate for charging a battery, but might have enough noise or ripple (or just be out of spec) to annoy a real processor. If you have a multimeter, check the DC voltage (under load).

Then, just for kicks, check the AC voltage and that should be zero (no AC ripple) indicating a well filtered power supply. Ideally, you’d look at it with an oscilloscope, but any AC voltage (could just be 10’s of millivolts or more… not 110VAC!) that shows up is a sign of trouble.

2 Likes

Then maybe it is a defect dht. Try ordering a new one…
Meanwhile if the error is constant (always 6/7° off) you can substract it from the value it sends to mqtt.

Hi All,

I have managed to make the sensor, printed the enclosure, but…

how do you place the board with all the components and wires in the enclosure?
Even when I managed to get everything using a lot of pressure it seems that the light sensor is covered by all the wires and does not report changes :confused:

I find that being the pins up by 45degrees on the light sensor makes for more room, then bend them back down to trap in your light sensor.

I use the KY-018 LDR light sensor, I bend the light sensor around the board so it sits on the back side of the board and bend the pins up 90degrees so it fits better.

The light sensor pins I leave straight, tick all the wires down either side on the box and then squash the NodeMCU on top with the pins slotting down either side of everything.

Made 10 of them and never had a problem :slight_smile:

1 Like

Thank you!

Ok, that is sound advice, thank you @lmamakos . Is this a particularly sensitive circuit or board I wonder? Because I have been powering other arduino / raspberrypi etc boards for a years with relatively no issue on the power supply side. I will check this out, perhaps all of my supplies are dirty and I’ve just been having good luck till now. :thinking:

Has anyone attempted to implement a web GUI into the BRUH code?

Reason I ask is I have around 10 Nodes and I recently had to change my WiFi Password. It’s not too bad doing it via OTA in Arduino but it would have been awesome to just browse to each node and set a new password. Same could be said if you changed your MQTT server login.

Cheers!

@revz I don’t think that the ESP8266 is particularly sensitive, especially since it regulates the 5v down to 3.3v to run the chip. On the other hand, I have seen some some extraordinarily crappy USB power supplies/chargers. The spec on one of them was just total fiction. The problem is that these things are such a commodity these days, that it’s a race to the bottom to build the cheaper versions.

The fact that it works from you laptop is a real clue here… You might just have a dud power supply.