Close
0%
0%

SHT21 Humidity sensor board

Using a Sensirion SHT21 sensor for environmental measurements. Equipped with filter cap, I2C connection.

Similar projects worth following
Using a Sensirion SHT21 ensor for environmental measurements of relative air humidity. Equipped with filter cap, I2C connection.

Will be used with kind of "....uino"-type controller.

Nice things:

The nice thing about a humidity sensor is, that only two Parameters are given out:

  • Temperature (In fact a voltage measurement of a Silicon bandgap...)..
  • Relative Humidity (In fact it´s a capacity which is measured physically...).

But several more can be calculated out of them:

  • Dew Point.
  • Spread.
  • Cloud base height.
  • Absolute humidity within surrounding air.
  • ( Heat index /comfort zones which are very subjective !).

SHT21:

The SHT21 has some Advantages (despite ist higher Price and complexity) over the well known DHT11/22/AM2302 sensors: faster, smaller and can be equipped with a filter cap. OK, smaller is not that correct regarding the needed housing etc., but opening holes in a portable case can be made much smaller than the size of a DHT housing.

PCB should be easily mountable and filter cap should protect the sensor from particles etc. when using the device outdoor.

Sensirion, the sensors manufacturer has two nice Whitepapers about humidity which explain many things quite nice.

Humidity Sensors at a Glance

Introduction to Humidity

I will give a Brief summary of the context I´m interested in:


Relative Humidity:

Hot air can contain much more water than cold air. Relative Humidity will therefore only give a degree of Saturation at a given temperature.

Depending on surrounding temperature, and therefore state of water, one has to differentiate two cases:

  1. Above (liquid) water
  2. Above Ice.

The Saturation vapor pressure can be described by the Magnus formula:

Parameters above are liable above liquid water, which in turn means that below 0°C liquid water must be supercooled (no condensation seeds...).

Above ice, parameters change to:



Dew Point:

Dew point is the temperature to which the air must be cooled down to achieve condensation of contained moisture. With constants above, the dew Point can be calculated as follows:


Spread:

Spread is simply the difference between measured temperature and dew Point:



Adiabatic temperature Gradient:

In atmosphere, an upwards moving volume of air cools down. Temperature gradient can also be calculated and measured as well. There are two conditions which can be distinguished:

  1. Dry adiabatic (no condensation, dry air,...): 9.76 K/km
  2. Wet adiabatic (condensation occurs and "heats" the air ): 6.50 K/km

Unfortunately, the wet adiabatic temperature Gradient depends on temperature and can range between 4 - 9 K/km. A value of -6.50 K/km is an "european average".

Nevertheless, in reality values between 6.5 - 13.5 K/km can be found !



Cloud base Height / Ceiling:

A volume of air can be cooled down until its temperature reaches the dew Point at which condensation occurs. The lower cloud base height can now be estimated by dividing the Spread with the adiabatic temperature Gradient. In meteorology a typical value of 8 K/km is used ("Henning equation"):

So, when "measuring" a Spread of 13K, ceiling height should be around 1625 m above you.


Disclaimer:

You shalt not fly your wingsuit only on the Basis of a cloud base height calculation performed with a ~5USD sensor!!

All formulas above are correct in Terms of science, but their results are estimations. Weather is totally complex and so several things are neglected (pressure dependencies, convection, Inversion, temperature gradients,...). Nevertheless, those Basic Parameters are worth to study although we look at them on a very Basic Level. After all, with proper Firmware and reliable measurements a humidity sensor is a great tool for indoor/outdoor activities.

This is my first try to set up a pcb, soldering with smd parts, using a stencil, making µC read data.

Goal is to display at least rel. Humidity and eventually calculate some further parameters within a portable case (might be a further HAD-Project....).

SHT21_03.brd

Additional design with smaller footprint.

brd - 31.17 kB - 08/20/2016 at 22:02

Download

brd - 31.43 kB - 05/15/2016 at 11:24

Download

