Using battery and no switch

Go To Last Post
31 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there a good way to use a battery - voltage regulator - AVR circuit as shown bellow?

I know leaving a voltage regulator hooked to the battery at all times is bad practice since it draws current.

On the other hand I would like to use the AVR Sleep function and try to avoid using a switch between battery anode and voltage regulator VIN.

Is there a clever way of doing so? Is it ok to leave a switching Voltage regulator running?

 

This topic has a solution.

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Thu. Jan 21, 2021 - 08:19 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Doing what you suggest is perfectly valid. Except you need a low quiescent voltage regulator.

 

If we restrict our search to Microchip (many other vendors are available) then I/we struggle to find the relevant page on their god-damn awful website:

 

The best I could find is this: https://www.microchip.com/en-us/products/power-management/dc-dc-converters-and-voltage-regulators/linear-ldo-voltage-regulators/low-quiescent-current-ldo-regulators

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Size your battery so you can use it directly without the regulator, don't forget to use proper decoupling caps on your mpu!

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Do you have something else that can't run at 4.2 ? else go direct. And if you have something else perhaps use the converter for that (Controlled by the AVR).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

There are a fair number of low quiescent current switchers made to do exactly what you want. Leave them hooked up with no load or very low load and they draw microamps from the battery. Check TI and Analog Devices/Linear Tech. I have had excellent success with a number of small TI switchers. Start by looking for switchers rated for less than 500mA peak load current. If you don't have any big loads, then reduce that to 100ma or so peak load rating.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't want to go direct because having a flactuating Voltage makes the attinys on board oscillator change its frequency slightly. I need precise and stable clock. Any other ideas on having good clock on a direct battery connection?

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Didnt know about these.. I am already looking for such v regulators! Thank you both

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

For example, in a new project, I use TI TPS63051, which is a micro-power buck/boost. It will handle up to about 5.5V in and down to about 2.5 with 3.3V out and peak of 1A. Perfect for a LiIon battery.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

tellSlater wrote:
I don't want to go direct because having a flactuating Voltage makes the attinys on board oscillator change its frequency slightly. I need precise and stable clock

It also changes with temperature too, so only half the battle, a xtal will cure both needs.

BTW is a tiny2313 a pico power AVR, there are newer and less power hungry AVR's now.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am not aware of these. It is an ATTiny2313a

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is an external oscillator more stable - not subject to drift under changing operating conditions?

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

A crystal is fine. Understand that "external oscillator" means a fully powered device that generates a clock, even if the MCU has no power. If you have only a crystal (and the two necessary caps) and set the fuses to Ext Osc, you have, as they say, "bricked it".

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

With a bit of thought, it struck me that some voltage regulators (VREGs) have 'enable' pins, and you could use a big capacitor (1F or so) downstream of the VREG such that when the MCU wakes up, the cap provides power long enough for the AVR to turn on the regulator (and then recharges the cap, too).

 

Of course, all caps leak, so that's another source of power drain, and you'd probably want to very carefully measure and calculate just how long you can afford to sleep for before your AVR will never wake up, but that's left as an exercise for the student... frown  S.

 

PS - Digikey's website is pretty good (I think, anyhow) for looking up a variety of voltage regulator parts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is the first time I realize the difference. Thank you. Through the years I have bought many AVRs on ebay and some of them came with default fuses. Others needed an external crystal and caps on xtal1 xtal2 in order to be readable. Some of the chips though were not responsive. This makes me think that I should try providing an external clock and try re-reading them. Fortunately, I have kept all of them even if I could not read them. I suppose some of them could have the lock bits enabled in which case I would need a high Voltage programmer?

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Shouldn't need an HV programmer.  The AVRs I've met (granted, not all of them) their lock bits merely prevented reading without a full chip erase.  But the full chip erase still worked fine, whatever the lock bit settings.  You get a blank chip.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

BUT - all of that requires a running clock. You cannot change any fuse without a running clock. That is far different from lock bit settings. Two totally different animals. Lock bits can be overwritten by erasing the chip with a clock running. Changing the configuration fuses requires a running clock.

 

Yes, both require an ISP clock that is no faster than 1/4 of the ACTUAL running F_CPU

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Fri. Jan 15, 2021 - 01:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Assuming your trying to find a way to power off with no battery draw. Back in the early 90's I did this with a few JFET and mosfets, and capacitor to debounce the gates, both rails of battery got disconnected, solid state soft touch on off circuit. Battery lasted 10+ years in off state, no measurable current draw when off. Regulator was after that soft touch circuit. Sorry I dont have the schematic handy, was like 30 years ago, but it is doable.

Last Edited: Fri. Jan 15, 2021 - 05:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I need precise and stable clock.

You really need to define that !

 

is that 5 sec a year a day ? Or just good for a UART ? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am basically running a 4 digit timer for 60 seconds tops with precision to the millisecond (the tens digit is not displayed). It would be nice if I was losing less than a millisecond for at least 10 seconds. I am using proximity sensors to start and stop the timer. I was thinking of using it to time fast movements.

