Controlling Bathroom Exhaust Fans With Honeywell Humidity Sensors

Whilst having automatic lights in my bathrooms is great, having to manually turn on the fan is less than ideal. This article describes how I am interfacing a humidity sensor with a Homevision Pro automation controller to automatically turn on the exhaust fans when humidity reaches a per-defined level. It does not cover all of the programming and smarts around the installation and this this article will provide guidance for any automation system. This is probably one of the easiest tasks I have performed at our house.

Bill of Materials
– 1 x Honeywell HIH-4030 humidity sensor ($19 AUD)
– 1 x Length of heat shrink ($3 AUD)
– 1 x 20m (enough cable to run between automation controller and sensor) of cable. ($10 AUD)
– 1 x automation module to control exhaust fan ($27 AUD)

Total Cost = $59 AUD

Tools used
– Soldering Iron
– Pliers
– Screw Driver
– Multimeter

Step 1: Figure Out How The Sensor Works
Probably the most obvious step here for any automation task. Before we can start controlling the exhaust fan we need to figure out how this sensor works. This sensor was the first analogue sensor I had dealt with and to be honest they are very simple. The HIH-4030 measures relative humidity (%RH) and delivers it as an analog output voltage in near linear form. More details can be found here and if you don’t have time to read this this document it can be summarised with the following image.

This sensor has three pins.

5V – 5V DC
GND – Ground for 5V DC
OUT – A return voltage (DC) which will be relative to the humidity it is reading.

To test how the sensor operates you will need your multimeter and a DC power supply. Supply power to the sensor by connecting 5V and GND to the sensor. Now setting your multimeter to DC volts measure between GND and OUT. The reading you receive will now be relative to the humidity. As humidity changes so will be the voltage detected.

Step 2: Make The Connections
Now since I have tested this it is time to connect to the Homevision Pro. When I built this house I ran an overkill of Ethernet throughout the house. Rather than running a new cable I decided to use CAT 6 as my transport medium. As Cat 6 has 8 cores I have used 2 cores for GND, 3 cores for 5V and 3 cores for OUT. The Honeywell HIH-4030 will require you to solder your cable to the sensor.


Step 3: Program And Test
With everything physically connected it is now time to program, tune and test. The sensor has an operating range which required me to set a gain and offset value.

From the datasheet’s graph(above), it shows that at 0% RH you get a voltage of around 0.8V, at 100% RH you get 3.8V, and there is a near linear relationship between relative humidity and voltage. The Homevision Pro can apply a gain and offset value to the analog values it measures which works well for a linear relationship. According to my calculations, using a gain of 0.65 and offset to -26, the analog port value you obtain via the “VAR = Value of analog input” command will be a pretty good approximation of the relative humidity.

This equation could be expressed via the following

255 * 0.8 / 5 * 0.65 – 26 = 0.52

Testing is accomplished by turning on the hot water in the shower and waiting. I have the exhaust fans controlled by an X10 appliance module. I again use a multimeter to tune. For my needs I turn on the fan when the relative humidity reaches 70% and off again when the relative humidity stays below 70% for more than 5 minutes.

Shane Baldacchino

Interfacing Zoned Gas Heating with an Automation System (Homevision Pro)

WARNING : Electricity can be lethal, this work should only be attempted by a licensed electrician

On my list of things to automate around my house is HVAC . This article is describes how I hooked a multi-zone heating system up to my Homevision Pro automation controller. It does not cover all of the programming and smarts around the installation. In reality this article will provide guidance for any automation system.

This modification will remove the thermostats off your walls. If you are uncomfortable in having your phone, tablet, computer or automation system controlling your heating then probably best you don’t continue. This setup has now been in place for 2 years without incident.

Bill of Materials
– 2 x 300ohm resistors ($1 AUD)
– 2 x SSR (Solid State Relays) 3.0 –> 32v DC switching AC 0 –> 500v AC ($20 AUD)
– 1 x Length of heat shrink ($3)
– 1 x 20m (enough cable to run between automation controller and heater furnace) of 6 core cable. ($10 AUD)

Total Cost = $34 AUD

Tools used
– Soldering Iron
– Pliers
– Screw Driver
– Drill and drill bits

Step 1: Figure out how the heater works?
Probably the most obvious step here for any automation task. Before we can emulate a wall thermostat we need to know what the wall thermostat is doing which tells the heater to turn on. Time to whip out the trusty multimeter. To figure out what the thermostat is doing I took the thermostat off the wall and  begun probing for voltage and continuity. My system uses 3 wires (systems using heat pumps will use more)

G – Fan
R – 24V active
W – Heating

I observed when I manually moved the thermostat to a temperature above ambient I hear a click. This is almost a giveaway as this click is most likely a relay moving between NO or NC. So with the multimeter set to ‘continuity’ I started to probe.

What I found was when there was no request to provide heat, all connections were open between each pin. But when there is a request for heat that is higher than ambient their is continuity between G (Fan) and W (Heating).

The R is 24V and provides 24V to power the thermostat (unsure why it was wired in as this model runs off batteries). I don’t need it (as my automation controller is my thermostat) and thus am simply interested in just G and W. So what we need to do is bridge G and W together. To prove my theory I simply bridged G and W together and observed the output. The end result was we within a few minutes we had head coming out of the heating ducts. Success


Step 2: How to interface the HVPRO to the heater
In order to interface the HomeVision Pro and the heating zone controller together I have elected to place a SSR in between to act as a buffer. It’s not needed as the Homevision Pro can drive the zone controller but I am doing this to prevent damage to HomeVision Pro should something go wrong. My house has multiple heating zones. So rather than running multiple cables for each zone I have ran a 6 core cable from the Homevision Pro to the heaters zone controller. I only require 3 cores (one for each relay and a shared common) but given how much hassle it can be to run cable I always recommend a few spare.

Step 3: Reducing the voltage
The SSR relays have a switching voltage of 3-32V DC. So I don’t have to introduce yet another PSU I wanted to use the 5VDC rail on the Homevision Pro. But if I use the 5V DC rail it will always be on and the house would get mighty hot :S. By using a 330ohm pull up resistor when the output port is high I get 3.2 volts (enough to switch the relay) and .7 of a volt when the port is low. Below is schematic of how this all plumbs together.





Step 4: Demo
Here is a quick demo of the above working. There is no polish and it simply shows the heater being controller via the controller by means of setting variables to control the output ports which drive the SSR’s which in turn tells the zone controller what zones need heat, the zone controller then directly interfaces with the heater. The achieve the results in the applications below has required me to build on this base.

Step 5: Applications
Some time has passed since I wrote the above. At first it was a bit of a gimmick but now is relied upon but not just me but my wife. The heater now has the following attributes

– there is no thermostats on the wall, was bit a scary at first but I have ironed out all the bugs
– controlled via Android/IOS devices via NetIO (jSON based pipeline to Homevision Pro), exposed externally to our house. Heating can be monitored and controlled remotely
– controlled via html post and get’s (utilised by Windows Phone 8.1)
– is set to automatically turn heat on when the family arrives home (front or garage door) if the system was previously off
– will automatically turn off (if on) if the front door or door to the garage is open for > 3 minutes
– will automatically turn off when ever the house is armed
– will automatically turn off if no motion is detected down stairs for more than 45 minutes
– will automatically turn on downstairs between the hours of 5am – 9am when the current temperature downstairs is less than the previous set temperature and there has been 3 hits on any of the 17 motion sensors downstairs in the house within a 3 minute period.


For the actions that happen automatically I have my Homevision Pro executing a script I wrote which calls an SMS API to send our phones a SMS. Whilst I like things happening like magic, I do want to know about them.

Shane Baldacchino

Installation of Inner Range Integriti Alarm Systems with Multi Door Access Control

WARNING : Electricity can be lethal, this work should only be attempted by a licensed electrician

The last major item on my automation to-do list was access control. Many basic alarm systems do this but I needed more. As I plan leverage this system as my eyes finding the right solution was paramount to the success of future projects.

I ended up settling on InnerRange’s Integriti system. An overkill by all means but powerful enough to ensure I won’t be limited by the system. It speaks serial, has an API, can control 1,000 card readers, switch 240 doors and have 100,000 users.