sch - 33.27 kB - 05/15/2016 at 11:24

See BOM
Download

  • 1 × SHT21 Humidity sensor, Semiconductors and Integrated Circuits / Misc. Semiconductors and Integrated Circuits
  • 1 × PCB Electronic Components / Misc. Electronic Components
  • 1 × SF2 filter cap for SHT21
  • 2 × 10k, 0603 resistor
  • 1 × 100nF, 0603 capacitor

View all 9 components

  • Portable test device

    TheotherMike09/18/2016 at 11:14 0 comments

    In order to test some more things out, a small, LiPo operated sensing box was finished today. The last days it was lacking the LiPo which was delivered yesterday.

    Nothing special and not very well built, but it´s intended to:

    • Carry it around and check environmental parameters.
    • Compare values with actual cloud base height.
    • Testing wireless charging.
    • Try out some programming issues with push buttons, display, menu,....

    The box is a simple polymer case (Kemo G01B), contanining an Arduino Nano, 1s-450mAh LiPo, Qi-Charging receiver coil for S3, TP4056 charger, Nokia 5110 display, DC-DC-Boost converter and an AM2302 humidity sensor. Of course, some small parts like a sliding switch, screws, a 330 Ohm resistor for the display and a 3d-printed holder for the AM2302.

    Actually, while using it powered by USB cable, the slow AM2302 was the reason for the SHT21 iterations...

    Portable AM2302It works quite OK using u8glib and currently there´s nothing more implemented than reading out the humidity, temperature and displaying the calculated dew point, heat index and ceiling height. It´s really nothing special but already makes fun carrying it around checking local conditions. At the moment, it only can be switched on and it immediately starts displaying the values. --> "KISS".

    Wireless charging seems to work. I had to change the charging current of the TP4056 by soldering in a 2.2 kOhm resistor (0603 size) instead of its default resistor. Now it charges the LiPo with approx. 400-500 mA.

    Here are some more images from the inside.

    And here´s the code I´m using at the moment. No temperature case distinctions yet.

    #include "U8glib.h"
    #include "DHT.h"
    #include "math.h"
    #define DHTPIN 3
    #define DHTTYPE DHT22 
    #define backlight_pin 11
    
    DHT dht(DHTPIN, DHTTYPE);
    
    U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6);  // CLK=8, DIN=4, CE=7, DC=5, RST=6
    
    //###############################################################################################################################
    void setup(void) {
      analogWrite(backlight_pin, 10);  /* Set the Backlight intensity */
        dht.begin();
        u8g.setRot180();
    }
    //###############################################################################################################################
    void loop(void) {
      u8g.firstPage();  
      do {
        draw();
      } while( u8g.nextPage() );
      delay(300);  // Delay before accessing AM2302
    }
    //################################################################################################################################
    void draw(void) {
      u8g.setFont(u8g_font_profont11);  // select font
      u8g.drawStr(0, 7, "Temp: ");  // put string of display at position X, Y
      u8g.drawStr(0, 17, "rH: ");
      u8g.drawStr(0, 27, "HI: ");
      u8g.drawStr(0, 37, "Dew: ");
      
      u8g.setPrintPos(45, 7);  // set position
      u8g.print(dht.readTemperature(), 1);  // display temperature from DHT22
      u8g.drawStr(73, 7, "C ");
      u8g.setPrintPos(45, 17);
      u8g.print(dht.readHumidity(), 1);  // display humidity from DHT22
      u8g.drawStr(73, 17, "% ");
    
      u8g.setPrintPos(45, 27);
      u8g.print(dht.computeHeatIndex(dht.readTemperature(), dht.readHumidity(), false), 1);  // display humidity from DHT11
      u8g.drawStr(73, 27, "C ");
    
    //  243.12*((log10(dht.readHumidity())-2.0)/0.4343+(17.62*dht.readTemperature())/(243.12+dht.readTemperature()))/(17.62-((log10(dht.readHumidity())-2.0)/0.4343+(17.62*dht.readTemperature())/(243.12+dht.readTemperature())))
     u8g.setPrintPos(45, 37);
      u8g.print(243.12*((log10(dht.readHumidity())-2.0)/0.4343+(17.62*dht.readTemperature())/(243.12+dht.readTemperature()))/(17.62-((log10(dht.readHumidity())-2.0)/0.4343+(17.62*dht.readTemperature())/(243.12+dht.readTemperature()))), 1);  // display humidity from DHT11
      u8g.drawStr(73, 37, "C ");
    
       u8g.setPrintPos(35, 47);
      u8g.print(125*(dht.readTemperature()-(243.12*((log10(dht.readHumidity())-2.0)/0.4343+(17.62*dht.readTemperature())/(243.12+dht.readTemperature()))/(17.62-((log10(dht.readHumidity())-2.0)/0.4343+(17.62*dht.readTemperature())/(243.12+dht.readTemperature()))))), 0);  // display humidity from...
    Read more »

  • 2. Iteration

    TheotherMike09/07/2016 at 13:25 0 comments

    Since the first board was nice and clean but large, I made a second Iteration.

    It also can be equipped with the filter cap but mounting holes were skipped. Idea is to clamp or glue the board into it´s dedicated place, which makes everything smaller and easier. The Overall layout will be the same, so the stencil can be used again with it.

    Boards should arrive within the next days.

    Next steps:

    - Assemble sensor board.

    - Recherche wiring of Display (first of all it will be a Nokia 5110 ).

    - Recherche calculation of absolute humidity and dew Point.

  • First try...

    TheotherMike05/15/2016 at 11:59 0 comments

    All parts arrived and today I tried my first smt soldering at all.

    Here, just some photographs during the process....

    At first I aligned the board in between the holders made by OSH:

    Well, easy and I was glad to have had a small wooden board to which I fixed everything on.

    With help of some scotch tape I placed the stencil over it:

    And afterwards solder paste was applied. Sorry, no foto, but here´s the PCB with solder on it:

    It seems, that there is a little less solder on the SHT21 landing pads....Nevertheless, I tried to move on and placed the few parts onto the pcb.

    Well, for me, 0603-size was damn small !! I will need to buy much better tweezers, magnifying glass and perhaps a better solder paste.

    I used this one and still don`t know if it was a good choice:

    http://www.ebay.de/itm/SMD-BGA-Loeten-Loetpaste-mit-Silber-Sn95-75-Ag3-5-ECO-Solder-Paste-80g-/182146971621?

    Ok, so here´s my "soldering setup":

    It´s just a hotplate set to 250°C, some pliers and a small piece of aluminum to pick&place the pcb on it onto the hotplate or a small block of aluminum to cool it fastly.

    I used a stopwatch and after about 1.5 minutes on the hotplate, the solder of the resistors melted, some seconds later the SHT21 was mooving slightly. Yeaahh, looks good. 2 minutes and 11 seconds later, the pcb was cooled down again.

    Hopefully the sensor is OK with that, because when looking at the datasheet, we can find that soldering duration should be less than 30s at max. temperature:

    So, just hook it up now...

    Teensy 3.0 and Arduino 1.6.8 was used as well as the corresponding library ( https://github.com/elechouse/SHT21_Arduino ):

    Et voila, it works !!! The sensor is incredible!!

    Of course, I do not know how trustworthy the values are, but response time and small changes of rel. H. induced by breathing or hovering the finger over it is measureble !!


    Conclusion:

    1. Great, it works !! :-))
    2. Four mounting holes look nice, but seem to be too many for this small pcb. Within next iteration might use two only.
    3. A little bit more solder paste on the sensor landing pads might be beneficial.
    4. I will do some more projects using the stencil & hotplate process. Hopefully I will get used to it further.

  • PCB and stencil arrived

    TheotherMike05/15/2016 at 11:34 0 comments

    PCB and stencil arrived. Solder past already available.

    Next step will be ordering of components.

View all 4 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates