PDA

View Full Version : Solved How long can a Propeller Protoboard operate on a 9 volt PP3 battery?



ElectricAye
04-07-2012, 11:30 PM
I can't make sense of what the Propeller data sheet has to say about power consumption for the Propeller, so I thought I'd ask for a ballpark estimate here.

I want to run a Propeller Protoboard in a repeat loop and provide a single PWM signal at roughly 500 Hz, ~5 % duty cycle.
The PWM signal drives an application that uses very little power, so that part of it is not a concern. I would like to know approximately how long a Protoboard will last on a 9 volt PP3 battery.
Hours? Days? Months? Right now I haven't got a clue.

I know some other microprocessors urge people not to use such batteries, but I've seen the 9 volt battery connectors on some other Propeller boards, so I thought I had better ask.

Thanks.

Leon
04-07-2012, 11:34 PM
It all depends on the clock rate and what the PWM is driving. If you measure the current, you should be able to estimate the battery life.

I wouldn't use a PP3 battery on a chip like the Propeller.

cavelamb
04-07-2012, 11:37 PM
How about a 6 volt lantern battery?
I'd guess several weeks at least.

ElectricAye
04-07-2012, 11:37 PM
It all depends on the clock rate and what the PWM is driving....

I guess I was going to use the 80 MHz clock rate. The PWM is driving the gate of an IRF3708 Mosfet.

Thanks, Leon. I'll put you down as a NO vote for the PP3's.


How about a 6 volt lantern battery?
I'd guess several weeks at least.

A lantern battery would be nice, but I'm told to make this as compact and lightweight as possible.

Mike Green
04-07-2012, 11:57 PM
A standard PP3 9V battery (http://en.wikipedia.org/wiki/Nine-volt_battery) has a capacity of about 500mAh. A Propeller chip with a single cog running at 80MHz draws (as shown on the datasheet graphs) roughly 10mA. 500mAh / 10mA = 50 hours. Depending on how you implement the program, you could cut the current consumption. The more time your program spends waiting using WAITCNTs, the lower the average power drain. You'll gain a lot more power conservation by cutting the clock speed. With a 500Hz PWM output, you could easily use a 5 or 10MHz clock (PLL1X or PLL2X) if you use the cog counters to generate the PWM and the cog itself is mostly idle (using WAITCNTs). Your current consumption could be well under 1mA.

Do remember that, if you drive the FET directly, it won't switch as completely with the 3V gate voltage as you might hope and there'll be a lot of power used to charge up the substantial gate capacitance. You could use a gate driver, but that'll increase the power requirement.

ElectricAye
04-08-2012, 12:20 AM
...A Propeller chip with a single cog running at 80MHz draws (as shown on the datasheet graphs) roughly 10mA. 500mAh / 10mA = 50 hours. Depending on how you implement the program, you could cut the current consumption. ....

Thanks, Mike, for providing a clue to the current consumption and for breaking down how to reduce it. Alas, it looks like the reality of the PP3 capacity is something I can't escape. I think I'll have to look into redesigning this to work with AA batteries. It's not the end of the world, I guess. Normally I work in a lab where I never worry about power consumption, so this portability issue is alien territory for me.

Leon
04-08-2012, 12:27 AM
You could always use a different chip, with lower power requirements, such as an XLP PIC, or an MSP430.

potatohead
04-08-2012, 12:41 AM
What about rechargables? Or, just get the AAA -> 9V adapter assembly.

I frequently will run on 9V batteries, just for on the go. Rechargables work well, and the 50 hour metric Mike cited rings true. I get somewhere south of that on my Demo board or HYBRID board (coley's great prop I board.) That's doing video related things, and some audio / sound.

Dr_Acula
04-08-2012, 01:27 AM
Re Mike Green's calculation of 50 hours, you might be able to get 2.5 times that by using a switching regulator to drop the 9V to 3V. It is just one inductor, one diode and one 8 pin chip (LM2574). The propeller will be drawing 10mA but with the magic of switchers, the battery will only be supplying about 3.5mA.

Mike Green
04-08-2012, 01:28 AM
The Propeller is capable of running with very low power consumption. It's very important to keep the clock speed as low as possible for the task at hand and to shut off as much of the chip as possible for as long as is possible with things like WAITPxx and WAITCNTs, then speeding up the clock when necessary and using whatever resources (cogs) that might be needed. A number of forum members have made battery operated devices that run for long periods of time.

Leon is correct that you can get very low power microcontrollers quite cheaply, but you can go much further with the Propeller than you might think.

Duane C. Johnson
04-08-2012, 01:35 AM
Hi ElectricAye;

I have to ask, are you going to do any other functions other than the 500Hz PWM signal?

Duane J

ElectricAye
04-08-2012, 01:37 AM
The Propeller is capable of running with very low power consumption. It's very important to keep the clock speed as low as possible for the task at hand and to shut off as much of the chip as possible for as long as is possible with things like WAITPxx and WAITCNTs, then speeding up the clock when necessary and using whatever resources (cogs) that might be needed. A number of forum members have made battery operated devices that run for long periods of time.

Leon is correct that you can get very low power microcontrollers quite cheaply, but you can go much further with the Propeller than you might think.

Okay, I think I'm beginning to get a better feeling about this. I was just looking at an old post of yours that woke me up to the possibility of using the low speed clock until the Prop chip needed to wake up and use its 80MHz capabilities:

Quoted from here: http://forums.parallax.com/showthread.php?117006-Basic-Info&p=850393&viewfull=1#post850393

...The Propeller has a wide range of power requirements and can adjust its clock frequency from 20KHz (built-in slow clock) to 80MHz with a corresponding range of power requirements. The Propeller datasheet has detailed information on the power requirements and how they vary with the clock frequency and how many cogs are running. Active cogs can be paused for either specified periods of time or waiting for some external event to occur (a specific set of I/O pin states). The minimum supply current at 20KHz with one cog active looks like it's less than the NAP or SLEEP current of the BS2pe....

ElectricAye
04-08-2012, 01:45 AM
Hi ElectricAye;

I have to ask, are you going to do any other functions other than the 500Hz PWM signal?

Duane J

The Prop will be waiting for an optical pulse train which will be its summons to activate the PWM signal. So basically the Prop's only function would be to sit around doing nothing but waiting for that pulse train, after which it will activate a single pin with PWM, allow the PWM to go on for a few seconds, then shut down the PWM and sit around waiting until its next summons. I'm sure the Prop chip is overkill on this application but it's what I'm familiar with. I'm sure Leon is correct about other chips using less power, but at this stage I just want to prove the concept, and The Prop and the Basic Stamp are the only chips I (sorta) know.

ElectricAye
04-08-2012, 01:50 AM
You could always use a different chip, with lower power requirements, such as an XLP PIC, or an MSP430.

Shhhhhh.... I don't think we're supposed to talk about things like that.



What about rechargables? Or, just get the AAA -> 9V adapter assembly.....

Yes, I might have to look at something like that, even with Mike's ideas of using the slower, lower-power clock activity.



...The propeller will be drawing 10mA but with the magic of switchers, the battery will only be supplying about 3.5mA.

Interesting. It does sound like magic! You sure that's legal?

Dr_Acula
04-08-2012, 02:06 AM
Interesting. It does sound like magic! You sure that's legal?

No, no whacky zero-point-energy perpetual motion going on here. Just standard physics.

10V at 1A is the same energy as 1V at 10A (10 watts). Switching regulators convert one to the other.But there is a loss of energy of maybe 10 or 15% each time you do a conversion.

It means you don't have to worry about the volts so much. So with linear regulators, say you ran it off a 9V battery and the propeller drew 10mA at 3V, the battery would supply 10mA.

The ratio gets even better when you use more batteries. eg Use two batteries = 18V and linear regulators and the battery still has to supply 10mA. With a 3V chip and 18V on the batteries, 5/6th of the energy is actually being wasted in the regulator.

But with switchers, 18V to 3V is a 6:1 ratio. Current is 1/6th, ie 1.66mA being supplied. And then multiply by 100/85 for losses so it is more like 1.96mA. That compares very nicely with 10mA.

Another nice thing about switchers is that you get more energy out of the battery. If your 9V battery is down to 5V most people would consider that flat, but with a switcher it will keep running till it gets down to about 4V.

And there is an even better bonus - because switching regulators convert energy they hardly get warm, so you don't need lots of space on a board for heatsinking. That saves money and is about equal to the extra cost of a switcher. So the cost ends up about the same as a linear regulator.

ElectricAye
04-08-2012, 02:59 AM
...

Another nice thing about switchers is that you get more energy out of the battery. If your 9V battery is down to 5V most people would consider that flat, but with a switcher it will keep running till it gets down to about 4V.....

Cool. Thanks for the detailed explanation. Might there be a specific manufacturer and/or part number you can suggest for Prop-related applications? I keep hearing about these switchers but have never played with one.

Thanks, you guys!

Tracy Allen
04-08-2012, 05:15 AM
The protoboard #32212 has two LM1086 regulators on board to provide the 5.0V and 3.3V supplies. Each of those regulators draws around 5mA to 10mA of quiescent current even when the propeller is shut down. Rather power hungry! To get to the lowest possible current from the system, those regulators have to be sidetracked and replaced with others in the micropower catagory.

That done, here is the graph from the prop data sheet.
91472
Find 5MHz over near the left end. Suppose your system waits with a
waitpeq for that optical stimulus. It then comes to life and fires up a counter module with a tuning word of 429497 to generate the PWM, goes into a waitcnt for the required time interval, and then stops the counter, and goes back to waiting for the next optical stimulus. Practically all its time is spent in waitxxx, in which case the graph suggests around 100 ľA at clkfreq=5MHz. That is approaching the BASIC Stamp sleep current (~30ľA). . Maybe that oversimplifies the task? There may be more precision or more processing required?

The next step down in power consumption would have the system operating most of the time at clkfreq=20kHz. In that state it can still be "executing" a waitpeq, waiting for the optical pulse, and then drop through to a clkset command to reactivate up to 5MHz. It takes about 10 ms to bring the crystal up to speed and then start the counter module to generate 500Hz for the required time, and then drop back to 20kHz. The down time current drain then will be on the order of 10 or 20 ľA, better than the Stamp, and it will still be monitoring the pin in that state. Can the app tolerate the 10mS latency? The power supply has to be chosen carefully to match. Either run it off off something like a 3V primary cell, or use a super low Iq regulator, such as the MCP1700.

At 50ľA average drain, a 500mAh battery has 10000 hours of life, over a year.

cavelamb
04-08-2012, 05:19 AM
I guess I was going to use the 80 MHz clock rate. The PWM is driving the gate of an IRF3708 Mosfet.

Thanks, Leon. I'll put you down as a NO vote for the PP3's.



A lantern battery would be nice, but I'm told to make this as compact and lightweight as possible.

Ok, I've run my QuickStart board (doing a lot of LED action) for a week on 4 AA cells....

Does that help?

ElectricAye
04-08-2012, 05:47 AM
.... Suppose your system waits with a waitpeq for that optical stimulus. ..... Can the app tolerate the 10mS latency? ...
At 50ľA average drain, a 500mAh battery has 10000 hours of life, over a year.

Tracy, your detailed explanation is truly amazing! Indeed, this application could easily tolerate a 10mS latency, etc. I'm inspired by your analysis of this. Because the PWM need only come alive a few seconds every few hours, this might be just the sort of thing I was hoping for. I need to study how the chip behaves at clkfreq=20kHz, how the counters work at such a low frequency, etc. but it seems to me that this ability to downshift power consumption via these clock changes might make the Prop even more attractive than a smaller chip that does not possess such a capability.

Many thanks for taking the time to spell this out for me!



Ok, I've run my QuickStart board (doing a lot of LED action) for a week on 4 AA cells....

Does that help?

It sure does help. It's always nice to hear some real world examples of the performance people get from these things. I've run Props on batteries before but never to the point where the batteries go dead. Thanks!

pedward
04-08-2012, 06:02 AM
I will second the recommendation to run at a low clock speed. You are doing something that is super trivial, I don't see why you couldn't run 12Khz or 20Mhz using the RCSLOW and RCFAST clocks. At worst, you could put a slow crystal on it if you need the precision of it.

A 32768Hz crystal is easy to find, and you can X16 that for 524288Hz, or about ~524Khz. That would give you 128KIPS worth of processing power, which in PASM is better than what SPIN can usually do IIRC.

pedward
04-08-2012, 06:04 AM
Oh, one more thing, if you want to try a Motorola 68HC908QT4, I have a bunch, it's an 8 pin HC08 micro that runs at ~3.4Mhz and has flash on chip, timers, etc.

ElectricAye
04-08-2012, 06:10 AM
... I don't see why you couldn't run 12Khz or 20Mhz using the RCSLOW and RCFAST clocks. At worst, you could put a slow crystal on it if you need the precision of it.....

Yes, I think that's the way to go. The "pulse train" that is supposed to wake up the Prop could be something as simple as a bright flash of IR light, so I could probably use the WAITPEQ that people have already suggested, so no precision is necessary. The more I think about this, the more I like it.

ElectricAye
04-08-2012, 06:15 AM
Oh, one more thing, if you want to try a Motorola 68HC908QT4, I have a bunch, it's an 8 pin HC08 micro that runs at ~3.4Mhz and has flash on chip, timers, etc.

I appreciate the offer, but I'm an old dog that has a hard time learning new tricks. In fact that's why I had originally agonized over this power consumption problem: I was afraid somebody was going to prod me to learn some other chip just because I couldn't find a way to get the Prop to play Power Consumption Limbo. Now, thanks to all the fine people who've responded to my yelps for help, the old dog has a bone of hope.

Dr_Acula
04-08-2012, 06:28 AM
but I'm an old dog that has a hard time learning new tricks.

Yes, I agree. It took me ages to make the jump. But when I found how easy they were I had a hard time coming to grips with the idea that a regulator is an 8 pin DIP chip rather than something with a big heatsink on it. They come as surface mount too.

Thanks++ to the clever boffins at National Semiconductor.

Battery power is expensive, and IMHO the worst thing you can do with battery energy is waste it as heat!



Might there be a specific manufacturer and/or part number you can suggest for Prop-related applications? I keep hearing about these switchers but have never played with one.

9147691477

Schematic also shows 0.1uF caps for other IC chips. The minimum circuit requirement for capacitors is just an input and output capacitor and you need them anyway for linear regulators.

I get these from futurlec

http://www.futurlec.com/Linear/LM2574N-3pr.shtml datasheet http://www.futurlec.com/Linear/LM2574HVN.shtml

http://www.futurlec.com/Power_Inductors.shtml and get the 330uH one (needs to be a power inductor so at least 500mA current, not the small RF inductors)

http://www.futurlec.com/Diodes/1N5819pr.shtml for the diode.

Other suppliers have these too.

ElectricAye
04-08-2012, 06:57 AM
...

Battery power is expensive, and IMHO the worst thing you can do with battery energy is waste it as heat!....

Fascinating. I'll definitely take a look at these. Thanks for the links!

photomankc
04-08-2012, 04:36 PM
Look carefully though at the queiscent current. Unless I missunderstand it you are looking at, in the above example, 5mA of current consumption just to have the switcher running. That current draw is inescapable with the device unless it is shutdown via it's on-off pin which gets you down into the mircoamp territory.

IQ Quiescent Current (Note 6) 5 mA 10 mA(Max)
ISTBY Standby Quiescent ON /OFF Pin= 5V (OFF) 50 μA 200 μA(Max)

The regulator there is using as much as a cog at 80MHz. That was the hard part of my old battery project; finding a regulator that didn't swamp out the savings I could get in running at lower frequencies. I'll have to go back and look again to see if I still have part numbers but I think I found a real nice one that handled the 3.3V side and used shutdown on the 5V part to knock it out of the equation when not in use.

cavelamb
04-08-2012, 05:01 PM
It sure does help. It's always nice to hear some real world examples of the performance people get from these things. I've run Props on batteries before but never to the point where the batteries go dead. Thanks!

It's not as flagrantly wasteful of batteries as it may have sounded...
And the run time would probably have been a lot longer on those batteries too.

They were first run through my Sony FinePix camera to the point that the
camera thought they were dead. THEN loaded into the battery pack for the Propeller
and ran a week.

I have the numbers in my notes somewhere (all are still packed up from our move though).
Come to think of it, I may have posted them in another thread?
Hold on a sec...
Yep.

"My Quickstart board has been running off of 4 AA cells.
I took the batteries out of my camera when the camera wouldn't run any more.
They showed 1.35 volts then.

They ran the QS for a nearly a month before they were too low to keep it going.
When I took them out they showed .95 .96 .97 and .98 volts respectively, or 3.86 total."

The last set I let run LED Pong 24/7. That's quite a bit of LED action.
The batteries lasted about a week.

The QuickStart board normally runs off of the USB cable, but has a pin on the header
for battery inout.

Tracy Allen
04-08-2012, 05:25 PM
While switchers are great, they are not generally suitable for nanopower. There is the factor of quiescent current, just as there is with a linear regulator, and there are additional factors such as minimum load, and efficiency curves. They are optimized for performance near their rated current (0.5 A for the LM2574, and 5 mA quiescent current at zero load, same as the LM1086)

Here are efficiency curves for the LT3470, which is designed specifically as a micropower buck regulator.
91488
You see, with a load current of 100ľA and an input supply of 9V, the efficiency drops below 50%. Still not bad. The zero-load quiescent current is 25ľA from the battery no matter what the input voltage. It achieves that by entering "burst mode" at low currents, where it turns on in bursts to keep the output filter capacitor charged within bounds, and it operates continuously to reach its 200mA top current when called for.

The Prop with a 5MHz clock and sitting in a waitxxx draws about 100ľA, so the total current from a 9V battery with an LT3470 to supply 3.3V at 50% efficiency would be about
25ľA + 100ľA * 0.5 = 75 ľA
25ľA + (100ľA * (3.3V/9V) / .5) = 98 ľA

Compare that with an MCP1702 linear regulator with 2ľA quiescent current, plus a Prop drawing 100ľA, and the total battery current is 102ľA. Or take the clock down to 20kHz, RCslow, the total current with an MCP1702 or with a 3V primary lithium battery can be well under 10ľA, which is lower than the quiescent current of even the LT3470.

Ron Czapala
04-08-2012, 09:26 PM
Yes, I agree. It took me ages to make the jump. But when I found how easy they were I had a hard time coming to grips with the idea that a regulator is an 8 pin DIP chip rather than something with a big heatsink on it. They come as surface mount too.

Thanks++ to the clever boffins at National Semiconductor.

Battery power is expensive, and IMHO the worst thing you can do with battery energy is waste it as heat!

Schematic also shows 0.1uF caps for other IC chips. The minimum circuit requirement for capacitors is just an input and output capacitor and you need them anyway for linear regulators.

I get these from futurlec

http://www.futurlec.com/Linear/LM2574N-3pr.shtml datasheet http://www.futurlec.com/Linear/LM2574HVN.shtml

http://www.futurlec.com/Power_Inductors.shtml and get the 330uH one (needs to be a power inductor so at least 500mA current, not the small RF inductors)

http://www.futurlec.com/Diodes/1N5819pr.shtml for the diode.

Other suppliers have these too.

I found these at DigiKey - I guess the .73A inductor is sufficient??

INDUCTOR RADIAL 330UH 0.73A (http://parts.digikey.com/1/parts/1591963-inductor-radial-330uh-0-73a-18r334c.html) $1.42
LM2574N-3.3GOS-ND (http://search.digikey.com/us/en/products/LM2574N-3.3G/LM2574N-3.3GOS-ND/1476674) $1.78

max72
04-08-2012, 10:09 PM
I'm doing some tests for a GSM based project. The 1700 series is a very nice option. In my case the GSM module is perfectly matched to a Li-ion battery.
The module would send a SMS every few hours, so idle current is the key factor. I have no problems on wake up, i simply go to RCslow and accept the clock errors.
I started with a switching regulator, but idle current is too high. The 1700 requires two 2uF caps, but accepts a low input voltage. In this case 9V would be too high, and useless, being a linear regulator. A protected Li-ion like the ones sold by Parallax could be a nice option.
Massimo