Enough for our house.

Bill of Materials
– 1 x InnerRange ISC (Integriti Security Controller)
– 1 x InnerRange Prisma Terminal
– 1 x InnerRange Elite Terminal
– 1 x InnerRange Rack Mount Chassis
– 1 x InnerRange Intregriti 2 AMP PowerSupply
– 1 x InnerRange Integriti 2 Door Controller
– 13 x Paradox DG55 PIR(Passive InfraRed Sensor)’s
– 2 x FSH FES20 Electric Strikes
– 2 x HID R10 Mullion Card Readers
– 1 x Flush Mount Internal Siren
– 1 x External Strobe / Siren
– 1 x RS232 Adapter Cable from ISC to Automation Controller
– 1 x Licensing SIM
– 1 x Cable Recess Hinge
– 250m of Figure 8 cable (Power)
– 3000m of 4 Core Alarm Cable (PIR’s)
– 250m of 4 Core Shielded Cable (Local LAN RS 485 Communication)
– 800m of 8 Core Shielded Cable (HID Car Readers)
– 1 x Length of heat shrink ($3)
– 1 x 20m (enough cable to run between automation controller and heater furnace) of 6 core cable. ($10 AUD)

Total Cost =

Step 1: Plan
A project like this is not something you string together last minute. My house is double story and like all other projects I complete I am after the stealth look. Without adequate planning their will be unnecessary cuts in plaster or bits of conduits hiding cables. Not a neat look. Whilst I have become pretty good at running cables, running cables to the middle of the bottom story is practically impossible without plaster damage. Given I had some idea of what we wanted to achieve before we built it was time to consult the experts.

