Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

>20V on PIC input?

Status
Not open for further replies.
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?.
 
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top