AC to MCU

Status
Not open for further replies.

TucsonDon

Member
I have a valve that operates on 24VAC with limit switchs. I want to use this on a MCU as an input, what is the best wat to do that? Can I use a transistor?
 
using the NO contacts on the limit switch to indicate valve position (open-shut). the limit switch is a SPDT and NC contacts are used to control the actuator so when the switch shift I have a 24VAC signal that I want to use as an input (5VDC) on a MCU
 
You can use a voltage divider to feed the pin but be aware that your signal will be a 50/60Hz square wave. On pic μC you can feed the pin via a high value resistor as they have protection diodes built in.

Mike.
 
One way would be to use a series diode and an optocoupler (plus a current limiting resistor of course). You could add a capacitor across the LED to keep it illuminated during the negative half of the cycle or deal with the pulsating LED in code.
 
One way would be to use a series diode and an optocoupler (plus a current limiting resistor of course). You could add a capacitor across the LED to keep it illuminated during the negative half of the cycle or deal with the pulsating LED in code.

The series diode-any particular one I should use? How big of a cap?
 
The diode is absolutely non-critical. It has to handle a peak voltage of √2 ×24 ≈39 v, and at least 20mA. A plain old 1N4148 is up to the task, as is any of the 1N400x series.

As far as the cap, you don't even need one if your code will tolerate a square wave. On for half a cycle, off for half a cycle, on for half a cycle....the first time it's off for more than a cycle means the pump is off.

If you use a cap, you want the capactitance to keep the LED on through the half cycle and not much longer. I'd do some experimenting. The cap should be across the LED and series resistor.
 
All you need is a resistor 1 mho good with 120 volt 5oo k works fine if you use a 6 to 24 volt transformer

The red led is blinking at each cross.
 
I am using "AC" photocouples like this one.
View attachment 112040

Darn it Ron. I just spent 2 hours drawing a schematic that takes either a contact closure or voltage input, but because one of the contact closure sensors requires bias voltage to operate, the connection polarity is reversed depending on the mode used. THESE will solve that! I wonder if they come in a quad version?
 
Already found what I needed and my schematic is revised. This simplifies connections substantially and even eliminates some parts.

I never even thought that AC optocouplers existed.

Thanks,

Jon
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…