Minimizing power use w/ 12f683


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305

    Default Minimizing power use w/ 12f683

    Gents,
    I'm using a 12f683 on a battery, shematic attached, to sequence through some LEDs. When someone pushes a button the program, portion attached, runs just fine and draws around 20mA. While idle it draws around 3.5mA with MCLR, WDT, BOD and CPD off. I need to figure out a way to cut down on the idle current draw or else the recipient will have to change batteries every quarter. I've tried SLEEP and NAP but the program can't run during that time so the system appears dead during that time.

    Please note: On the schematic, the 5V regulator is shown as a LT1585. I couldn't find a TO-02 regulator in the SWcad library so I used the 1585 symbol. I also couldn't find a switch so you'll have to use your imagination. The attached program had to be recreated since MicroCode studio won't load on this computer.

    Please don't sharpen your barbs too much, I'm new at this programming stuff. Your thoughts and ideas are appreciated.
    Attached Images Attached Images

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Minimizing power use w/ 12f683

    I'm confused (imagine that-LOL). Are any LED's on during the idle time? When you say it appears dead, I assume you mean it won't respond to the switch. (of which I see nowhere in the program where it would)

    I think you need to configre it so either the switch causes an wake up interrupt, or put it to sleep for short periods then wake up and check the switch. maybe 1 ms nap (power nap?)

    Just my thoughts.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Minimizing power use w/ 12f683

    You've presumably seen this doc...

    http://ww1.microchip.com/downloads/e...hapter%202.pdf

  4. #4
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Minimizing power use w/ 12f683

    Well, yes, I do mean that while the program is in sleep or nap the system appears dead meaning the switch won't start the program. There are no LEDs lit during idle time. I've used gpio.3 by way of MCLR_OFF to trigger the start of the program. My concern with napping the program is a too short pressing of the button not starting the program. Then pressing the button again......

    Although I hadn't seen the documentation you hyper-linked, I was doing most of that. My circuit and program had no circuitry other than the pic being powered when the LEDs were not being sequenced. I was trying to find if there were any other fuses or whatever I could turn off to draw less power.

    One of the guys in my shop suggested a solution I hadn't thought to employ. I hooked the anode of a diode up to each gpio used for the LEDs and connected the ganged cathodes to a relay. I used the contacts of the relay to trigger not only the pic but actually turn on the whole circuit then added a pause at the end to allow the relay to deenergize and viola, I'm now pulling less than 1mA. I'm not real sure what is causing that current draw as everything is powered through the normally open contacts and only connected when the relay is energized. But that is all I had time for when work called and I had to quit working on this project.

    I'll get a circuit uploaded soon.

  5. #5
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Minimizing power use w/ 12f683

    If you think you draw a lot of power now, wait until you add a relay! If you were to go down that path, use FETs as switches, not relays as relays are serious power hogs.

    But there is a simpler way. Pin 5 (GP2/INT) can be configured to be an external interrupt. So rearrange your hardware to connect the switch there, then in your software, simply put the device to sleep, drawing nano-amps, until a switch transition generates an interrupt and wakes it up. Then run your routine and go back to sleep, waiting for the next interrupt.

    Details are in the datasheet.

  6. #6
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Minimizing power use w/ 12f683

    Thanks for the suggestion. I will try a FET. Although even with the relay the average power use is considerably decreased. The chip itself takes about 4 mA, the LEDs about 20mA (remember only one is lit at at time), and the relay another 20mA. This draw will be only for about 10 seconds maybe 6 times a day. Just running the chip without the relay, granted without sleep/nap or interrupt, all day long at 4 mA/24 hrs would be alot more power overall.

    As for rearranging and using a pin to create an interrup, well, I was trying to light 20 LEDs off one chip with as little extra stuff as possible. The only way that can be done is use all 5 I/O pins and make gpio.3 an input for the start of the program. It's somewhat shown here

    http://ww1.microchip.com/downloads/e...Doc/01146B.pdf

    If I'm missing something then please let me know.

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