Close

Portable test device

A project log for SHT21 Humidity sensor board

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

TheotherMikeTheotherMike 09/18/2016 at 11:140 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:

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 DHT11
  u8g.drawStr(73, 47, "m ");

}

Conclusion & further to-do:

Discussions