08M power consumption and supply question

oKors

New Member
I have a small project using an 08M chip and a PIR. The PIR requires 4-15vdc while the chip obvously takes 5v.

I'd like to power both devices with a common source and my plan was to use two 3.0v coin-cell batteries (cr2025) in a double stack holder along with the 8-pin proto kit (sans the battery leads).

The unit will be left outdoors unattended and I'd like it to run for many many months before the batteries need changing.

My question(s):
1) obviously the 6v supply will kill the chip so I'm looking at this MCP1700 voltage regulator. Is there any reason why this regulator could be insufficient to drive both devices?

2) how long will the chip run (approx) from this power source? The PIR is passive and sec sheets say it pulls a measily 45uA average. So i imagine alone without the chip sipping power it would run for a really long time.

Not sure if it matters but the code is only 10 or 12 lines and uses only 1 input and 1 output; the output goes to a self-powered totalizer. I may incorporate a micro LED on the output also but that's not necessary since the whole thing will be inclosed and the LED would be redundant anyway.
 

eclectic

Moderator
Well, first thoughts:
the 2025 capacity is listed as 150 mAH

So, use Ohm's law and start from there.

Then, can you provide a circuit and your code.

e
 

oKors

New Member
I guess the bulk of my question is what a chip consumes by itself just powered on and running.

I'm at work and dont have a copy of the code. The circuit I'm still working on, just not sure what to power it with once I get it off the breadboard.
 

John West

Senior Member
For starters, I see no reason to run the PIR through the regulator chip. Just use a resistor as a current limiter into the 08M input. If the PIR is regulated, as the battery voltage drops, the PIR would die unnecessarily before the 08M. Leaving it out of the regulator will keep the combination of devices operating longer.
 
Last edited:

Minsik

New Member
:cool:

Hi ,

I have just completed (well its on a board and nearly in the box:) my first picaxe project (shop door watch cct, bongs a speaker for a short period on entrance, makes the shop staff (wife) wakeup!) that i wanted on battery operation, so lowest current needed was the ultimate goal.

Observations =

1) V important. Tie any unused inputs to gnd. ( I had wasted time over this , my fault entirely and lulled into false sense of goodness due to initial breadboard tests not showing any problems but the built up board was doing really weird things until I woke up and slapped self! Now all unused inputs made low!
2) Use the nap/sleep/doze routines instead of wait etc, Why use current when not doing anything,
3) 18X (that I used, is not a real hw interrupt I found out! It wouldn't interrupt for me from sleep mode (28X2-5V would) so I now nap and cycle so it can recheck the interrupt routine. (This seems to be a workaround for me),
4) checking data sheets for the PIC IC I am happy to run on 4*AA batteries at about 6V to a 6.5v max. (max on the datasheet for IC is 7.5V dc) I am not having any panic with this. Breadboard tested all ok at .003ma pulsing to .020ma when cycling. Hoping this will last a long time in operation.

Can you control the pir (that sounds like a very low current device to me anyway) from the pic,

ie

picaxe asleep,
wake
power PIR
wait till stabil
take reading,
power down pir,
sleep some more,

= lowest current.


Its all very exciting isnt it?
I had several attempts at the pIC and programming over the years and got very confused with lots of wasted time. However luvin the picaxe so far and have ordered more to play with.
 

lbenson

Senior Member
With the 08M, lowest power consumption on batteries appears to come with using a slow clock rather than sleep or nap. This has the advantage that you can pole in a tight loop and not miss an interrupt because you are in sleep. Check out the thread, "Low-Power Battery Backup Reference Design":

http://www.picaxeforum.co.uk/showthread.php?t=8353

That demonstration uses 3 AAs and has been running for 3 years, but its "alarm trigger" (the return of mains power) never goes off, so the only thing it is realy doing is checking the alarm trigger in a tight loop. I'm not sure how long your coin batteries will last--not much juice.
 

Haku

Senior Member
I have a 3xAAA 8xLED head torch which died on me when I was replacing the LEDs (some of the original ones died) so I cut out the original IC and replaced it with a spare 08m because it was quite comfortable to wear and gave a nice light.

Like Minsik, to keep power usage as minimal as possible when the LEDs aren't on I used a combination of a large string of "nap 3" commands in a loop and an interrupt, so that when the 08m finishes one nap command and then executes the next it's looking out for the button press. Simply using "do:nap 3:loop" uses more power than "do:nap 3:nap 3.....nap 3:nap 3:loop", after all if you've got spare program space you can fill it with naps.

You could use the same for the PIR setup, set an interrupt to look for the PIR input signal and use a nap command setting that's shorter than the time period the PIR is set to output for when triggered.

Somehow I don't think a couple of cr2025's will be able to power a PIR and an 08m (even with utilising nap to reduce power usage) for many many months, if it's outdoors then a small solar panel & rechargable battery setup - like one from a solar garden light - might be the way to go.
 

