Quote Originally Posted by Acetronics View Post
Hi,

There's the other way ...

use what's inside the Pic ... the clamp diodes !!! just use a series resistor to limit input current to 10-20µA ( 500µA max continuous ... )

see AN521c for direct mains ( ! ) to Pic interfacing. That's OFFICIAL !

and if you want ... add 2x 1N4148 diodes parallelled to the clamping diodes !!!

no need regulators or complex circuitry !!!

Alain


Merci Alain.

Ok:

- 2 parallel 5M resistors on the input pin (AN521 suggested a backup just in case).
- a pair of backup diodes on the input pin as well.

And now the noob question, the PIC will be powered by a 5V circuit, the signal from the sensor is powered on a 12V circuit, where do the backup diodes go to? The 12V cicuit or the 5V circuit?

The clamping diodes within the PIC go the the 5V circuit, I would assume the backup would go to the same place, just want to be sure.

This would greatly simplify my life 'cause it gets real complicated real quick trying to use op amps like the LM239, I got that idea from another tutorial.