1

I'm working on a project to gather metrics from my HVAC. I need to detect the presence or absence of 24vAC on two different wires (Y/yellow/cooler, W/white/heater) relative to common - either of which will be periodically pulled to 24vAC by a relay in the thermostat. I have a Raspberry Pi with a 4-channel ADC ready to measure power but it is limited to +/- 1v.

I gave up trying to draw a voltage divider that could divide both Y and W without leaking voltage to the other input channel. That is to say, the ADC would see a range of voltages depending on none/one/both Y and W being pulled high, and it got too complicated.

Now I'm exploring the use of a couple of reed relays (datasheet) which run at 24vDC to isolate the channels. I need to come up with a way to carefully lower the 24vAC voltage to trigger the 24vDC reed relays. I'm thinking a single resistor in series with the AC power source should suffice, given an appropriate rating. I don't want to blow the relay coil and this needs to safely run unattended.

I need help calculating the rating of the resistor.

I hypothesize that I can simply lower the voltage with a resistor and not have to rectify the power before sending it to the relay but perhaps I am over simplifying?

Voltage Spike
  • 75,799
  • 36
  • 80
  • 208
Brad Hein
  • 1,042
  • 3
  • 13
  • 18
  • 1
    Brad, do you feel you need to use an ADC in order to detect the presence of 24 VAC? Do you want opto-isolation? Would a capacitor in the circuit be acceptable to you? – jonk Jan 08 '21 at 20:57
  • 1
    You can use a small 24AC relay, that would be the simplest thing. Or you can use an optocoupler with a RC filter + 1 transistor. – Marko Buršič Jan 08 '21 at 21:14
  • Brad, the first thing that had popped to my mind was Marko's suggestion of a 24 VAC relay. These are common enough. The nice thing about them is that they will provide a very robust result as they require access to a low-impedance power source and will not trigger in the presence of ambient but weak noisy signals or inadvertent leakage currents. Bullet-proof, so to speak. But they take space, cost money, and wear out. They also can chatter -- especially if the 24 VAC power source is off a bit. An opto-isolated input is very safe and pretty robust, as well. It's likely smaller, too. – jonk Jan 08 '21 at 21:39
  • I wasn't able to find a 24VAC relay that was relatively "small" - the current coming from the thermostat is quite low and I don't want to induce much of any load which might disrupt normal HVAC operation. – Brad Hein Jan 09 '21 at 18:23

2 Answers2

1

Use a circuit like this with an optocoupler (which should isolate the 24VAC to prevent higher voltages from reaching the Rpi)

The circuit also has a RC filter to keep the circuit on in between phases, but in the diagram below its set to something like 1ms, you will probably want to adjust it to something higher like 20ms and a 20uF cap.

The LED in the TCLT1600 shouldn't need more than 10mA so a 2k resistor for R85 should work to limit the current.

enter image description here
Source: AC detection for microcontroller

Voltage Spike
  • 75,799
  • 36
  • 80
  • 208
  • I can riff on this. The ADC (ADS1115) even presents +3.3. I'm still not sure what value to use for R85 (my reed relays are rated at 24VDC not AC so I need some resistance) – Brad Hein Jan 09 '21 at 18:54
  • Size R85 for 24V/ (the current through the LED)= R. The current needed is usually somewhere in the neighborhood of 5 to 10mA. Keep in mind that the current is gained by the phototransistor by about 50 to 300. So if you have 1mA on the LED side, you'll get "50mA" through the photo transistor ( but only if it were connected to a current source, the 11k of resistance from R32 and R33 will only "allow" 3.3V/11k= 300uA so the transistor will be fully 'on'. – Voltage Spike Jan 09 '21 at 22:46
0

Vending machines monitor their 24VAC input like so (resistors set for you 1V limit):

schematic

simulate this circuit – Schematic created using CircuitLab

So make two of these and wire up each one to a seperate A2D.

You can also wire them up to a GPIO and set an interrupt on falling edge, or something like that. I've also seen that done too.

Aaron
  • 7,274
  • 16
  • 30
  • The issue I ran into (on paper) with two of these is that the inputs interfere with each other as seen by the ADC. This is due to R2 and C1. Good point about GPIO, I will do some research to find out more. – Brad Hein Jan 09 '21 at 18:27
  • Oh, I was assuming each one would go to it's own input. – Aaron Jan 09 '21 at 23:03