Calibrate Analogue Zones???

Smarty

Active Member
Here is what I want to do:

I would like to use an analogue zone (humidity sensor) to display the outside relative humidity. Is there anyway to "calibrate/scale" the voltage coming from the sensor so that thye Elk can display a value from 0-100%?

Displaying the sensor voltage is possible, I am just unsure as to how this voltage could be scaled to display a range from 0-100% Any ideas?
 
The analog to digital converter on the M1 has a range from 0 to 255 with a maximum input voltage of 14 volts to equal a 255 value. Therefore for each increment of the A to D converter, the voltage will increase .055 volts.

Scaling for a 0 to 100 percent will require a PC to do the conversion. The math functions are not within the M1.
 
How about this approach....

The humidity sensor (Honeywell HIH-4000) has a linear output range of about 0.8 - 3.8 Vdc, corresponding to 0-100% relative humidity. It's supply voltage is 5.0 Vdc.

I think I could use an Action Pak (we use lots of these at work) to "zero and span" the sensor output voltage to 0-10.0 Vdc. I would then feed the 0-10Vdc to the Elk on an analogue zone (can't scale to 0-100Vdc, as the Elk can only accept 0-12Vdc on an analogue input zone).

A zone value of 3.7 would correspond to 37% relative humidity.


The only additional complications with this is that I would have to power the Action Pak with 120VAC.
 
Maybe not so simple......

I thought I could display an analogue zone voltage (send it out as text) to the keypad......but the text rules don't seem to allow be to do this.

Am I at a dead end?
 
If you don't need a very high resolution then you could always create a bunch of rules, each one looking for a specific hardcoded analog value that then sends a hardcoded text string...
 
Smarty;

You are not at a dead end, but you may not like the alternatives.

First of all the Elk has a pull-up resistor on ALL of their zones (2000 ohm between the + side of the zone and 12 volt). This can cause problems with "voltage output sources" not use to driving a load such as this.

I plan to try to remove this pull-up resistor and perform some experiments with various analog type sensors (LM34 temp sensor for instance). Refer to THIS post. I may try this later today and will post the results in that thread. It's to bad Elk did not make this a "jumper setting" option (i.e. be able to remove the pull-up resistor from the circuit via a jumper). I'm planning on trying to remove the pull-up resistor from an expansion board and NOT the Elk M1 main board, mainly because the component is more accessible and I'm not out as much money if I destroy the board (will this void the warranty??) ;)

The other problem you have is once you are able to properly "read" the analog sensor with the Elk you have no way of extracting this reading in order to perform a calculation unless you are using something like HomeSeer.

Once you get the value into the PC you then have to perform a calculation in order to obtain the "real world" engineering units, which in your case is humidity.

I go over how to do this in THIS How-To. I also use a real world example by incorporating this methodology in a garage door monitor that can read the distance (in inches) the bottom of the garage door is from the garage floor (i.e. exact position the garage door is opened). I perform calculations so a HomeSeer device is reading the "percentage" the garage door is opened rather than a raw distance number (more realistic number to display). HERE are the details of this project. Ignore most of the responses as those people just don't understand the reasoning behind this project.

All of this was done to try to "educate" people on using "Analog to Digital" conversion techniques so they can accomplish projects such as yours. I feel like I failed miserably in this mission!

Anyway enough ranting. Here is how to calculate the equation you need in case you:

1) Get an analog to digital converter and are able to incorporate it into your Home Automation system.

2) Use a program such as HomeSeer (more details on this below).

For your sensor you state that at 0.8 volts you get 0% humidity and at 3.8 volts you get 100% humidity. Assuming this is a linear sensor you can use the slope intercept equation of:

Y = mX + b

Where Y = Humidity in %, and X = Voltage from the sensor in Volts.

So to calculate this equation lets use

X1 = 0.8, Y1 = 0

X2 = 3.8, Y2 = 100

So to calculate the slope (m) use:

m = (Y2 - Y1) / (X2 - X1)

m = (100 - 0) / (3.8 - 0.8) = 100 / 3 = 33.33

Substitute m and use X2 and Y2 pair values (3.8, 100) to calculate b

Y = mX + b

100 = (33.33)(3.8) + b

b = -26.67

So you now have an equation that when given a voltage, can calculate Humidity

Y = mX + b
Humidity = m(Volts) + b

Humidity = 33.33 (Volts) - 26.67

Let's check this calculation with the two data pairs. First let's use the value of X1 for voltage and see what the Humidity result is:

Humidity = 33.33 (.8) - 26.67
Humidity = -0.006, which is pretty close to 0 which is the Y1 value!

Now let's use the X2 value for voltage and see what the Humidity result is:

Humidity = 33.33 (3.8) - 26.67
Humidity = 99.984 which is pretty close to 100 which is the Y2 value!

So now we know the equation is correct. But, what resolution will you get if you use the 0-14 volt, eight-bit analog to digital capability of the Elk M1 analog zone?

Well Spanky mentioned above that the Elk can discern voltage increments in 0.055 volt steps (two to the eight power minus one for the "eight bit" resolution is 255 steps. Divide 14 volt full scale by 255 and you obtain 0.055 for the voltage resolution of the Elk).

So we already know that if we have 3.8 volts with your sensor you will have 100 percent humidity. So what humidity would you have with 3.8 - 0.055?

3.8 - 0.055 = 3.745

Let's calculate the Humidity for 3.745 volts using the equation above:

Humidity = 33.33 (3.745) - 26.67
Humidity = 98.15

So your resolution would be 100 - 98.15 = 1.85%

So what this means is if you first removed the pull-up resistor in the Elk for a zone and then set that zone as an analog input type, then had some type of program that could read the voltage value, then used the equation:

Humidity = 33.33 (Volts) - 26.67

and then used a program that could convert this voltage with that calculation, then were able to obtain that calculated value (via computer screen?) you would then have humidity for your system in 1.85% measurable increments.

May sound complicated, but it is not. If you don't feel like hacking the Elk M1 (which is understandable) there are inexpensive Analog to Digital converters out there. I believe some are mentioned in my Guide which I referenced above.

Another case would be to use HomeSeer. I'm presently working with someone to give HomeSeer the capability of reading a voltage value of an Elk Analog zone, perform a slope/intercept calculation such as the one above, then place that calculated result in a HomeSeer device. Can't go into any more details, but if this comes to fruition it will be an exciting capability for Elk/HomeSeer users. ;)
 
BraveSirRobbin,
I have been following your efforts to remove the surface mount resistor on the expansion board. I wish you good luck to expand the Elk's capabilities!

In addition, I read your garage door height sensor post when I first subscribed to Cocoontech (thought it was neat then as I still do). The slope plus offset equation is familier to me (I'm an M.E., but like to fool with sensors etc. as long as it's dc, and single phase.....power factors and imaginary numbers are not my bag).

Unless a better idea arises, I will probably just read the unscaled linear analogue sensor voltage and write rules for every 5% relative humdity (the sensor is only accurate withing 3.5% relative humidity anyway).

Thanks for the informative post.

Steve
 
Back
Top