Haku

Senior Member
@lbenson, nice trick with running the 08m at a very low clock speed, I'll have to give that a try with my head torch, I did put a programming socket in for future tinkering after all :)

edit: ok, this is weird. When this section of code is running at 4mhz:
Code:
do
 nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3
 nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3
 nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3:nap 3
loop
my multimeter says it's using around 2.8uA at 3.5v, but when that same code runs at 31khz I see around 6.5uA at 3.5v.
 
Last edited:

Dippy

Moderator
What sort of multimeter Haku?
Fluke or Fleabay?

That sort of code will be switching the clock oscillator on and off. Therefore your current will be in bursts.
A multimeter will struggle to give you accurate figures.
At slower clock speeds the osc will have to run longer (albeit slower) to process the next command. So the lower clock-related current may be offset by the longer ON time. Just a thought out loud...


Back to the plot.
Oh dear... "a PIR". There are hundreds on the planet.
What PIR? What make? What size?
Give us a link to the product specification PLEASE!
It may be 45uA AVERAGE , but are there any big transients??

GENERAL: One of the areas which people often don't realise is battery specifications.
They see a capacity value and don't study the nitty-gritty:
A) The maximum current output
B) Degradation of battery capacity related to current draw.
http://docs-europe.electrocomponents.com/webdocs/0367/0900766b80367b28.pdf

Then, as the battery droops we lose our regulation.
This may not be important in this circuit, but for your reference, anything using ADCs could be badly affected.

Personally, I'd run the PICAXE via the reg , but the PIR direct from the battery.
I'd try and 'sleep/nap' the PICAXE as much as possible. Slowing the clock rate can help but if it's 98% sleep duty then that won't make much difference.

How long it lasts depends on your coding and the requirements of the device.
It depends on the App.
Can you 'sleep' the whole thing for certain periods (e.g. overnight).
Tell us more about the App? Is it for counting people?
 

hippy

Ex-Staff (retired)
As Minsik notes the absolute maximum voltage of the 08M is 6V5 so I'd consider running it out of spec at 6V0, or maybe just drop the voltage via a diode or two.

As Dippy notes, a PICAXE napping and waking won't give a constant current consumption and this can be hard to measure accurately with some test equipment. It may be you need to do real-life timing tests to determine when battery voltage drops between two levels to get an accurate measure of average current or use better measuring equipment.

For an optimal long-life sensor it may be worthwhile designing a circuit which only powers-up and runs the PICAXE when the PIR triggers. Perhaps you could even get by without a PICAXE, though we don't know what the PICAXE is actually doing. What the PICAXE does, and how often, will affect lifetime.

Perhaps consider running the lot from 3 or 4 x AA or AAA batteries rather than 2 x CR2025; the potential 15 to 20-fold increase in lifetime may offset the struggle to get minimum operating current and give acceptable lifetime.

Consider it from how long the batteries need to last, and what the max current can be to get that lifetime. With CR2025 and 50uA ( 45uA PIR + 5uA PICAXE ) that's around 3000 hours life, 125 days, 4 months. With 2200mAh batteries you could get the same lifetime drawing 730uA. With those you could aim for 200uA and get a whole year's operation.
 

fritz42_male

Senior Member
A lot of the PIRs are designed with an onboard 7805 or similar regulator which obviously consumes some power - it may be worth getting rid of this (if you are good with SMT) or picking up a pure 3.3V one.

I've just bought some 'sticky' LED sensor lights. 6 bright white LEDs around a PIR - the unit takes 4xAAA but arranged in a serial-parallel config to give 3V out.

One of these has been in my hallway for 10 days now and comes on every time someone passes (dark hallway) and stays on for 90secs (selectable). No sign of the LEDs dimming. I was quite impressed with these so I picked up half a dozen to use the PIR boards from - at AU$8 they were darned cheap! They have an On/Off switch, light on selectable switch with 20, 60, 90s and continuous settings, illumination sensitivity and led brightness control!

In case any Aussies are interested, they came from the 'Reject Shop' chain
 
Last edited:

Dippy

Moderator
fritz , in post#1 he says 45 microAmps average.
Any device with that old dinosaur 7805 (or similar) in it would be consuming current by the shedload , but without a data sheet link we're just guessing.
But based on his figures I would doubt that the 7805 is in there :)

Good points have been raised.
If we knew more about the PIR itself and the App then the Collective could probably help optimise the design.
Maybe we should all start rubbing our C balls with enthusiasm.
 

fritz42_male

Senior Member
But Dippy, as you well know

RESISTANCE IS FUTILE


(I prefer the old Vogon 'Resistance is useless')