My requirements were pretty modest but actually finding a product and installer who knew what they were talking about was less than easy. After countless weeks research I ended up with an InnerRange Integriti system and worked with their gold partner (. As it came to be they were a pretty good company to work with that said whilst they were a gold partner they knew very little about interfacing the system via serial and nothing on the API side of the product. That left me in bit of a hold but they kindly put me in touch with Inner Ranges support team which have been excellent to deal with.

Step 2: Cable, Cable and Cable
This process started 4 1/2 years ago when we built. During the build process we ran approximately 7km of cable during the framing stage. Based off a rough plan from InnerRange cable was ran for
– All PIR’s (One per room approx)
– All panels (upstairs, downstairs, garage)
– Emergency/Duress buttons (in master bedroom)
– Sirens (Both Internal and External)
– Electric Stikesb

Interfacing a NAD T163 with a Homevision Pro

This article describes how I interfaced a NAD T163 pre-amplifier with my Homevision Pro automation controller. It does not cover all of the programming and smarts around the installation. In reality this article will provide guidance for any automation system.

Bill of Materials
– 2 x RS232 DB9 adapters ($8 AUD)
– 1 x Interfacing cable between units (I used Cat 6e)

Total Cost = $8 AUD + cable

Tools used
– Pliers
– Screw Driver
– Krone Tool

Step 1: Figure out how NAD serial communication works?
Probably the most obvious step here for any automation task. Before we can have the HomeVision Pro communicate with the pre-amp I need to how to communicate to it. Usually the best way to do this is with a PC and a serial emulator. My tool of choice is putty. I usually try a 8-N-1 connection. This is a common shorthand notation for a serial port parameter setting or configuration in asynchronous mode, in which there are eight (8) data bits, no (N) parity bit, and one (1) stop bit.

How ever after looking at websitethey actually have a RS232 test tool. Why re-invent the wheel? My device is pretty old. Whilst all of NAD’s devices today use ASCII commands mine used binary encoded decimal communication in Q8.8 format.
Q format is often used in hardware that does not have a floating-point unit and in applications that require constant resolution.
This device uses Q8.8 format, using an 8+8+1 bit signed integer container with 8 fractional bits, its range is [-128, 128]


What the NAD tool tells me exactly what commands I need to send to perform a given function and on the reverse how to interpret the results being sent back by the pre-amplifier. In the example in the images, if I want to tell the pre-amp to turn on I issue ‘1, 21, 21, 94, 65, 2, 212’ and like magic it powers on.

According to the NAD website the data format for all commands sent to the T163 and responses sent back have the following basic format:
| Start | Command | Data | Checksum | 8-bit Checksum |

Start | 1 byte control character which starts every packet of data.
Command | 1 byte command which represents the operation to be performed or the type of response being returned
Data | Variable length data. The length of this field depends on the command. If the data represents a multibyte number, it should be sent least significant byte first.
Checksum | 1 byte control character which denotes the end of the data stream and the beginning of the checksum.
8-bit Checksum | This checksum is the inverse sum of the Command and Data bytes of the packet. It is used to verify the validity of the data packet.

Any data received which does not follow this format will be ignored.

Step 2: Connect the devices
The connection to the NAD T163 is DB9 male. To connect I need to interface with it using a DB9 female connector with the following pin outs
Pin 2 – Transmit
Pin 3 – Receive
Pin 5 – Ground

On the Homevision Pro (or controlling system) the pin outs need to cross the transmit and receive
Pin 2 – Receive
Pin 3 – Transmit
Pin 5 – Ground

Step 3: Homevision Pro Code
Code now needs to be written on the home

Shane Baldacchino

Creating My Super DoorBell

WARNING : Electricity can be lethal, this work should only be attempted by a licensed electrician

When building my house it never dawned on me that one day my humble doorbell would be anything more than that. The more I started tinkering with my house I realised that given my central cabling design that I would be able to leverage my door bell as another input to take action on. What I started with is nothing more than a standard 8V AC door bell, what I have now is far from it.

At the moment the press of my door bell in certain cases will
– Make the door bell ring (wow)
– Logs the event to a table in a MS SQL database
– Turn on lights in the portico (if it is night)
– Turn on lights leading to the door bell internally (if it is night)
– In the next 6-9 months (money/time pending) it will take your picture/video and attach it to an email.

Bill of Materials
– 1 x 2 AMP 240V AC –> 8V AC transformer ($35 AUD)
– 1 x AC powered door bell ($16 AUD)
– 1 x ELK930 door bell detector ($40 AUD for 3 units)
– 1 x Large electircal junction box ($30 AUD)
– 1 x 2m of 4 core cable (enough to go from the ELK930 to your automation system) ($2 AUD)
– 1 x 40m (enough for your door bell runs) of 2 core cable. ($10 AUD)
– 1 x HPM PE Cell ($60 AUD)
– 2 x Clispal 30PBL 240V push button switches ($26 AUD)
– 2 x X10 two way appliance modules ($75 AUD)
– 1 x 2m of multi core 240V AC cable ($2)

Total Cost = $296

Tools used
– Soldering Iron
– Pliars
– Screw Driver
– Device to drive X10 modules and read open collector inputs. I am using CSI’s excellent HomeVision Pro
– Drill and drill bits (masonry may be required for brick)
– Drill
– Pencil / Pen
– Various electrical connectors

Step 1: Run cables for the doorbell
Run adequate cable. All of my cables were run to a central location. This was key in enabling the door bell to be hooked in to my automation system. One cable needs to be ran from the door bell to the garage and another cable needs to be ran from the garage to the momentary switch. I used figure 8 cable as this will be suitable for the current of the door bell.


Step 2: Wire in the doorbell in to the ELK930
Wire in your door bell according to your manufacturers instructions. My wiring is as per below.

Wire in the momentary switches and the ELK930. The ELK930 is a module that pretty much sucks the voltage out of the line and provides an open collector to any alarm / automation system. Put simply it stops voltage being fed in to my Homevision Pro’s mainboard and allows the Homevision Pro to detect the door bell being rung with no voltage being fed in to the unit. This module has been great and very cost effective. It probably could have been replaced with a relay (single port double throw) but would be more expensive.
The door bell is wired in to the ELK930 and the ELK930 is wired in to one of the Homevisions Pro’s input ports.




At this stage the door bell will ring and the input will be pickd up by the Homevision

Step 3: Add in some smarts

Yes the HomeVision Pro knows about my door bell being pressed but it is not doing anything about it (other than flashing an LED). First lets just get it to log the event to a database

Now when the door bell gets pressed the Homevision Pro will call a VB script I wrote which logs the event to a SQL database and gives a timestamp.
So we know when the door bell rings but that’s about it. Le’ts make it even smarter

Step 4: Day or night?

Given we know when the door bell is rung we can now use this event to drive other events in the house. How about for starters turning lights on when the door bell is pressed and it is sufficiently dark outside. That sounds good but we don’t know if it is day or night at the moment. By adding in a photo electric cell we are able to deem day from night. I am using a HPM PE 170 to carry out this task. To simplify the tech talk it is a light sensitive switch. This unit will be used for many other decisions in and around the house. The problem with this HPM unit is that it switches 240V AC. If I fed 240V AC in to my Homevision Pro’s input port it probably wouldn’t end pretty (I would be crying), I need to somehow get rid of all the voltage and turn this in to an open collector input. A relay is what we need here. The 240V AC output from the PE cell will drive the relays coil and power the electromagnet which moves the contacts from NO (Normally Open) to NC (Normally Closed). I am using an Omron L2YN DPDT (Dual Pole Dual Throw) relay, it is an overkill but that is all my friendly electrical wholesaler had in stock on the day of my visit.

Implementing the HPM PE 170 is pretty simple. Find a suitable spot to mount, turn the power off to your power circuit. Run power to the HPM PE170, run the switched power to the coil side of the relay and run the NO/Common to a Homevision Pro’s input port.



There is not much logic to add to the Omron LY2N. The port on the Homevision Pro will either be high or low which represents day and night. I log the time of day and night to a SQL database (may push the data through at some stage to SQL Server Reporting Services to plot the data but it is not required).

Step 5: Add a splash of X10

The aim to integrate in lights requires a means to automatically to power them on and off. I am using X10 as the transport protocol. The Homevision Pro has a built in TW 523 interface that allows duplex X10 transmission. I am interfacing the TW523 with an XTB-IIR from JV Digital Engineering which in turn provides communication to all the X10 appliance modules in the house.

The light switches need to be replaced from the traditional rocker based switches which won’t cope with the automation turning on lights to either momentary or pushbutton switches. I have elected to use Clipsal button 30PBL switches. These switches have a nice blue LED in them. This provides us with a visual inidication to show if a light is on or off.

The challenge for wiring was space, 3 rocker switches were replaced with 3 Clipsal 30PBL’s which are much deeper plus we need to wire in two X10 appliance modules. The original electrician is looping the active in this instance at the switch. I did not change this.

What we began with

Power off working away

Complete, but what a mess, cables to be made safe

All back together with lighs on, tidy and safe

I have set addresses on the modules, and added basic logic to the Homevision Pro.

Now for a demo, for the purpose of this demo I have changed the timer to 1 minute.

Shane Baldacchino

Cooling Home Audio with a PLC using X10 and Dallas DS18S20

WARNING : Electricity can be lethal, this work should only be attempted by a licensed electrician

We recently purchased a new TV unit. High on my priorities was ventilation. I own two NAD C272 stereo power amplifiers (one to power inside the house and another to power my shed and garage). I really like these devices, they are serious no nonsense premium power amps and have the same effect on your ears as moving from crop sensor based D-SLR to a full frame. The bad news is earlier revisions of this power amplifier lacked thermal cut out, I found out the hard way. Boom, look at that cap.

Even though this new entertainment unit is quite open, the NAD is 190mm high and only fits in by 17mm, this surely wasn’t going to cut it and with NAD posting a warning on their website I didn’t want to test my warranty, again.
A solution needed to be found.

My solution was to leverage my PLC to drive fans which I have mounted in the back of my cabinet.

Breakdown of parts (for one Power Amplifer)
– 2 : 119mmx119mmx39mm 240V fans (2 per power amp)
– 1 : X10 Lighting module with dimming functionality, I used an LW12
– 1 : Electrical junction box
– 1 : Patch cable
– 1 : Dallas DS18S20
– 1 : Wall plate for RJ45
– 1 : Electrical cord terminated to your countries wall sockets
– 1 : A length of heat shrink
– 1 : Various screws

Tools used
– Soldering Iron
– Pliers
– Screw Driver
– Device to drive X10 modules and read Dallas thermometer, I am using a HVPRO
– Hole-saw to match your fan diameter
– Drill to drive hole-saw
– Compass & Pencil

Step 1: Wire in LW12 to cord
The LW12 will be driving the fans. As high voltage is being used, for safety purposes this is enclosed in an electrical junction box. The electrical donor cord was cut in two. The first segment is used to go from the wall socket to the LW12, the second segment is used from the LW12 to the fans. The connections are as follows.

Cord Segment 1 : Brown (active) –> Red (active input)
Cord Segment 1 : Blue (neutral) –> Black (shared neutral)
Cord Segment 2 : Brown (active) –> Brown (active output)
Cord Segment 2 : Blue (neutral) –> Black (shared neutral)



Step 2: Create the thermometer
In order to deem when we need the fans to turn on and their appropriate speed (more thinking sound) we must first know what the temperature is. I am using a Dallas DS18S20 thermometer to achieve this.
A few things need to occur here, as these thermometers all connect to the same bus we must know the address of the device. Unfortunately this is not provided and the only way to read this 64-bit address with my PLC (Homevision Pro) is to disconnect all other sensors from the bus and just have this unit connected. So that is what we have done. Maybe yours is better?

In the above we can see the address of this device is 16.0.160.22.8.0.0, save this to a new variable. In this case it is my 4th sensor and given we start counting from 0, this is digital temp sensor number 3 in my system.

Once we have the address we can connect everything back up (dont forget to test if you have broken anything) and solder the DS18S20 to the end of a patch lead. I decided to use brown for negative, orange for 5V DC and blue for data.

Add heat shrink and enclose in container. I used a plastic container from a cutting tool and covered this in heat shrink and slid the DS18S20 and secured with two cable ties. These are really not needed as the fit should be snug

Step 3: Establish the link between the Dallas DS18S20 and HVPRO

I now needed to get the HVPRO talking to the thermometer. For all of my other sensors I use a 4 core multi strand cable but I didn’t think of this earlier and I have a double storey house. My solution was to use the existing Cat 6 cable I left beind my wall. I luckily have 4 ethernet cables behind this wall unit. 2 are used for data, 1 is used for RS232 and the 4th is now used for thermo.

The DS18S20 sensor can now be connected and placed on top of the NAD C272.

We now need to build our X10 driven fans.

Step 4: Link the LW12 to the fans
We need to link the LW12 to the fan. As a test I have connected the LW12 to a fan in my garage to test the variable speeds. Please note I did not insulate connections for this test. This can be very dangerous and extreme caution should be taken during these steps. The LW12 is speed limiting the fans which are an inductive load via a resistive coil.

Step 5: Wire the two fans and LW12 together
After testing in Step 4 it is time to make things a little bit more permanent. I used heatshrink to double insulate the wires, given the voltage / amperage combination is fatal I dont wish to take chances.

Step 6: Putting it all together – mounting the fans
It is now time to mount the fans. I would suggest using a hole saw to get a nice round cut. I had used a 130mm hole saw to mount the fans. Take your time, measure twice. The fans are designed to suck air from behind and push over the power amplifer

Measure twice, cut once. My pants are awesome.

130mm hole saw

First fan mounted

Both fans mounted, a few cable ties used to take load of any of the connections

Both fans mounted, very neat fit

Step 7: Add logic
Everything is connected but the PLC doesn’t know what to do. We better help it so here is some code to turn to the fans on (including a fail safe). It will need modification to log more data. Integer values are in degrees Fahrenheit + 50.

Step 8: Test
After about 15 minutes of hard load on the power amp the temperature has risen from the ambient 16c to 32c, you can see in the graph the fans flick on for around 1 minute, reduce the temperature and then power off. I have found I am unable to get the fans to spin faster than the first defined threshold

Given the data from thermostat is stored in a variable in the PLC we can keep track and model this in our NetIO front end which is displayable on phones / tablets that we use in our family

IMG_1260

All in all, this solution has solved my problem and over the last two years I haven’t had any thermal related issues. The fan’s do their job when seldom needed and if I can’t poll the thermostats the fail safe logic cuts the power to the units.

Shane Baldacchino