Blogue de Guillaume DALLAIRE's Blog

January 23, 2009

Monitoring electricity usage : Part 2

Filed under: Home Automation, electronic — Tags: — gdallaire @ 8:54 am

Recently I found other ways (see my previous post) to monitor my house’s electricity usage:

They use current transformer clamps instead of reading the power meter’s output. I prefer this design mainly because you get instant reading (ok the power meter gives a relatively fast reading but I want < second reading) and it allows you to compare with the power meter reading (my power meter is probably > 30 years old, still accurate??).

Then I found this project:

http://www.picobay.com/projects/2009/01/real-time-web-based-power-charting.html

This is mostly what I’m planning to build. I was looking for a cheap and well documented current transformer clamp model. So I ordered 2 of these clamps.

More to follow…

October 25, 2008

Humidity Sensor controlled Bathroom Fan

Filed under: electronic — Tags: , — gdallaire @ 10:07 pm

A bathroom fan should always be switched ON when a predetermined level of humidity is reached, always.

Some months ago, I built a controller to fulfill this requirement using a microcontroller, a humidity sensor and a solid state relay. In these lines, I will expose my selection process for the sensor.

HS1101 Humidity Sensor

HS1101 Humidity Sensor

There are a lot available, but rarely above 10$. I decided to try a capacitive humidity sensor: HS1101 from Humirel. This is the cheapest I found (from Digikey), but it requires a special circuit to convert the capacitive output to something a MCU can read.

I followed the recommendations found in the HS1101’s datasheet, a frequency output circuit:

Frequency output circuit for HS1101

It’s a simple 555 timer that transform the sensor’s output to a frequency that any normal MCU can use. I connected this frequency output to the MCU’s external timer input and programmed the reversed polynomial function.

The result was good but not perfect since I used normal precision discrete components around the 555. The biggest problem was a really not linear response over different temperatures. So my fan wouldn’t turning ON during summer with the winter’s calibration… Bad..

HIH-4030-003S2 Humidity Sensor

HIH-4030-003S2 Humidity Sensor

At this point, I had two choices: To order the right discrete components or to try another kind of sensor. I decided to try a sensor that outputs a linear voltage vs %RH. I choose the HIH-4030-003S :

Connected directly to an MCU’s analog input, the RH value is calculated using the factory data provided with each sensor:

Vout=Vsupply(0.176 to 0.759)

RH=(Vout-0.819)/31.488

If we have Vsupply = 5 and the analog value readout (val) from 0 to 1023, then Vout = (val*5)/1024. RH is then calculated with (Arduino Code here) :

val = analogRead(rhPin);
rh = (((val * 5) / 1024) - 0.84 ) / 31.488;

With this sensor, the system is stable at different temperatures.

I plan to use this kind of sensor for my home meteorological station. For now, my conclusion is simple: Use smarter sensor and save time !

Powered by WordPress