Yup, I know 7805s are inefficient but the SMT versions are on 2 different PIR units that I have (Futurelec and another that I can't remember where I got it) so still quite common - maybe the SMT version is a lot less hungry?


And you can rub your C balls as much as you want but the last time I did that I was nearly arrested!
 

Dippy

Moderator
Was that the "Ode to a Lump of Green putty I found in my armpit" ?

I just looked at the ST SMD/SMT ones.
Just as awful as the Tyrannosaurus TO220s.

If they arrest me I shall tell the magistrate that I'm a firework.
Then he'll let me off.
 

fritz42_male

Senior Member
Groan!

I used to exchange the odd email with DNA - was VERY upset when he died. We had a common acquaintance from his book 'Last chance to see'
 

fritz42_male

Senior Member
Groan!

I used to exchange the odd email with DNA - was VERY upset when he died. We had a common acquaintance from his book 'Last chance to see'
If we are talking about poetry, I prefer the one that starts 'The dead swans lay in the stagnant pool' (It reminds me of Port Talbot in Wales)
 

Dippy

Moderator
I must dig out my books and have another read.

On UK TV over Christmas the Beeb did a new version of Dirk Gently by Dougy A.
All very silly, but very good.
 

fritz42_male

Senior Member
Did they - I missed that. Good old Aunty.

Was quite pleased that they also did some Terry Pratchett stuff as he's another one I've corresponded with and another favourite author (my only claim to fame I'm afraid - I'm quite an undistinguished person)
 

Haku

Senior Member
@Dippy, what, if it's not Fluke it's not accurate? Oh ye of little faith.
I have two decent multimeters here, a Metrix MTX3282 & a Metrix MTX3283 and they both give pretty much the same reading. An oscilloscope was on my christmas list but santa gave me a box of 60 jaffa cakes instead ;)

If the PIR he's using is similar/same as mine then 45uA is about right, these ones have a blocking diode+3.3v regulator on board and consume 40uA running and 60uA when triggered, the 3.3v output can be connected straight into the digital input of a 5v Picaxe without needing a resistor.
 

Dippy

Moderator
Well Gypsy Rose Haku , your tea-leaf reading is good today ;)

"If the PIR he's using is similar/same as mine then 45uA is about right..."
- I'm glad you are sure about that!
(Yes, I know you said "if" ... I'm teasing ... and also hinting that we shouldn't jump to conclusions even if you end up being correct).


Fluke...
I was speaking generally. I don't know the background of many people here and so many people buy the cheapest anonymous shi, sorry, stuff then start bandying figures around like they are gospel.
I never trust any figures unless from a reliable source. Hence my "little faith" :)
Metrix has a good reputation , so happy days.
Haku is now on my 'Reliable Source' list :D


But, more importantly, do you understand my suggestion re; transient / non-continuous current flow ??
This is where a 'scope and shunt resistor makes these variable current draws visible to the brain ;).
Then you can see why many DMMs will struggle to give a representative value on a digital display.
 

hippy

Ex-Staff (retired)
@Dippy, what, if it's not Fluke it's not accurate? Oh ye of little faith.
I believe Dippy was just pointing out that lower-cost equipment is usually, but not always, less accurate than more expensive, unbranded performs less well than a known reputable brand, and that's a rule of thumb which I think most people will hold as true.

I think it really comes down to, for any equipment, "how do you know what it's measuring or showing ?", when the input isn't static. It's not that any reading is necessarily wrong, it's if you don't know how equipment is reading something you don't know if the reading is right or what it really means. Like measuring UK AC mains; is 0V, 230V or 320V correct ? All are. But if you measure 285V what's that telling you, is it okay, too low, too high, is the meter right and the mains wrong, is the mains right and the meter wrong or are both actually right ?
 

Haku

Senior Member
But, more importantly, do you understand my suggestion re; transient / non-continuous current flow ??
Yes, which is why I was disappointed an oscilloscope wasn't in my stocking this year ;) I know there can be hidden peaks of current use that most DMMs can't detect, I do want an adequate oscilloscope so I can see stuff my DMM can't show me but I don't have a pressing need for one yet.
 

Dippy

Moderator
" I don't have a pressing need for one yet"
- au contraire old chap.
This proves the need for one.
Watching the current transients as a PIC switches in and out of sleep is almost impossible for a DMM (in fairness of any brand) to follow accurately.

Hippy; nail on head.
If anyone quoted 50 microAmps from a Ho Phong 50 cent DMM , but under the same conditions a £150 Fluke (or Metrix) said 80 microAmps , then tell me my dears , which would you trust?
"Fluke" was a metaphor for "something good".
Obviously if your 50 cent DMM had been calibrated by someone trustworthy then I'd go for that.

Go on, put those Jaffa Cakes on Ebay and get a 'scope.
If it's too big for your stockings then get some tights.
Martin is big in Women's lingerie so he can give you some advice ;)
 

MartinM57

Moderator
I'm quite petite actually. But don't believe everything you read on t'Internet.

What would be the going rate for (decent) scope hire in the South West then?
 
Top