24vac input Shield

I’m looking to build a shield that will monitor 24vac from my HVAC system (on or off and time duration), Heat, Cooling, Fan, etc. I’ve looked at changing 24vac to dc thru bridge rectifier and voltage divider then an iso coupler, Zero-Crossing Detectors like the LTV-814HS or H11AA1 or 24vac relays. I’m looking for a simple way and not spending a lot on hardware or time on code. I can’t seem to find 24vac pc relays that fit the bill, I believe I could use the zero-crossing det. with ac and would have to add code to adjust for pulse output. I could also use a current sensor for each channel. Are there any shields or boards that are designed to do this? I will add other shields for input of Temp sensors and relays for output control. I’m using an Arduino Uno now and would upgrade to a Mega at some point. I would love any help to point me in the right direction on this project. I have looked at other posts on 24vac to 5v inputs and they have been of some help. At this point I would like (4) 24vac inputs and may expand it to 8. Thanks for your help!

Hi;

I'm looking to build a shield that will monitor 24vac from my HVAC system (on or off and time duration), Heat, Cooling, Fan, etc. I've looked at changing 24vac to dc thru bridge rectifier and voltage divider then an iso coupler, Zero-Crossing Detectors like the LTV-814HS or H11AA1 or 24vac relays. I'm looking for a simple way and not spending a lot on hardware or time on code. I can't seem to find 24vac pc relays that fit the bill, I believe I could use the zero-crossing det. with ac and would have to add code to adjust for pulse output. I could also use a current sensor for each channel. Are there any shields or boards that are designed to do this? I will add other shields for input of Temp sensors and relays for output control. I'm using an Arduino Uno now and would upgrade to a Mega at some point. I would love any help to point me in the right direction on this project. I have looked at other posts on 24vac to 5v inputs and they have been of some help. At this point I would like (4) 24vac inputs and may expand it to 8.

Thanks for your help!

Sorry, but this looks more readable, and you might have more forum members read it.

An optocoupler with a diode and current limit resistor will do the job. The diode will rectify the current for the optoLED, and the current limit resistor will take care of the LED drive. You will not have to go to the extreme of zero-crossing detection if all you want to know is if 24Vac is present or not.

What is your electronics, programming, arduino, hardware experience?

Tom.... :)

Tom, I'm a newbee to Arduino and writing code, just started with LCD and Temp sensors on my phototype shield. I do have experience in basic electricity and electronics and some programing skills. Would the optocoupler with a diode and current limit resistor give me a steady 5v output or would it be a pulsed like the LTV-814HS or H11AA1, guess it would depend on input filter? Thanks!,

The diode shouldn't be necessary with the LTV-814HS since the input side has two input LEDs in parallel and reversed. The H11AA1 doesn't seem like an appropriate choice but if you went that route you would need a diode. I'm no expert with optocouplers but that's what I gather from the datasheets.

You need the resistor to limit current through the optocoupler; ~20K should do the trick. You will still see pulsed input. The simple way to detect if there's a signal on the line or not is by using the pulseIn() function.

Hi,
If you go the diode rectifier direction on the input to the opto, then put a 10uF cap on the rectified side before the current limit resistor. To smooth the rectified AC.

Most DC optos need about 15 to 20mA

24Vac = 24 * 1.414 = 33.94Vp = 33.94Vdcrectified

R = 33.94/.015 = 2262 Ohms == 2200R

If you use the LTV-814HS, check the specs, as it needs a bit more input current than the DC optos up to 150mA

Tom… :slight_smile:

I like both ideas but will try the optcoupler with Diode, Resistor and Cap in a breadboard and see what I get. Would be easier on the code end of the project. I have (20) 6N135 (25mA) and would like to try them. What would be the minimum current on the input of the 6n135 be? Would a bridge rectifier be better?
http://www.mouser.com/ds/2/115/ds21203-60487.pdf
http://www.mouser.com/ds/2/427/6n135-104991.pdf

Thanks!

Hardware costs real money, software only costs you your time :)

Connect the 24VAC to the input side of your 6N135 using the 2200R resistor as TomGeorge describes. Connect the output side to Vcc,Ground and Vo to +5v, GND and a digital input pin on your arduino.

This will give a signal that will fluctuate at mains frequency (50 or 60 hz) . This means the signal will go from high to low every 16 or 20 milliseconds

Configure your digital input to use the built-in pullup resistor.

Use the following code to decide if the 24Vac is there or not

void loop
{
    
    signal=digitalRead(signal_pin);
    now=millis();
    if (signal != last_signal) {
            last_time=now;
            last_signal=signal
    }
    
    if ( now - last_time > 40 ) {  // 40 ms is at least 2 cycles
        // AC is off
    } else {
        // AC is on
    };
}

I like your way of thinking and its so simple! I will put this together and give it a try.

Thanks so much, and to add the code is Great! Everyone that takes time to help others on this forum make it special!

Mad-Tom

Update

1, I connected the 6n135 optocoupler on my breadboard with 5vdc. pin8 >5v, pin5>GND, pin6>Vo with 1K pullup resistor. Input side pin2 >5v thu 220 ohm current limiting resistor and pin3 > GND. I get 15.9 mA in input side, with output (High in = Low out).

2, I kept all the same on output side and connected 24vac (26.2 vac) to pin2 thur 2.2 K resistor and a diode and pin3 to the other side. I get 5.0 mA of current on input and pulsed output.

3, I changed the diode from series to parallel across pins 2 & 3. with 2.2 K resistor in series with the 24vac input I get .18 mA on the input and pulsed output.

Why am I getting the low current readings on my meter? Because of the half wave DC input?

Which is the better way to go for connecting the diode?

Thanks!