> does anyone can send me the formula for latching relay? > I want to hold the a 12v relay for certain time after power-off (about 20 > seconds) the relay consume 37mA/12v (I think it's coil resistance is 30-32 > Ohm) what is the size of the capacitor I should use? > > p.s: across the coil there is a 1n4001 diode does it important for > calculation? At 27 mA and, say 6v drop for a 20 second delay you would need about 4 FARAD = 4,000,000 microfarad. This is far too large a load to supply for a long period directly from a capacitor. What you need to do is to use some electronics that need much less drive current to drive the relay. Then apply the delay to the drive circuit. If you drive the relay with a MOSFET then by placing a 1 mohm resistor from gate to ground and a 10 uF from gate to ground you will get a circuit that will stay on for ABOUT 20 seconds after power is removed from the gate. This is not an ideal circuit but is a starting point. A better solution would be a digital one as timing delays ca be more accurately established and altered. A very cheap PIC would do this well or you could use a counter IC and some extra logic. The capacitor will need to be a low leakage type. A solid aluminium would be OK. A Tantalum cap would be useable but select a cap voltage 3 or more times higher than the supply voltage. The reverse biased diode should not affect operation. Russell McMahon _____________________________ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.