Simple solution is to add memory capacitor http://images.google.com/imgres?imgurl=http://www.suntan.com.hk/product/TS12_Electric_Double_Layer_Capacitor.gif&imgrefurl=http://www.suntan.com.hk/moreinfo.asp&h=193&w=226&sz=23&hl=en&start=2&tbnid=mdx2knkvHBuJeM:&tbnh=92&tbnw=108&prev=/images%3Fq%3Dgold%2Bcapacitor%26gbv%3D2%26svnum%3D10%26hl%3Den%26rlz%3D1T4HPND_en___US210 disconnect 5 v that goes to pic vdd and add shotcky diode then add above cap to pic side. thru one of pic pin read zero crossing pulse from your AC. when the power goes off the pic has enough power to run and detect an error. If I understood the question right? Andre Abelian -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of alan smith Sent: Thursday, May 10, 2007 11:50 AM To: Microcontroller discussion list - Public. Subject: [EE] Detection of getting unplugged Well, I've been trying to solve a particular problem for a few months, sorta on again, off again issues. Simply put, I need to know when something has been unplugged from a AC socket. I don't care about how much current its drawing (I do...but I dont need to know), because in some cases it might be a 100mA wall wart and in other cases a 100W power supply. I just want to know....did it get unplugged. I've looked at some exotic solutions like power monitor chips but they aren't really designed for this. I've played with Allegro hall sensors but the sit at 2.5V nominal, and just mimic the AC waveform and yes, with a larger load I can see it but smaller devices do not make a large enoough effect even when I use a simple gain stage op-amp. Nothing really gives a solution to cover all the ranges. I need it small, cheap and simple to build. (think production enviroment). So, any good ideas out there? --------------------------------- Get your own web address. Have a HUGE year through Yahoo! Small Business. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist