PDA

View Full Version : PIC self supply measurement



rc-pilot-freak
- 24th November 2006, 20:36
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????

Archangel
- 24th November 2006, 23:21
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.


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

dhouston
- 24th November 2006, 23:26
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.

mister_e
- 24th November 2006, 23:36
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?

Joe Rocci
- 28th November 2006, 19:32
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

rc-pilot-freak
- 28th November 2006, 20:06
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.

Acetronics2
- 28th November 2006, 20:22
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

rc-pilot-freak
- 28th November 2006, 20:39
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?

Joe Rocci
- 29th November 2006, 00:18
What is the part number of the FET you're using?

sayzer
- 29th November 2006, 05:00
...

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).

-------------------------------------------------

Acetronics2
- 29th November 2006, 08:35
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 !!!