Best / simplest way to limit voltage

Status
Not open for further replies.

Scarr

Member
Hi,
I want to limit the input voltage to a project, the input will be connected directly to a pin on a PIC, I would like to have as wide a voltage range as resonably possible, is there a simple way to do this like a zener or IC or something?

Thanks
 
What do you mean, do you have a high voltage signal wich you need to input into a digital input on a pic?

Just put a resistor in series with it (10K or 100K). The pic's internal clamp diodes will limit the voltage.
 
I mean...

I want this pin to be a general purpose input so the user can attach say 12v or 24v etc. to it and I would see this as a digital '1' in my code without damaging the PIC.

Thanks
 
Re: I mean...

Scarr said:
I want this pin to be a general purpose input so the user can attach say 12v or 24v etc. to it and I would see this as a digital '1' in my code without damaging the PIC.

Like Exo says, a simple series resistor is all that's required, the input protection in the PIC (see the datasheet) will clip the input at 0V and 5V.

A 100K would work fine, and allow much higher voltages than the 24V you are using.

If you check the MicroChip datasheets they use the same method (with a higher value resistor) to feed mains into a PIC pin - to detect zero crossing.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…