Project

General

Profile

3D printed Stevenson screen for the DHT22

Added by dzach almost 6 years ago

Hi all

I’m trying to set up a simple temperature/humidity/light meter in the boiler room. The Jeenode will be housed on a DIN rail inside the room and the sensors, DHT22 and photoresistor, will be located outdoors, and will be housed in something like this:

The above 3D printed housing is a failure, because there is not enough air circulation inside, despite the fact that the bottom was intentionally left open:

I’ll have to put some openings on the cylindrical surface to allow more air circulation. The problem I have is different though. Running the dht_demo.ino sketch gives:

[dht_demo]
temperature = 8
humidity = 17

temperature = 8
humidity = 17

These readings are wrong. Temperature is measured with a thermocouple: 19°C:

The JeeLabs article linked above says:

The DHT11 and DHT22 sensors measure temperature and humidity, and are easy to interface 
because they only require a single I/O pin. They differ in their measurement accuracy, 
but are in fact fully interchangeable.

but I read elsewhere on the internets that The hardware pins and handshake are identical but it uses a different dataformat. . In fact, running the code from that link gives me:

DHT TEST PROGRAM 
LIBRARY VERSION: 0.1.05

Type,   status, Humidity (%),   Temperature (C)
DHT22,  OK, 45.3,   21.9
DHT22,  OK, 45.3,   21.9

which is a lot closer to the expected values.
Any suggestions on what might be wrong?


Replies (26)

RE: DHT22 problems - Added by jcw almost 6 years ago

There was a bug in the DHT code, fixed not so long ago - set the third arg to true while reading out a DHT22:

bool DHTx::reading (int& temp, int &humi, bool precise =false);

RE: DHT22 problems [SOLVED] - Added by dzach almost 6 years ago

Thanks jcw, that did it!

3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

So now, with the main problem solved, I redesigned the housing of the DTH22 and LDR sensors, to allow more air circulation. Meteorologists have been doing it for many decades, it is called a Stevenson screen , and here is my 3D printed version of one for the DHT22:


The LDR goes through the top opening, and must be made water tight. I should have used white ABS, as it is has higher melt temperature, but only had natural PLA. I shall paint it white, before commissioning it.

Parts used:


The strip-board mounts on the bottom section and is secured with one screw.

There are 7 printed sections that slide on the M3 supports from the top. The little plastic rings between the sections are small supports that need to be removed, in order to achieve an vertical overlap of 2.5mm between the sections. Here is the second section in place:

The finished bottom:


As open as possible, with an M6 threaded hole for mounting. The M3 supports were cut a little lognger than necessary.

… and the final product mounted on the test bench (kind of) together with a JeeNode v6 on the DIN rail:

Attached are the STL files, in case someone wants to print it.

3D printer settings:

Layer thickness: 0.39mm
Width/Thickness: 2
Perimeters:      2
Speed:           33mm/s

RE: 3D printed Stevenson screen for the DHT22 - Added by dabbishaw almost 6 years ago

I’m very jealous of your 3D printer, although I wonder if you’ve made your Stevenson screen a little too small. Here’s a picture of mine.

Also for measuring light, I found an LDR to be a little digital in its reading, I’m looking for a way to know where a day or night is particularly bright or dark so I switch over to an LUX monitor and collect both the light and low values.

Here’s an example of my light measurements graphed using the LDR sensor.

24hours.png (48.8 KB) 24hours.png LDR Graph
SSphoto.JPG (377 KB) SSphoto.JPG Stevenson Screen
SSphoto.JPG (374 KB) SSphoto.JPG
1173
1174
1175

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

You are probably right, but I had a reason: it was supposed to be connected to the boiler room node and mounted outdoors on the boiler room wall, half protected from rain. I wanted it to be as little visible as possible. Now plans have changed; the fact that the position is half protected skews the measurements. The graph tells the story (although right now, for ease of testing, the sensor sits inside a glass window and not outdoors):

The rising sun “sees” the sensor in the morning but is then gradually obstructed by the garden trees. There is no place around the boiler room that could give better readings, so I will have to install the sensor on the roof. That shelter will be similar but at least 3 times the size of this one to better protect the sensor from swirling rain and moisture.

