PDA

View Full Version : Idea Help, Monitor AC line switch to temporary alternate power



nemesis
- 13th March 2009, 18:08
Hey guys,
I am just looking for some ideas on how to accomplish the following:

Project box (we'll call it the parent box from here on in) is plugged in to 120VAC outlet that is controlled by a switch. When the power is switched off I need a small amount of time to in which the parent needs to have enough power to keep the reciever up (3mA), Transmitter (12mA durring transmit) and the pic. Durring this outtage time the parent needs to transmit to another box (child) to signal the turn off. The child box then transmits back acknowledgement of receiving the message to the parent box. If the parent does not get the acknowledgement code back it needs be able to retry a couple of times. Right now the setup is for one child, but it may grow to have a couple more child nodes.

I'd like to avoid using a battery if possible. Can I use a supercap to pull this off. Either way the pic needs to know when we are on altenate power or not. Any ideas would be greatly appreciated.

Thanks,
Nemesis

Byte_Butcher
- 13th March 2009, 19:47
How much time do you need?

15mA isn't very much. If your power supply has a big fat electrolytic filter cap in it, that may be enough already. Hang 10,000 uF on it and see how it goes...

Or a super cap. Or a small rechargeable battery.

nemesis
- 13th March 2009, 20:59
Thanks for your reply.

Just long enough to send 68 bits and get back 68 bits and resend if no response. I found a 1F super cap... How can I prevent other components from draining the cap so that the pic, transmitter and reciever are the only draw? Also would such a cap act as a short for the initial charging? Also what is the easiest way to sense that the ac line no longer has current on it?

My origonal thought was to put a 5M resistor straight in to the pic. Have an onchange interrupt zeroing out a counter. Then having Timer1 incrementing that same counter. If I get 0V on the pin after 10ms (from the counter) start the transmitting till we die sequence.

Currently I don't have a power supply worked out. I was planning on using something simple like: Transformer to 8VAC -> Recitifier -> 100 uF cap -> resistor -> Zener Diode 5.1 -> 470 uF cap. Or maybe use a 7805 if the zener diode doesn't work out.

mistergh
- 29th April 2009, 01:45
nemesis:
any resistor from line voltage to a PIC is a no no, you are making the circuit hot. My suggestion is:
If you don't want to use a small rechargeable battery I suggest an AC plug in, bridge rectifier, two resistors to ground (voltage divider, max 5V out), a connection from between resistors to PIC to detect power present. Also after rectifier, two diodes (like 1N4001) to two 78L05 or similar.
AFTER diodes one capacitor to ground for each 78L05, one small (like 470uF) for circuits other then PIC, Receiver etc. and the other a large capacitor for the supply of the PIC, Receiver etc which needs to have power after ac is off.
If you would use a 9V NiMH rechargeable battery you could simply trickle-charge the battery all the time. You would have much more power available for a relatively long time after the power is off and you could run the whole circuit off the battery. I hope this makes sense to you.
Gunther