IT LIVES...Ultimate Garage Door Monitor Two!
I have a much smaller automation system now, mostly Z-Wave lights and Z-Wave Door/Window switches, but I also have an Arduino Mega R3 with an Ethernet 2 Shield installed in a structured cabinet in my garage and use HomeSeer's plugin written by enigmatheatre to get digital inputs and outputs as well as analog inputs into HomeSeer devices. This is a really nicely written plugin and it will support multiple Arduinos as well.
Here is a screen shot of my reduced setup below.
I used the same brackets for my potentiometer and used a 4K ohm ten turn rotary pot with a rubber stopper as before. I placed the rubber stopper in the end of the upper pipe on the garage door and made a bracket as shown below:
The pot is ten turn and I get a total of 7.5 turns when the garage door goes from full close to full open, so I just made sure those turns are somewhere in the middle of the ten turn capability so the pot will not bottom out against its stops.
I hooked this up to an analog input and used the on-board five volt output as the excitation voltage, then set the plugin to read raw 'bits' from the analog to digital input. I then calibrated the system by measuring distance from the ground vs these bits as shown in the Excel plot below.
Excel will calculate the slope intercept formula from the line automatically as shown in that graph.
So now I have an equation that will convert the bits to inches. I entered this equation into the plugin (really easy as the plugin provides an entry for this), then spot checked the system by stopping the garage door at various intervals and measured the height from the floor vs the inch reading from HomeSeer. The value was within an inch no matter where I stopped!
I wanted a 'percentage of open' instead of the raw inch value. Since my total opening was 83 inches, I just divided the entire equation by 83, then multiplied by 100 to get this percent open value. The exact entry into the plugin's analog input for the equation is now (Value * 0.1226 - 14.404) / 83 * 100, where the "Value" is the bit value from the analog to digital input.
I already had some icons for 0, 25, 50, 75, and 100% values and used those to represent the various ranges of percent values (again, easy to setup with HomeSeer).
I also use HomeSeer mobile and below are some examples of screen shots from my phone showing a couple of values from this system.