View previous topic :: View next topic |
Author |
Message |
djpark
Joined: 02 Mar 2004 Posts: 49
|
Detecting the presence of 'high' voltage |
Posted: Sat Jun 18, 2005 5:42 am |
|
|
I am working with a simple data logger using PIC12F683. The Vdd is supplied through an LDO with 2.5V output and the main power source is 'any' battery combination which can be from 3V to 12V.
I am trying to use one of GPIO to monitor the presence of the main battery power using digital input (not AI) with interrupt-on-change feature. When the main power goes down, it has to save the current status to data eeprom and go to sleep till the power is back with the some power stored in a capacitor.
My question is :-
Is it safe to connect a large value resistor such as 100K or 1M directly from the main power (3V - 12V) to the GPIO?
Since the battery voltage can be variable depending on the battery sets, voltage divider will not work to trigger with low battery voltage. (or will it?)
I am expecting that the current flow to the GPIO from the main power is limited to less than 1mA and the over-voltage clamping diode within the PIC shall be able to handle 12V without being damaged.
But I am hoping to get confirmation or some advices on other possible ways.
Thanks in advance.
-- dj |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Sat Jun 18, 2005 6:33 am |
|
|
Look up Micochip application note AN521. It describes simple manufacturer recommended ways to connect upto 220VAC to a digital I/O pin. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
djpark
Joined: 02 Mar 2004 Posts: 49
|
|
Posted: Sat Jun 18, 2005 7:03 am |
|
|
Thanks for letting me know.
I consider the answer to my question is "yes"!?
For max 500uA current for 12V, min 24K resistor is to be used. So I am going with much bigger one like 470K.
-- dj |
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Sun Jun 19, 2005 5:32 am |
|
|
I use an added external clamping diode (Schottky), and a clamping zener together with a small capacitor (as part of an RC filter) for a similar purpose (checking AC power presence),
Somehow I felt unsecure letting in the noisy main power or unregulated DC into the PIC in any way. (I do precise A/D conversion on the adjacent pins) Also felt kinda sympathy for the buit-in clamping diode in the PIC doing it alone.
Note regarding the 220VAC: be sure to use resistors with a high voltage rating, ie. small SMD chip resistors are not suitable for this, some dust + moisture and they will let the 220VAC straight thru. I use large, 2W metal-oxide resistors, because of their mechanical size giving a reliable 220VAC spark gap. (check for resistor's max. voltage rate in their datasheets) This also has to do with the human safety considerations. |
|
|
|