PIC - turn on-off

Discussion in 'The Projects Forum' started by matej, Aug 20, 2012.

  1. matej

    Thread Starter New Member

    Aug 20, 2012
    Hello, I just want to say that I'm Croatian, so sory if i make some grammar mistakes. :)

    I'm working on some PIC project where I need to do the following:
    When a button is pressed PIC turns on.
    After some time, one of PICs pins go high and that triggers the PIC to turn off.

    I successfully manage to get first part working, but the second part, where PIC needs to turn off, is a problem to me. Here are some pictures from Proteus so you can see how I wired it up. LED respresent PIC.
    On 1. photo nothing happend, on 2. pohoto button was pressed and led still lights.

    Thank you for any help :)

    the 2. photo is under this, and 1. photo is at the end of the post. I couldn't upload it any otherwise.

    EDIT: I messed up the title on accident, please admin rename it to: "PIC - turn on-off" or something you think is appropriate.

    Last edited by a moderator: Aug 20, 2012
  2. JDT

    Well-Known Member

    Feb 12, 2009
    Don' switch the supply. The PIC has a instruction: SLEEP where it goes into a low power state and draws almost no current. The PIC can be woken up from sleep with a level change on a pin. This could be your push button.

    Then the PIC does something and after a software time delay it could go back to sleep again.
  3. matej

    Thread Starter New Member

    Aug 20, 2012
    But I also got some other elements attached to the supply, like LCD backlight, and I want LCD to also shut down when PIC shut down.
  4. absf

    Senior Member

    Dec 29, 2010
    I can think of only one way to switch off the thyrister, i.e. by putting a NC relay contact in series with the lower side of the thyrister.

    You can switch the relay through a NPN transistor to a PIC port pin. I am not able to simulate the circuit in proteus as I cannot find an animated 5V relay.

    Another better way of doing it is the circuit suggested by ErnieM at post #9 in the discussion here...


  5. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    This is a power switch that I created for a PICAXE µ-controller. It gives you two options that are implemented in software. One is Push-ON/Push-OFF. The other is Push-ON/Program-OFF. It requires one input and one output. You only need one output if you only want Push-ON/Program-OFF

    There where several threads on the PICAXE Forum of ways to do this sort of thing.

    absf likes this.
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008