>20V on PIC input?

Status
Not open for further replies.
I want to monitor 24VAC relays from a thermostat. Can I simply put a 47K resistor on the RB4-7 inputs on a 16F8xx series chip? This is done with RS232 and the internal diode clamps keep it between vcc & gnd.
 
If you feed it with 24V AC you will get a 60Hz squarewave on the input pin, probably better to rectify and smooth it first?, or write your code to accept an AC input?.
 
Easy to write the code to ignore 60Hz. Thermostat relays are not supposed to switch on/off rapidly. Usually 6 times an hour. More can damage the furnace.
 
So what exactly you need to do? sure you can just use a serie resistor. As stated you'll get a square wave but... does it cause you problem?

If it's the Voltage you want to measure, voltage divider can will be the solution. Diode in serie, Voltage divider, capacitor, then calculate the incomming voltage.
 
William At MyBlueRoom said:
Can I simply put a 47K resistor on the RB4-7 inputs on a 16F8xx series chip? This is done with RS232 and the internal diode clamps keep it between vcc & gnd.

With that configuration, probably ok.
It is not correct that a internal diode clamps the voltage. The internal diode will shunt the voltage to Vdd. If the leakage current exceeds the current consumed by the chip and anything else hooked up to the 5v line, some bad things can potentially happen.
Many voltage regs have little or no ability to shunt excess voltage from the 5v side back to ground. Thus excess current going into the 5v line will raise the voltage and the device can latch up.

At 47k, that's 0.4 ma per input, so it doesn't seem likely to cause a problem. The 16F8xx doesn't have a very low power sleep mode that I know of which could cause a problem at that current level.
 
You could use a Zener diode to clamp the voltage after the 47K resistor just to be on the safe(r) side.

Another method is to use an opto-coupler, driven by the relay AC voltage, use an internal pullup on the PIC to be pulled low by the transistor side of the opto. The main advantage of doing this is that any spikes from the thermostat will not be shoved down the IO of the PIC, which at high voltages could be a large current to the PIC and make it latch.

I would advise resistor for homebrew and opto for commercial

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