PDA

View Full Version : power Off/shutdown code/circuit



dccch
- 21st August 2006, 16:07
Hi,
I'd like to completely power off a PIC based circuit after the job is done. Currently I've a relay that controls AC power to the circuit, the relay is driven by PORTA.0. the logic is somewhat like this

PORTA.0=1 ' relay is ON, power is applied to PIC
....do the job
PORTA.0=0 ' relay is OFF
FOR I=1 to 1000 'start a loop to die until DC power is disappears
Pause 1000
NEXT I

unfortunately this is not reliable

Any hint ? using an external transistor connected to MCLR ?

Thanks

DynamoBen
- 21st August 2006, 16:47
In what way is it not reliable?

BTW you could replace:

FOR I=1 to 1000 'start a loop to die until DC power is disappears
Pause 1000
NEXT I


With:

End

mister_e
- 21st August 2006, 17:52
More detail and a schematic will help. PIC# too

emmett brown
- 21st August 2006, 19:36
"PORTA.0=1 ' relay is ON", Isn't PORTA.0=0 ' relay is ON?

Luciano
- 21st August 2006, 21:06
Hi,

Try to disable the Brown-out reset circuit.

http://img10.picsplace.to/15/BOR.PNG (http://picsplace.to/)

Best regards,

Luciano

dccch
- 23rd August 2006, 20:16
My initial routine is not reliable because I guess the following happens:
1) turn on relay
2) do the job
3) turn off relay -> no AC power is applied
4) the large 2000 uF capacity voltage goes down slowly, i.e below 4V
5) the brown out logic kicks in -> resets the PIC which restarts from begining
6) goto 1) --> AC power is applied again...

will try the END statement as suggested above, otherwise will look at the LM2914 power regulator described in an other post.

Thanks
Eric

Luciano
- 23rd August 2006, 20:29
Hi,

Describe the electrical circuit used to turn on the device.
(Push button)?

Best regards,

Luciano

Archangel
- 23rd August 2006, 21:13
Hello,
I have a low cost idea, install an SCR between the voltage regulator and the load (PIC) make sure the filter capacitor is on the load side of the scr. Using your existing relay setup the SCR will disengage when power is cut off to the SCR and will not reapply power if power supply should power up again,bias the gate so it requires a significant voltage to trigger it to prevent Ghost startups, otherwise a simple latching relay setup like power tools use would do as well.