PIC self supply measurement


Closed Thread
Results 1 to 11 of 11
  1. #1
    rc-pilot-freak's Avatar
    rc-pilot-freak Guest

    Default PIC self supply measurement

    I am building a PIC circuit that is driving a Mosfet. PIC is powered with 4 battery cells that swing from 5.4V to 4.6V (it goes lower but for me thats the lowest).

    The PIC is regulated with LM2940CT-5.0V

    I would like among other things that my PIC monitors his supply. If the voltage drops bellow 4.6V it should sound the buzzer (portb.2 = high).

    On a Vref pin a put a LM336-2.5V reference diode:

    5V-----R1(2.5k)-----o------- Vref input
    I
    I
    LM336 diode
    I
    I
    ground

    So the Vref is 2.5V when the supply is over or exactly 5V (on PIC is always 5V).

    Will I be able to read the correct voltage when it drops to 4.6V ?????? I don't think so. I can't change to 3.3V LDO since i need more than 4.5V to drive Logic Level Mosfet.

    What can I do????

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Lots of things

    Quote Originally Posted by rc-pilot-freak
    I am building a PIC circuit that is driving a Mosfet. PIC is powered with 4 battery cells that swing from 5.4V to 4.6V (it goes lower but for me thats the lowest).

    The PIC is regulated with LM2940CT-5.0V

    I would like among other things that my PIC monitors his supply. If the voltage drops bellow 4.6V it should sound the buzzer (portb.2 = high).

    On a Vref pin a put a LM336-2.5V reference diode:

    5V-----R1(2.5k)-----o------- Vref input
    I
    I
    LM336 diode
    I
    I
    ground

    So the Vref is 2.5V when the supply is over or exactly 5V (on PIC is always 5V).

    Will I be able to read the correct voltage when it drops to 4.6V ?????? I don't think so. I can't change to 3.3V LDO since i need more than 4.5V to drive Logic Level Mosfet.

    What can I do????
    I have to ask first if weight is a factor. there are a zillion things you can do, unless weight is a huge factor. I will give some examples.
    Code:
    1. make a charge pump to supply a drive voltage for the MOSFET.
    2. use analog device to monitor battery(an LM3914} or dozens of others
    3. Use higher voltage power supply, more batteries
    4 include a MOSFET driver IC. some of these I believe have a charge pump others like the irf4227 do not.
    5. Use a low voltage micro isolated from Mosfet with opto coupler and run
    MOSFET and trigger from unregulated supply (higher voltage).
    Just some ideas, I hope they help.
    JS

  3. #3
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    What I've done is power a LP2980-4.5 LDO regulator from a PIC pin and read its output with an ADC pin. As long as the PIC supply is >4.5 the ADC reading is less than MAX. Once the PIC supply drops to 4.5 or lower the ADC reading is MAX.

    I use this with BR type coin cells, which have a fairly flat discharge curve and then drop rapidly, to signal when the batteries need replacing.

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


    Did you find this post helpful? Yes | No

    Default

    If you meant 'I want to monitor the Battery voltage' it will never work @4.6V

    If you meant 'i want to monitor the PIC 5Volts rail' you MUST have a accurate and stable ref point somewhere. Zener will work but need too much current, voltage reference are great.

    But there's certainely something i miss here. Usually i'll monitor the PSU before the regulator with high value resistor R2R network. The internal comparator allow that.

    Something to try i guess Mr tomskk?
    Steve

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

  5. #5
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    rc-pilot-freak:

    I think you're saying your're going to reference tha A-D to a stable and accurate 2.5V source (the reference diode). If that's the case, your A-D input range will be 0 to 2.5V. If you put a simple voltage divider at the battery, designed so that the max battery voltage is divided down to 2.5 volts, you should be OK

    Joe

  6. #6
    rc-pilot-freak's Avatar
    rc-pilot-freak Guest


    Did you find this post helpful? Yes | No

    Default

    No and yes. But I solved the problem. Since my supply is going to be above 5V (which is always regulated through the 5V LDO) i will get 5V on PIC. But when my supply drops under 5V and keeps droping as the battery supply runs out, i need stable refernece on PIC's Vref pin.

    I've done this with LM336-2.5V reference diode.

    So all the time I know that the reference is 2.5V even if the supply voltage changes. Now i can do an A/D to measure the supply voltage.

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking Think simple !!!!

    Hi,

    For My R/C systems, I only need to know if batt is under 4v4 ...

    at 4.65v, there's the MC33064P5 from motorola ( µChip equivalents exist ...)

    It's a TO92 case ... and output is open collector, low for lowbatt.

    The MC 33164P5 ... has a 4.3v trip point.

    Moreover you can add as much hysteresis as you want adding a couple of resistors

    sooooooo simple to check a low input state ... rather than use an ADC !!!

    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 " !!!
    *****************************************

  8. #8
    rc-pilot-freak's Avatar
    rc-pilot-freak Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Acetronics for pointing that chip to me. It is very usefull in battery supplied circuit. I will order my self a few pieces to test with.

    Now i'm stuck at a different problem.

    I was using the PWM interrupt routine from Curtis Parrott, which he published here, to drive the Mosfet (the load needs 4Amps at 1.3Volts). http://www.picbasic.org/forum/showthread.php?t=5316

    When I raise the voltage to 2.6V the mosfet starts heating very quickly. I don't know where the problem is. Am I using to high frequency?

  9. #9
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    What is the part number of the FET you're using?

  10. #10
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rc-pilot-freak
    ...

    When I raise the voltage to 2.6V the mosfet starts heating very quickly. ...

    Why don't you post the schematic?

    Let us see how you drive the Mosfet(s).

    -------------------------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking Was it a Glow heather ????

    Quote Originally Posted by rc-pilot-freak
    I was using the PWM interrupt routine from Curtis Parrott, which he published here, to drive the Mosfet (the load needs 4Amps at 1.3Volts). http://www.picbasic.org/forum/showthread.php?t=5316

    Buuuuuut, it's the OTHER Forum ... isn't it ???

    When I raise the voltage to 2.6V the mosfet starts heating very quickly. I don't know where the problem is. Am I using to high frequency?
    P= U^2 / Z ...

    You just have to dissipate 4 Times than with 1.3v !!! ... if the load is unchanged.

    the IRFZ is given for 18 mOhms,

    18E-3*4*4 = .3 watts

    18E-3*8*8 = 1.15 watts ... @62.5°C/W ... 72°C Temp Raise

    Your fingertip is burnt !!!

    That's for continuous conduction ...


    With PWM, you have to charge and discharge 1.5nF @ your PWM rate ...

    first verify if it is possible from the Pic pin ... unless the Mosfet won't "saturate" and ... overheats.

    Second, verify switching conditions with the calculator you will find on ... the Web (I do not remember !!! , but it's one of the greatests Mosfets manufacturer's site )

    Alain

    Now, using Power switching close to R/C systems ....especially aboard planes ... looks like "Kamikaze" Philosophy.

    my opinion ... widely shared in the National Scale Team !!!
    Last edited by Acetronics2; - 29th November 2006 at 08:40.
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. Switch mode power supply Pic Micro
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th July 2009, 13:11
  2. PIC backup power supply: switchover ???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 18th April 2008, 17:05
  3. Decent 24 volt Pic power supply
    By rwskinner in forum Schematics
    Replies: 7
    Last Post: - 18th December 2006, 12:27
  4. backup supply for pic
    By PoTeToJB in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th May 2006, 17:24
  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