Writing code for battery operated projects


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Jetpr,

    Thanks for the code you sent, I got it working good and I also managed to write some code using push buttons so I can set a reference to warn when the battery voltage drops to whatever level I want, that way if it works the way I envision it to work then I can use different battery combinations and just set my reference (dependent of pretty much any battery source) to sound an alarm when the batteries voltage drop to a certain level. I managed to find some 1% 10K resistors at my local electronics store and with your code it shows 6.5 volts with 4 fresh AA alkaline batteries, the actual voltage of the batteries is 6.43 volts using an old Micronta DMM to check them but I think that's ok. I connected a 5k pot to the ADC as well and it Max's at 10.0 volts and down to 0.0 volts, I'm hoping that's ok? This is my first time working on a project that uses batteries so it should be interesting. I have the reference push buttons code set up so I can set it to tenths of a volt, just like the code you sent me. I can't wait to get some good voltage regulators to try it out.

    Thanks man..........

    Issac wrote:
    Just a thought !
    When using the ACIN command for A/D conversion
    How is this turned off before going to sleep ?
    Does pbp automatically take care of it

    Hi Issac,

    What I did is to use ADCON1 = 7 statement to turn off the ADC then I set the ADC pin as an output and then set it low with PORTA.0 = 0, that seemed to work good. I noticed that I saved on my milliamp draw by setting the ADC pin low after shutting it off. Before I tried setting it low, the consumption didn't go below (if I remember correctly) about .068mA and would fluctuate (bouncing up and down) up to about.086mA. Then after I set it low it dropped to about .006mA minimum and fluctuates up to about .044 -.060mA and about every 4 or 5 seconds it jumps up to .104mA but just for a ever so brief time, so it did make a big difference forcing it low. To turn the ADC back on I just used Trisa.0 = 1 then ADCON1 = $0E or ADCON1 = 2 but that'll depend on which chip your using..........good thing for me they keep Archives! LOL

    Maybe someone could tell me if that's the proper way of doing it, I would imagine there is more than one way of doing it for sure. I just ordered some MIC2954, 250mA Low Dropout Voltage Regulators. The web site I ordered them from just listed them as MIC2954, I don't know if their MIC2954-02BZ or MIC2954-0B3Z or even what the difference is, I think maybe I read something about .5% and 1% but their suppose to be pretty good for battery operated micro's. I also read you have to play around with the capacitor values to get the minimum amp draw. It looks like their pin compatible with a 7805 in a TO-92 case. It says in the data sheet that (if I'm reading it properly) that it uses a low quiescent current (120mA typical) and that it will operate down to 2 volts and produce a 5 volts output? I'm not very good at reading data sheets, anyone here used these before with any success?

    Thanks jessey

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jessey
    It says in the data sheet that (if I'm reading it properly) that it uses a low quiescent current (120mA typical)
    you probably read correct but paste with error...120uA quiescent... wich is more suitable

    i've never use those but they looks good.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Writing good/proper code
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 22nd July 2009, 00:55
  2. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  5. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26

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