How do I Supply 5 Volts with Common Batteries?

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

I used a PJRC AVR Teensy 1.0 to make a bike light controller. Basically it keeps the headlight and front and rear flashers on for two minutes unless it gets an interrupt from a reed switch on the spokes and magnet on the wheel, which resets the two minute countdown.

I used a 4.5 volt phone charger for building and testing and got it working perfectly.

The problem is when I use 3 AAA batteries. It only works for a few minutes and not when it is cold.

So, apparently, 4.5 volts is right at the edge of margin of error of the 5 volts the board is supposed to need.

Shit, they don't make 5 volt batteries or batteries that can be combined to give me 5 volts.

It doesn't have an off switch, just sleep mode.

I thought of using a regulator and 4 AAA batteries, but I don't know how much current will be drained by the regulator when it is in sleep mode.

Maybe I can just get away with 6 volts.

Any suggestions?

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

I could not find the specs for the Teensy 1.0, but it probably comes with the Brownout detector set to 4.5 volts.

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

I went to the PJRC site and see Teensy 2 and 3, no Teensy 1...

I don't know for sure what uC you have, or the schematic for your circuit.

You did not mention if the battery is ONLY controlling the micro, and sending an on/off signal to the other lights, or if the battery is also the supply for the lights themselves.

If the uC is the Mega32, then what speed are you running it at? From an --> old <-- data sheet I see the M32 can run at <= 4 MHz with a V+ of 1.8 V to 5.5V. It can run at 10 MHz with V+ of 2.7 - 5.5V, and finally up to 20 MHz with V+ of 4.5 - 5.5 V.

As the micro is not doing anything too complex, perhaps you could slow the clock frequency down to permit the chip to operate in spec at a lower voltage.

When the lights turn on, if the same battery is used for the micro and the lights, then battery voltage may drop even more. Measure the battery voltage with the lights on. Is the Brown out detector being used? At what level?

The battery voltage may drop further, under load, when it is cold. Think of a car battery cranking a cold engine, (although there are other issues involved, in this case...).

There are several possible solutions to get your circuit working as you desire. Post a schematic of the full circuit to help with meaningful suggestions.

It may be that the "easiest" solution is two battery supplies, one for the micro, one for the lights. (They would require a common ground connection.) Hard to say without knowning what the lights are, (incadescent vs LEDs), are they powered by the same battery, the light's Vin range, etc.

JC

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

I use a NCP1402SN50T1G boost converter to run 5v things from 3v. Takes an external inductor, diode and capacitor.

Don't most of the avr's work down to 1.8v these days? Check if you have the brown out detector enabled.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

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

DocJC wrote:
I went to the PJRC site and see Teensy 2 and 3, no Teensy 1...

I don't know for sure what uC you have, or the schematic for your circuit.

It is an at90usb162, no schematic for he board.

DocJC wrote:
You did not mention if the battery is ONLY controlling the micro, and sending an on/off signal to the other lights, or if the battery is also the supply for the lights themselves.

I'm running the lights off the board.

The data sheet for the ship says the chip can run from 2.something to 5.5 volts. Since the board is old I don't know what the actual range is but I'm assuming that it is the same 5 volts that the later versions use.

There are several possible solutions to get your circuit working as you desire. Post a schematic of the full circuit to help with meaningful suggestions.

DocJC wrote:
It may be that the "easiest" solution is two battery supplies, one for the micro, one for the lights. (They would require a common ground connection.) Hard to say without knowning what the lights are, (incadescent vs LEDs), are they powered by the same battery, the light's Vin range, etc.

Two pins have 6 flashing LED's each, 1 pin has 8 flashing, and one pin has 12 on continuously.

I can't really provide a schematic of the board since the mfr didn't make one available.

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

Wow, that is a lot of LEDs for an AVR to directly drive.

Pull the data sheet off the Atmel web site and look at the Electrical Specifications, usually near the end of the data sheet.

Most of the AVRs have about a 40 mA current MAX per pin, but some of the chips are less than this.

Also, one doesn't really want to design to run right at the maximum. One usually designs for less than this, so that there is a "safety factor" and the chip is being used within specification.

Also, be sure to read the fine print. There is a current maximum for the V+ and Ground leads, as well as for the total current that can be drawn by any Port, (i.e. all of the current being drawn by the port's pins).

Make sure you are not exceeding these spec's, or the chip may well malfunction, and perhaps be damaged.

Note that one can easily use the micro to drive a bunch of 2N7000 NFet transistors and let the NFets act as switches to turn on the current to the LEDs.

V+ to RESISTOR to LED to LED to LED... to NFet to ground.

The number of LEDs one can put in the string, to be on at the same time, is dependant upon the voltage drop across the LEDs and the battery voltage available.

The resistor isn't optional.

JC

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

Should be ok if he's using an output transistor to drive the leds.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

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

Which is why a schematic was requested...

JC

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

LadyAda has a MintyBoost in an altoids tin that uses a one cell stepup.

Imagecraft compiler user

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

3 AAA - Nickel-zinc cells will have a greater voltage than primary alkaline cells and are rechargeable.
These'll be almost flat at 1.5V/cell so 4.5V/battery.
Charged is 1.9V/cell or 5.7V/battery.
Nickel-zinc battery
PowerGenix
Shenzhen BetterPower Ni-Zn AAA
Conrad UK, Nickel-zinc

4 AAA - for a bike light, I have a larger one that's rechargeable and uses Ni-MH cells.
eneloop are very good cells with some distribution.
Charged is approx. 1.6V/cell or 6.4V/battery.
Discharged is 1.0V/cell or 4V/battery.
http://us.sanyo.com/eneloop

Otherwise, lithium ion will be lighter and smaller.
Lithium iron phosphate is relatively safe.
These can be in a CR-123; so could use a boost converter as Torby stated.

"Dare to be naïve." - Buckminster Fuller