Yes, the LDR is noisy at the low light (high resistance) end. The LDR is connected to Vcc and the other side is pulled low with a 4.7MOhm resistor for increased sensitivity. To decrease the sensitivity in high light conditions I use a second resistor with a 3.3 kOhm value which is connected in parallel with the first one and connected to the ground through a digital pin. Normally the pin is in the high impedance INPUT mode, but for reduced sensitivity I turn it to OUTPUT mode and drive it LOW, thus grounding the 3.3k resistor through that pin. Here is the same graph as above but displayed in a power, instead of linear, percentage scale:


Humidity and oil level also share the same percentage scale.

A lot of noise but not much detail.

RE: 3D printed Stevenson screen for the DHT22 - Added by dabbishaw almost 6 years ago

I like your graphs, what are you using to create them?

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

I use D3JS SVG graphics in the browser with Wibble a pure TCL web server for the back end, with data stored in an SQLite database. Aesthetics and GUI work takes a lot more time than I’d be prepared to spend, but unfortunately I mostly end up spending it. At the moment the code is bit of a hack. One shortcoming of trying to have them uncluttered is that the dual scales are too much far on the left. To compensate for that I created a cross-hair cursor. Here is all the real data I have collected so far (the rest I have is test data from the sensors on my desk):


Not much to see here, inside the boiler room. Nature is slowly changing the seasons, temperature is rising day-by-day (good to have the cursor to see that!) and humidity in the boiler room is … dancing, probably due to the neighboring back yard greenery. The multi-turn oil level potentiometer (green line) had a connection problem that showed up in the middle of the night and disappeared early in the morning. Hadn’t it be for the graph, the event would have passed unnoticed.

I also plan to use Cubism which does what I want, but is rather difficult to deploy. I managed, at the cost of half a night’s sleep, to make it display fake data served by the TCL web server and, given time, will have it display real historical data.

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

Here is an update for this project:

Reprinted a larger Stevenson screen which leaves more empty space:


The blue cylinder is a battery holder and booster from 1.2V to 5V

The top of the screen now houses both the LDR and a 2V, 50mA solar panel, which trickle charges the NiMH battery:

The aluminum battery holder screws on a fitting printed out of white ABS:


The 1 to 5V DC/DC booster costs about 1.4€ and I got it from ebay . I found the 2V, 56mA 30x36mm solar panels in a 10x package for 0.50€ each, here .


LDR and PV panel fitted on the top section of the 3D printed Stevenson screen

Here is a 4 day overview of the received data. The screen is mounted outdoors and has so far survived mild rains occurring at about 3:00 pm every day.


The top green curve is the battery voltage in 10x mV. The noise that appears on the other curves is due to inadequate DC filtering of the 5V coming out of the DC/DC converter.

Here is a detailed snapshot of the battery voltage curve:


The noise showing on the low voltage side of the booster, where the battery is connected, is rather normal here and it’s caused by the switching nature of the booster circuit

Here is a filtered one (30min avg):


There is a shunt resistor that drives the excess current to the ground, leaving only ~1.5V @7mA for the battery. Despite the cloudy days, the battery charger seems to be working fine, picking up some more charge every day

The booster itself is a tiny PCB that fits inside the blue alumunum battery holder.

The roughly calculated rate of discharge is 1.941 2.15 mV/h and the rate of charge aprox. 306 13.9 mV/h at the moment. The sketch runs some of jcw’s low power tricks and sleep modes.

Thank you jcw for your invaluable work!

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

The 3D printed (white ABS) Stevenson screen in service, under the morning sun:


One of the support screws is longer and plays the role of the antenna for the RFM12B module @433MHz

The solar panel + battery + booster power supply is adequate for this node but not very efficient. There are 2x DC/DC conversions that take place: 1.2V > 5V (voltage booster) and 5V> 3.3V (node regulator). An 1.2V -> 3.3V DC/DC converter would be best in this case.

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

dabbishaw wrote:
> I’m very jealous of your 3D printer, although I wonder if you’ve made your Stevenson screen a little too small.
Well, even with a 3 times larger screen, I apparently got moisture inside, during a last night’s heavy rainfall:


