PIC powered by capacitor for 0,5 second


Closed Thread
Results 1 to 19 of 19
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Default PIC powered by capacitor for 0,5 second

    Hello,
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1936&stc=1&d=118781343 6">

    I intend to power a PIC (it's a 16F630 at the moment) throught a switch and detect a "power-OFF / power-ON" sequence.

    In other words, when I press the button, the PIC is switched "ON" and a Port (i.e. pin 3) reads a HIGH level. PIC performs Task 1 as long as the power is not cut.

    I would like to be able to release the button for half a second to detect the LOW level on the Port and then switch the PIC back ON again to perform Task 2.

    If the power-OFF state is longer than 0,5 second, the PIC will normally perform Task 1 when the power comes ON again.

    I tried with a 10µ capa and then with a 470µ one but I can't get it working, the PIC switches OFF immediately. The total "load" on the PIC is around 2mA during the time a release the button (= no direct power from the supply). The diode is a 1N4148.

    Is what I'm trying to achieve possible that simple way or not? If yes, what should I change or add to my circuit?
    Attached Images Attached Images  
    Roger

  2. #2
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Post removed. I will post again a new version.

    Luciano
    Last edited by Luciano; - 22nd August 2007 at 22:00.

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    Hi Luciano,

    Thanks for the very quick reply.

    Did you intentionally invert pin1 (Vdd) and pin3?

    How is the resistor going to slow-down the discharge into the PIC?

    I need to keep the PIC powered ON during 0,5 second even if the switch is open.

    Meanwhile, I'll try you suggestion out.

    *** Okay. Just saw your last message.
    Roger

  4. #4
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    What is the used voltage, or what will be the voltage in the final design?

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    It's a gadget for a car.

    I'll use a 7805 to make a clean +5VDC.
    Roger

  6. #6
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    This is what happens with 1000 μF and a load of 1.62 mA.



    Luciano

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    I suppose that a 4700 is the minimum capacitor to use. There are .5 and 1 Farad capacitors in low voltage now available to power RTC's instead of coin batteries. Why not use one?

    Take a look at http://catalog.digikey.com/scripts/p...?name=P6955-ND

    Ioannis

    P.S. By the way, nice instrument Luciano!
    Last edited by Ioannis; - 23rd August 2007 at 10:17.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Luciano View Post
    This is what happens with 1000 μF and a load of 1.62 mA.



    Luciano
    Hi, Luciano

    Nice to see you back here !

    mmmmmmh, By the way ....

    You gave the PEAK current ... as it decreases with power Voltage.

    A JFET could have been a better current drain than the 2.7k.

    Were nice holidays, weren't ??? You're not totally back it seems ... LOL !!!

    Best Regards
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    Hello Alain,

    Could you give me some more details about how to connect the transistor and even why this would be a better choice please?
    Roger

  10. #10
    Join Date
    Feb 2005
    Location
    Holmfirth England
    Posts
    116


    Did you find this post helpful? Yes | No

    Default

    Hi,

    If you have not done so already try turning off the brown out detect at the programming stage, this will stop the pic from resetting as the voltage drops. With a 2200uF cap that should work fine

    Regards
    Bob...
    Last edited by BobEdge; - 23rd August 2007 at 15:27.

  11. #11
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    Thank you for appreciating my midnight engineering!

    Best regards,

    Luciano

  12. #12
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Roger,

    Try that:



    Best regards,

    Luciano

    EDIT: The Brown-out Detect Voltage (BVDD) is 2.025 — 2.175 V.
    Try first with the internal Brown-out Detector enabled.
    Last edited by Luciano; - 23rd August 2007 at 22:21.

  13. #13
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Hello,

    I intend to power a PIC (it's a 16F630 at the moment) throught a switch and detect a "power-OFF / power-ON" sequence.

    In other words, when I press the button, the PIC is switched "ON" and a Port (i.e. pin 3) reads a HIGH level. PIC performs Task 1 as long as the power is not cut.

    I would like to be able to release the button for half a second to detect the LOW level on the Port and then switch the PIC back ON again to perform Task 2.

    If the power-OFF state is longer than 0,5 second, the PIC will normally perform Task 1 when the power comes ON again.

    I tried with a 10µ capa and then with a 470µ one but I can't get it working, the PIC switches OFF immediately. The total "load" on the PIC is around 2mA during the time a release the button (= no direct power from the supply). The diode is a 1N4148.

    Is what I'm trying to achieve possible that simple way or not? If yes, what should I change or add to my circuit?
    Reading again your post, why is it necessary to power off the PIC???

    Just keep powering it normally and just connect the button to any input. Then the program will decide about which task to perform according to Press/No-press state of your button.

    Am I missing something?

    Ioannis

  14. #14
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default How it will work

    This circuit will control a "stop-light" made of LEDs located in the center of the rear-window of a car.

    There are two wires powering the "stop-light". Only 0V is constant and V+ comes when you go on the brakes.

    My first idea was to install a third permanent V+ wire but the engineers from RENAULT made things not a simple way and it is almost impossible to do so .

    Function of the circuit: when I go on the brakes, all LEDs light-up.

    If I go on the brakes a second time:
    - more than half a second later (> 0,5s), all LEDs will light-up again;
    - less than half a second later (< 0,5s - or, if I go a second time on the brakes within half a second), I will activate a function that makes my LEDs scroll.
    Roger

  15. #15
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    OK. Now is Clear. Well, the 1 Farad is very large capacitor at 5.5Volt. I think is the cheaper and easiest solution.

    Only as a precaution, use a small resistor of 100 ohms to charge it, not directly at +5V.

    Ioannis

  16. #16
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Roger

    Why not, when removing power, enter a BASIC .5 seconds SLEEP command, and then verify if power is still here ???

    Think to modify the WDT prescaler ... cause PbP sets it to 128 ( the 2.3 s granularity ! )
    See OPTION Reg setting (in PBPIC.xx LIB ... ???)

    The capacitor size could be reduced ...

    Alain
    Last edited by Acetronics2; - 24th August 2007 at 08:36.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  17. #17
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    This circuit will control a "stop-light" made of LEDs located in the center of the rear-window of a car.

    Function of the circuit: when I go on the brakes, all LEDs light-up.

    If I go on the brakes a second time:
    - more than half a second later (> 0,5s), all LEDs will light-up again;
    - less than half a second later (< 0,5s - or, if I go a second time on the brakes within half a second), I will activate a function that makes my LEDs scroll.
    Hi Roger,

    Not allowed in Switzerland, in case of a car accident you will have a problem.

    The police will stop your car immediately and you will have to fix the car and then
    go with the car to the "Service des automobile" of the canton where the car is immatriculated.

    Best regards,

    Luciano

  18. #18
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default ...

    I know that...

    But what would be the taste of Life if there is no risk?

    BTW, with this circuit, I will "harm" myself only.

    Thanks anyway for warning.
    Last edited by flotulopex; - 24th August 2007 at 15:03.
    Roger

  19. #19
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Thumbs up

    Thank you Luciano!

    It works perfectly with a 1000µF according to your schema and BODEN disabled.

    Try to show the final result in a few days...
    Roger

Similar Threads

  1. How can a battery powered PIC turn itself off?
    By tekart in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 9th August 2012, 10:44
  2. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  3. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  4. Pic powered from USB?
    By Squibcakes in forum USB
    Replies: 5
    Last Post: - 26th June 2006, 00:03
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts