Minimize battery consumption on a 18F2550


Closed Thread
Results 1 to 26 of 26
  1. #1
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187

    Default Minimize battery consumption on a 18F2550

    Hi

    I´m trying to build a battery powered RF remotecontrol with 8 buttons and I want to use this as the hardware http://www.mikroe.com/startusb/pic/ (plus a voltage regulator and a RF transmitter module and some buttons of course)
    Everything is working fine but now I want to minimize the power consumption in the remote and I have try to do that in several ways

    * Lowering the internal oscillator value which works
    * Put the PIC into sleep mode and wake it from "PORTB change" when I press one of the 8 buttons, but that do only work on PORTB.4 to PORTB.7
    * Put the PIC into sleep and wake it by TMR1 every second or so to poll PORTB 0 - 7 and see if a button is being pressed but I can't get that to work either, I believe I have to use an extra external oscillator for TMR1 to do that, right?

    The PIC on the board i a 18F2550 and I don´t use the USB part on it.

    Anyone having any tips of what I can do to reduce the power consumption more with that hardware?
    And one more question, when i put the PIC into sleep it consume about 3mA and I believe that it could be lowered in some way, but I have not been able figured out that yet.


    (English is not my primary language so I hope you have forgiveness with that)

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    First thing is to go through the datasheet and disable as many features as you can. That should save energy.

    I have no experience with sleep feature.

    Robert

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    I can suggest to switch off everything when not used, so you will have no power drain. When you press any button to activate the proper command, you will switch on the system via a small fet activated with an array of diodes so that any button will switch on the fet. Your pic as activated will retain the fet on for all the time necessary to process the comand then it will switch off the fet again.

    Cheers

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Here is a thread on the subject: http://www.picbasic.co.uk/forum/showthread.php?t=6134

    I liked the idea (coolness factor) of a "touch sensitive" case...

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    BTW. If you're not using the USB part of the Mikro board, you can save most of the $26 ($17.10 plus $9) and make a smaller board if you build the whole thing on stripe board. Also, you might find it easier to mount the RF module securely. Just a thought, although perhaps the convenience is worth it to you.

  6. #6
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Thank you for your replay.

    How do I do that and what parts do I need?
    Do you have an example or schematic?

    Quote Originally Posted by aratti View Post
    I can suggest to switch off everything when not used, so you will have no power drain. When you press any button to activate the proper command, you will switch on the system via a small fet activated with an array of diodes so that any button will switch on the fet. Your pic as activated will retain the fet on for all the time necessary to process the comand then it will switch off the fet again.

    Cheers

    Al.

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Something like this should be a good starting point.

    Cheers

    Al.
    Attached Images Attached Images  
    Last edited by aratti; - 25th June 2014 at 11:31.
    All progress began with an idea

  8. #8
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Thanx
    Can it also be done with a N-ch FET like the 2N7000 in some way?

  9. #9
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Will this schematic work?

    When u press a button the FET will switch on the 7805 and the PIC, and then I hold RA4 low as long I want the PIC to run.
    The +BATT terminal is from a 9V battery and the datasheet says that RA4 can handle up to 14 volts if I have understand it right, so 9V on RA4 will be OK?
    Attached Images Attached Images  

  10. #10
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    It wont work. Because if PIC doesn't have power supply, current still can be drown from pin, and that will be probably enough to turn on fet. Even if RA4 is open drain, you can put more than VDD+0.6 on that pin. If you do this, you will damage input buffer.
    So you need to to put transistor to bring down gate. Depending on P FET you use and battery voltage, maybe you need to put another resistor to create voltage divider for gate.
    EDIT:
    Name:  Untitled.png
Views: 750
Size:  2.1 KB
    Last edited by pedja089; - 28th June 2014 at 18:13.

  11. #11
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Using a voltage regulator introduce some complication. You will feed 9 volts to your inputs and this will demage your pic. You need to isolate in same way your pic (both input and output) see the attached suggestion. (remember that all the input must be pulled up)

    Cheers

    Al.
    Attached Images Attached Images  
    All progress began with an idea

  12. #12
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Will this work then?
    PORTB are using internal weak-pullups, and I keep RA0 high as long as I want the PIC to run.
    Attached Images Attached Images  

  13. #13
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    When the push button is open you feed 9 volts to the pic input. Place a diode on each input to stop this current flow.

    Cheers

    Al.
    All progress began with an idea

  14. #14
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Does it look ok now?
    I assume the standby current now will be 0uA when no button is pressed and the RA0 is not high?
    Attached Images Attached Images  

  15. #15


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Name:  power supply1.JPG
Views: 762
Size:  65.6 KB

    the input to pic pins (9 volt) is limited by the 100K r and those pins should have redirect diodes (inside pic) that protects pic from overvoltage.
    The opto will shutdown power or the r-c on fet gate can be made to time out (any time you set) but the power to pic then just reduces slowerly? ,,,but the brownout setting also will shut down pic before too low voltage makes program unfunctional ..
    don

  16. #16
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    With reference to your schematic of post #14, please note that if you can find a switch with two contacts (common; No & Nc) then connecting the common to ground and the Nc to pic input and No to the gate of Pchan mosfet you can eliminate all the diodes.

    All you need now is to assemble the circuit on a proto-board and see if it works.

    Cheers

    Al.
    Last edited by aratti; - 29th June 2014 at 06:53.
    All progress began with an idea

  17. #17
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    The datasheet says this
    Absolute Maximum Ratings
    Voltage on MCLR and RA4 with respect to VSS .................................................. ..........................................-0.3 to +14V
    Voltage on all other pins with respect to VSS .................................................. ..................................-0.3V to VDD + 0.3V
    Does that mean that I can feed +9 into RA4?
    And if not why should this be avoided?

  18. #18


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Name:  pins.JPG
Views: 815
Size:  69.3 KB
    from the data sheet for 18f2550. the diode pointing to vcc holds the voltage at the pin to 5 volts (or the supply voltage) as long as the current is under max-rating, generally 25ma. So limiting current way below that is safe operation. Your 78xx volt reg will keep the vcc voltage to the 5 volts.
    Name:  pins2.JPG
Views: 795
Size:  84.4 KB
    data sheet from 16f device shows the diodes in the pin input.
    don

  19. #19
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Quote Originally Posted by Fredrick View Post
    The datasheet says this
    ...
    Does that mean that I can feed +9 into RA4?
    And if not why should this be avoided?

    Absolute maximum
    means it's the limit, at your own risk, no guarantees. Avoid unless you like magic smoke tricks.

    Check the other section where it says recommended or something (can't remember exact words), but it'll most likely have a range of 0 to 5 volts or so.

    Robert


    Edit: check up voltage dividers.

  20. #20
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Quote Originally Posted by Fredrick View Post
    Hi
    Anyone having any tips of what I can do to reduce the power consumption more with that hardware?
    And one more question, when i put the PIC into sleep it consume about 3mA and I believe that it could be lowered in some way, but I have not been able figured out that yet.
    I will advise you to use the sleep mode exclusively without any modifications to the existing hardware. To use this board, you need to
    Code:
    1.  configure your 8 keys as a 4x2 matrix using RB4..7 (IOC pins) and any other 2 lines.
    2.  Set 4 matrix lines RB4..7 high and program for interrupt on change
    3.  Set the other 2 matrix lines low
    4.  Now, clear the IOC interrupt and sleep (GIE, RBIE).  You do not need to have an ISR for this to work
    5.      When a key is pressed, the IOC interrupt will put the MCU out of sleep and continue after the sleep command Clear INTCON
    6.      Turn both matrix lines which were low to high and scan which key is pressed
    7.      Do remote transmit function
    8.      Back to 3
    To get the lowest current draw in sleep, you need to disable all functions that you will not use on the chip. I am too lazy to look it up now, but, if you don't need the feature, disable it to save current. Remove the power led LD1; that wastes power all the time. Before sleep, turn off LD2 and LD3 to minimize current wastage.

    Your typical sleep state current should be in the order of 20-100uAmps. Anything more and you can be sure something is draining the current somewhere; double check.

    I have used similar tricks and get close to the shelf life of the batteries in my product; so, go ahead and give it a try.

  21. #21


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    what about the voltage regulator current drain (quiescent current) a little high for 78XX regulators ???
    don

  22. #22
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    I changed my mind and I will not use the PICstart board anymore, I will do all on a protoboard.

  23. #23
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    The schematic almost works, but I had to change the D and S on the P channel FET. (see the attachment)
    Can someone explain for me how the D and S should be connected for a N and P channel FET?

    The P channel FET is a BS250P and the N channel is a 2N7000.
    Attached Images Attached Images  

  24. #24
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    N Fet- Source to ground
    If gate is on higher potential then source, transistor is turned on.
    0V or negative voltage on gate, then transistor is off.
    P Fet -Sourse to positive supply.
    If gate and source are on same potential, then transistor is off. If gate is on lower potential than source then transistor is turned on.

  25. #25
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    So a N-channel FET should always have the S connected to the ground and the P-channel should always have the S connected to the positive supply?

  26. #26
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Minimize battery consumption on a 18F2550

    Yes, you are right.

Similar Threads

  1. Replies: 13
    Last Post: - 22nd January 2012, 04:48
  2. Fuel consumption display
    By veijavi in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 27th December 2011, 06:05
  3. Gasoline consumption Math
    By srspinho in forum General
    Replies: 5
    Last Post: - 12th November 2007, 10:21
  4. 12F683 battery powered remote - energy consumption question
    By silentwol in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th April 2007, 13:23
  5. low power consumption
    By taos in forum General
    Replies: 0
    Last Post: - 26th February 2006, 08:33

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