The saturated humidity curve shows the time of occurrence of the heavy rainfall. At the same time, the battery voltage shows a fluctuation exceeding the up to then maximum, an indication that things went wrong


Zoomed in detail of the battery voltage

Conclusion: back to the drawing board. An even larger Stevenson screen may be necessary or separation of DHT22 and better protection/separate housing of the electronics.

rain0.png (33.6 KB) rain0.png
rain1.png (28.1 KB) rain1.png
1248
1249

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

Moisture on the electronics inside the Stevenson screen:

Here is the circuit I use to trickle charge an AA NiMH battery with a 2V, 50mA solar cell, and measure the battery voltage:

To remove some of the noise created by the switching nature of the booster, I have inserted an RC filter (1MΩ, 0.1μF) before the A0 input:

The circuit could probably be improved, or adapted to suit different solar cells or batteries, but it works fine with the indicated components as is.

RE: 3D printed Stevenson screen for the DHT22 - Added by JohnO almost 6 years ago

Is the moisture caused by condensation on the cold aluminum of the battery holder?

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 6 years ago

I’m afraid not. Moisture was found on the PCB too. I suspect splashing was the reason (if you notice the proximity of the supporting parapet a few pictures above) or water intrusion through the top section, but cannot be sure. The top section was still found watertight.

The rainfall was very heavy. I believe that covering the electronics (but not the DHT22), using a longer support tube and changing the top section could correct most of the problem. In any case, I’ll test the new design in the shower before I put it back to service :-)

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach over 5 years ago

Update:

Redesigned the top section (now it is one piece instead of two) and designed an internal cover for the electronics:


Red cover for the electronics
The DHT22 mounts on its surface near the center of the Stevenson screen:

The new design was tested for about 15’ under heavy rain (simulated by a bath shower):


Under test conditions humidity goes to 99.99%

This time the PV panel and LDR were glued with silicone instead of hot glue.
The under side of the base, although covered by the lower Stevenson section, gathered a lot of droplets from splashing, but the interior showed no visible moisture.
The battery charger works fine. It tops the battery to 1.4V and keeps it there while the PV panel is illuminated. In the shade, the battery voltage drops to approx. 1.3V

RE: 3D printed Stevenson screen for the DHT22 - Added by padvinder95 over 5 years ago

What an excellent series :) I will definitely copy some of your ideas when I get around to installing my own sensors, although I don’t have access to a 3D printer myself. (Well, there’s one at my lab at university, but that’s reeeaallly expensive in material costs.)

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach over 5 years ago

Thanks padvinder95. JCW provides ideas, software and forum that form a solid base from where others can take off. I’d be really happy if this series proves to be useful to someone else too :)

I think dabbishaw was absolutely right about the size of the Stevenson screen. There is no reason to pack the electronics inside a small cage, if space is not an issue. 3D printing makes it very easy to produce final products, indeed.

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach over 5 years ago

Update.

The Stevenson screen has been commissioned to its final place, on the roof, mounted on the solar heater’s tube that brings hot water in the water tank. Since that is another physical quality that can be measured, I added a DS18B20 sensor to the node and started measuring the hot water entering the tank:


Dips in the curves are caused by clouds hiding the sun. The units are °C

Interestingly, this proved to be a much better measurement for illumination than the current LDR, because the LDR is tuned rather to lower illumination and looks saturated during the day. That needs to change if/when the node will come back in the lab for maintenance:


This shows that the solar heater’s panels are turned somewhat to the west, since they are not centered to the LDR curve measuring illumination. Daylight Savings Time obviously plays a role too.

An interesting phenomenon happens at the verge of the panel’s operation, when the sunlight is heating the panel just enough to start/stop circulation. As the water starts/stops its natural hot/cold circulation the sensor sees a sudden dip in temperature (or that is my explanation):

The battery charging circuit does a superb job so far. Here is an 8 day graph depicting the slow topping of the 1800mAh battery by trickle charging it with an approx. C/260 current (7mA):