Edit: I think that means less than 8.64 sec a day

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Fri. Jan 15, 2021 - 06:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know leaving a voltage regulator hooked to the battery at all times is bad practice since it draws current.

 

? ? ?

 

You are using an LED 7-Seg display, and two LEDs on the sensors.

Those draw a HUGE amount of current compared to what some of the low current regulators mentioned above use.

 

Is the Display on all of the time, or just when the user is using the device?

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My draw is 30ma. I use 1k resistors for the display. And also the sensors don't draw that much

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your micro needs by-pass capacitors for reliable operation.

 

You should ahve a 0.1 uF cap across the Vcc/Ground and AVcc/Ground pairs of pins.

 

This applies to all micro circuits.

 

JC

Last Edited: Fri. Jan 15, 2021 - 06:40 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A typical Xtal, properly biased (that's what the little caps are for) should be just fine for one part in 10,000 (one millisecond in ten seconds). 

 

I agree with DocJC - You could save a LOT of power by going to an LCD instead of those 7-segment displays.  Bumbling about with regulator disabling may be rearranging deck chairs on the Titanic by comparison.

 

Also you might want to check your current math.  I get (worst case: 3.3V across 1kohm, displaying 8 on four digits) more like 90mA, not 30...  S.

 

ETA:  If you throw in 0.6V drop for the LED itself, you still get 70mA or so. 

Last Edited: Sat. Jan 16, 2021 - 01:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Agreed, ditch the LED display and go LCD if using batteries. That is your substantial battery drainer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scroungre wrote:
ETA:  If you throw in 0.6V drop for the LED itself, you still get 70mA or so. 

 

That would be around two, two point two volts for the LED drop, no? So 3.3 - 2.2 = 1.1v? Which gives 1.1mA/segment, for worst case 28 segments * 1.1 ~= 31mA. And if it's multiplexed, a quarter of that - though probably a bit gloomy.

 

Though I'd still consider an LCD if power is critical there are other approaches which can be used to reduce power - as simple as turning the display off when it's not needed... But as long as the device gets the desired operating time from the specified battery, there's no real reason to lose sleep over minimising current. I've played that game and to do it well you need expensive current monitoring/logging meters so you can see exactly what current is being taken when. Once you're down to a handful of microamps a generic multimeter won't do the job.

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There exist LEDs that drop in the 2V range, but none of my 7-segment displays drop anything like that.  A typical red LED drops ~0.6/0.7, in my experience. 

 

And 1.1mA would make for a really dim segment, no?  Multiplexing doesn't much help here - for readable brightness you have to drive them at average current high enough to be readily visible in typical room lighting - which means they need 4x the current if they're only on for 1/4th the time*.

 

If I don't care about power, I typically run my LEDs at about 10mA each - Four seven-segment displays could pull half an amp.  I don't think the OP is running theirs quite that hard, looking at the picture, its exposure, and the fact that the LEDs are not blowing out the camera.  However, the OP is running the decimal point, so count one more segment in there.

 

Even at 1.1mA per segment, we've already blown through the chap's original 30mA budget without CPU or sensors or VREG.

 

We're being academic here.  An LCD display would pull a fraction of this and be at least as readable, even with a backlight.  Comparatively speaking, the draw from an unloaded VREG is barely measurable.  Have fun!  S.

 

* -ish.  There's nonlinearities in there in both LED brightness / current and human eye visibility, so yeah, you can probably get away with somewhat less.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You surprise me. I've used 2v as a rough can't-be-bothered-to-look-it-up for years. A quick glance at digikey's filters for red 10mm 7-segment displays shows 1.7-2.1v... Standard surface mount red LED chips (e.g. Liteon LTST-C191KRKT) show as up to 2.4v.

 

Though I agree with your point about multiplexing; hence my comment about 'dim'. You're certainly right that the human eye is a weird beastie; four times the current for a quarter of the time appears brighter than the continuous current 'equivalent'.

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Using battery and no switch

Gotta laugh...

 

So I have a fair number of projects lying about, and just about all of them have an on/off switch.

And this weekend I needed to make a modification to the one board board I've built in the last few years that doesn't have one!

 

I had to unsolder the battery lead before I could change out a resistor on the board. 

 

I tried to post an earlier answer about switches, also, but I don't see the post...

 

Banggood Electronics has small, SPDT, slide switches, through hole, for < $0.03  (< 3 cents) USD, each.

That's the price of a resistor!

They fit in a breadboard, taking up 3 holes, so very small, and for an on/off switch you can just use the center connection and one of the connections of the end, and ignore the third connection.

 

I'm having problems posting a photo on forum at the moment, so no image...

 

JC

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Only one segment is active at a time. They are iterated through at high frequency. I like this display more aesthetically. I am aware that an LCD could be better but I will probably stick with the led display

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Sat. Jan 16, 2021 - 08:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you talking about something like these?

 

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Sun. Jan 17, 2021 - 06:04 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yes, exactly.

Makes it easy to add to a project with very little space or cost.

 

JC