I moved over the summer and the new apartment does not have the same type of heating that the last apartment did. So this is a perfect opportunity to revamp my existing project with my raspberry pi.
Quick re-cap, previously I had a forced hot water system where a furnace heated water and circulated it through radiators in each room. This was controlled by one central thermostat located in the dining room (center room in the apartment). By sensing if the thermostat was “ON” I was able to see if the furnace was heating the radiators.
This new apartment has 2 sources of heat. Each room has electric heat baseboards with a thermostat to control that room. Additionally, there is a single natural gas wall vent furnace in the living room. The furnace is intended to heat all the rooms and replace the electric heat. The apartment is a two-floor town-house, so this may be a tall order.
The electric heat is not expected to be used much if at all. This is mostly because it would be expensive, but luckily, this means I don’t need to monitor 6 different thermostats. Unfortunately, the furnace is an all-enclosed unit with no external thermostat and it has a single temperature control for both stages. So a new approach needs to be devised.
Here is what we are dealing with: A Rinnai Energy Saver-551F
This unit, which has 2 stages so it can make LOW or HIGH heat. Whether it is making LOW or HIGH heat is determined by the heater, the idea being that if the room is very cold it makes more heat, then to maintain the temperature it runs lower and more efficiently.
Under the little door near the top-right of the front are the controls. There are only two settings available: ON/OFF and ROOM TEMP. This is a little disappointing and distinctly different from the last apartment, so I had to find out if I could use it.
After opening it up, I found the schematic and block diagram on the inside (THANK YOU Rinnai).
It seems like there is a lot going on here. What I’m looking for is the equivalent of a thermostat in order to tell if the furnace is making heat and if so, LOW or HIGH.
After studying the Block Diagram for a while I was focused on the solenoid valves. These valves are controlled by an electric switch and control the amount of gas delivered to the burners, so it seemed like if I could check if these are turned ON (open valve), I could monitor if the fuel is on. Following the diagram, it looked like SV1 & SV3 are controlled by a single relay (R1) and SV2 is controlled by a different relay (R2). These relays also control the Blower fan, which is also used when the heat is on. A relay is simply a switch, as was the thermostat in the previous apartment, so if I could find the relays on the circuit board (marked MICRO COMPUTER) in the diagrams, I might be able to monitor them the same way. Let’s take a look!
Above, I circled the locations of what appear to be relays on the PCB. The diagram lists Relays 0-4 but I don’t have anyway of knowing which is which. There is also no obvious way to sense what is happening. So I looked around for what else might be easily accessible, focusing on the solenoids.
I found the solenoids all clustered together. From the block diagram I knew that I can find if the relay is on at the solenoid. And luckily, there are some big connectors at the solenoids that might provide access to the contacts I want. Following the flow of gas, I saw that the top solenoid with purple and yellow wires is SV3. The bottom left solenoid is SV1, and the bottom right solenoid is SV2. Let’s try it!
With the unit OFF, I pushed some probes connected to my voltmeter into the back of the connector on SV1. I then turned the unit ON with the temperature control set at the coldest. The voltmeter measured 0Vac and 0Vdc. I then moved the temperature control all the way up and heard the unit click on (the sound of relays). Now the voltmeter measured 47Vac and 100Vdc. That is a strange reading and indicated that there is an odd waveform coming from the relays, but I might be able to sense it anyway. Before I turned the unit back off, I confirmed that SV2 measured the same.
I decided to try the same circuit that I used previously. The voltages are higher and the waveform may be more erratic, but I was ready for a “guess and check” session with some wires jammed into the connectors and clipped with jumpers. I decided to modify my existing circuit on the raspberryPi by changing the resistor and checking if the GPIO pin was HIGH or LOW by running a small script command. This command below will continuously take a reading from gpio23 and display the result to screen, then wait 1 second.
while true; do cat /sys/class/gpio/gpio23/value; sleep 1; done
Remember, in the circuit the GPIO is Normally HIGH, so a 1 is OFF and a 0 is ON.
This is the circuit I used with the thermostat in the last apartment. In order to retrofit it for use with the Rinnai, I increased the resistance of the bias resistor before the voltage rectifier (all the way left). To determine what resistance to use, I got some general numbers from the datasheet for the 4N35 opto-coupler I was using. The emitter in this will bias between 4mA and 60mA.
In order to stay at the “safe” end of lower current, I started with a 14.9Kohm resistor. With my ammeter in series with the resistor, I measured about 6.12mAdc when the unit was on, and the raspberryPi GPIO pin was returning 0 and 1 randomly, so it seemed like I was on the edge of the optocoupler biasing fully. In order to bring down the resistance, I put a 22Kohm resistor in parallel with the 14.9Kohm. This time I measured about 10.2mAdc, and the pi was returning steady 0s. I turned the ROOM TEMP slider back down and the pi started return 1s. So I believed the circuit worked, guess and check successful.
With this “breadboard” circuit working, I decided to continue with this by adding wires more permanently to the solenoid connectors. Note that the Block Diagram states “…if wire replacement is required 105ºC wire must be used.” So I got some 105ºC wire from VTC, as well as some pins that seemed approximately the correct size, and made up these beauties.
These are 4 wires to bring out the 4 pins I needed to sense from the solenoid valves. Then I installed them so that they came out the bottom of the unit and could be put away until I made new circuits to sense them at the pi.
Now that the heater was ready, I went off to solder together some new sense circuits. I wanted 1 for each solenoid (SV1 and SV2), and I copied the circuit I made before, changing the the resistor value to that that I tested for. I also fit both circuits onto a single board. I ended up connecting up the SV1 sense circuit to the GPIO 22 pin, and the SV2 sense circuit to GPIO 21. Here is a photo of me attaching (hot-gluing) the circuit board to the raspberryPi mounting plate during the wiring process. Next I was going to solder those red and black wires to the pi for biasing of the GPIO pull-up resistor and smoothing capacitor.
Once that was done, I mounted the pi on the wall near the heater. I wanted to keep the wires from the heater as short as they can be because the voltages coming from it seemed a little high.