Node was turned on with the battery half charged at 1.17V. Units in the graph are Volts/10

I have still to find out what exactly will be the voltage when it is fully charged. Perhaps 1.48 - 1.5V ?

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach over 5 years ago

Update:

Answering my own question, it looks like the fully charged voltage of the AA NiMH battery, with the trickle/float voltage charging circuit shown earlier in this thread, is 1.48V.


15 days of operation for the 1800mAh, 1.2V AA NiMH battery.

It now remains to be seen how long the battery will last under these charge/discharge conditions

RE: 3D printed Stevenson screen for the DHT22 - Added by padvinder95 over 5 years ago

I bought the same battery holder+boost converter combination with some cheap solar cells, so when I have some time I’m going to assemble them and see how well I can get it to work. :)

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach over 5 years ago

Good!
My little solar cell is 2V (nominal). I calculated the internal resistance to be approx. 40Ω by measuring open circuit voltage and short circuit current under full illumination, and that gave me the 100Ω shunt resistor that limits the voltage across the battery to ~1.5V.

The only issue is that the booster starts operating at around 1.2 1.1V, so the battery needs to be charged first. I am not sure what happens if the battery is below 1.2V.

RE: 3D printed Stevenson screen for the DHT22 - Added by padvinder95 over 5 years ago

Hmm, need to get myself a schottky—thought I had a couple lying around, but apparently I was mistaken. It took me some time to find a proper connection point for the battery cathode (or is it the anode while charging?) (sense+charge), by the way. I ended up soldering it to what I hope is the right side of L1, because I couldn’t route it out of the battery holder when soldered directly to the battery pad at the bottom side of the PCB (if the top is where the plug goes into it). Where did you connect this?

As to your calculation for load resistor of 100 Ohm: I also find a ~40 Ohm internal resistance, but if you add that 100 Ohm, that voltage divider will give you 2*100/140=1.43V unloaded, before the diode. The latter will subtract another 20-30 mV, so you’d end up around 1.18 V. How then your battery is charged to 1.48 V I cannot fully understand, although of course the diode’s drop might decrease under the very low current trickle charge conditions. Still, you might have to increase that load resistor value a bit when the sun isn’t as bright as it is now. (Or are you living on the southern hemisphere and is it already winter?)

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach over 5 years ago

The voltage from the solar cell is 2V nominal, it goes up to 2.5V IIRC, when the sky is clear and blue (late spring - early summer). A few days of heavy clouds lowered the highest values but kept the voltage swing well above the ~1.1V limit (see the graphs above). During the coming winter I may collect better data about the performance of this circuit. Of course one might employ a simple switch in software with a MOSFET and allow more voltage while charging and then cut off the PV when fully charged, but that’s another little project for the future.

You could probably use another diode instead of a schottky but you’d need to measure its forward voltage drop and take that into account when calculating the resistor.

Here is a picture of the points where I connected the cables, after removing the jack:


Red is 5V, gray is battery, soldered on the anode pin of that big diode(?)

RE: 3D printed Stevenson screen for the DHT22 - Added by padvinder95 over 5 years ago

Ah, I left the jack on so it wasn’t very much accessible; I soldered the battery lead to the inductor just right of your grey wire—I think it looks like it is the same PCB trace that you soldered yours onto.
Next time I’ll probably be better off removing the jack and just putting a connector on the JeeNode end.

RE: 3D printed Stevenson screen for the DHT22 - Added by xz81 almost 5 years ago

congrats and thanks to dzach for the work with this sensor. Would you share your last Stevenson’s screen STLs? It would be nice for me to print one of these.

RE: 3D printed Stevenson screen for the DHT22 - Added by dzach almost 5 years ago

Sure.
You should print 3 mid sections and the top section, the base of the screen, the battery holder and the battery holder cover. I included a pivoted bracket that can be mounted at the base to help position the screen. Hopefully, I haven’t missed anything.

By the way, XZ81 reminds me of the Sinclair ZX81, my first computer with a (membrane) keyboard that worked with a high level language (BASIC) as opposed to just assembly. Fitted a true symbolic assembler in 1k of RAM. Those were the times…

(1-25/26)