Arduino Forum

Using Arduino => General Electronics => Topic started by: anvoice on Jun 24, 2015, 09:53 pm

Title: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 24, 2015, 09:53 pm
Hello,

I am building a small robot based on SG90 servos. In order to make it autonomous, I'd like to use a 4.8V NiMH battery to power the 16 servos I'll need (max they take is about 4.8V, so it seems to be the best choice of battery type). In order to avoid using another battery specifically for the arduino, I'd prefer to be able to connect the 4.8V to it. I've read that powering directly from the 5V pin is undesirable (mixed info, but leaning towards possibility of regulator/board damage), so I was going to solder a couple of pins directly to the underside of the USB connector where power comes in: that way the safeguards such as the fuse are in place. Will probably have to remember to unplug the battery every time I plug it into the usb to avoid competing power sources, but seems like it should work.

The question: I don't know if 4.8V is enough for the arduino and attached sensors to operate properly. Can I use it directly, or would I need some kind of step-up voltage converter? I feel that using a separate power supply would not be efficient.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: olf2012 on Jun 24, 2015, 11:15 pm
The problem is: your 4.8V are not always 4.8V. When fully charged, 4 cells will have 4 x 1.4V which exceeds the upper limit of 5.5V for the AVR chips.
When operating 16 servos your battery has to be quite large to keep the voltage from dropping to fast under heavy load.
I would use 5 cells (nominal 6V) and a low-drop voltage regulator to bring the voltage down to 5V for the Arduino. BTW I would not use the full Arduino board as a permanent installation, only for development.
What capacity (mAh) are you planning to use for the cells? What are the current requirements for your servos?
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: DrAzzy on Jun 25, 2015, 12:26 am
You could just cheap out and put a schottky diode between + on batteries and 5V (on Uno) or Vcc (on pro mini). That will drop like 0.3v, so even at full charge you'd have 5.3v.

Though you might need to turn off brownout detect fuses to keep it from thinking the batteries are dead before they are. Since you're driving motors off the same batteries, you'll probably need extra filtering on the power into the Arduino (put the cap after the diode I mentioned above, if you do it that way)
Title: Why use an Arduino BOARD ?
Post by: arduinoaleman on Jun 25, 2015, 01:46 am
The Arduino uses an ATmega 328p chip.

This chip works well from 3 to 6 Volts.

So if you are able to solder this chip to a prefabricated board,
your problem NO LONGER is the voltage of your batteries.

All you need is something like an arduino uno to download
the bootcode and your code.

(lots of information how to do this in the forum).



you do not even need a quartz when timing is not critical.
just use the internal timing (select this when downloading bootcode)

and as sombody else in this thread already said, a 1.2 volts battery can give you up to 1.4 volts.
this will add up to 5.6 volts.

This is OK according to the ATMEL datasheet for an ATmega that specifies the max. voltage at 6 Volts (page 313 / ATMEL datasheet for ATmega 328p.)

The ATmega can take up to 6 volts - however I do not know if other chips on an Arduino board can handle this. So I would just use the chip and not the board.

Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 25, 2015, 05:59 am
Thanks for the suggestions. To respond in order:

I'm planning to use the arduino board as a start, both for development and simple controls like walking. I'm quite new to electronics, so that's easier atm. I was hoping to move on to something more advanced such as a raspberry pi 2 once I'm ready to program it. I was going for a 1500 mAh NiMH battery as a start. The motors take about 200mA running and 500mA stalled, but I doubt all would be running at the same time. The 1500mAh should last at least 15-20min. However, I'm not sure they can take 6V, their max rating it is at 4.8V.

As for the diode, it's good for cutting down on initial overvoltage, but bad for when battery voltage drops. I don't know what the specs are for the low cutoff for the board either (Mega 2560 by the way).

Being new at this, I was hoping to get the arduino to work before trying to develop a board of my own. Seems like solving the voltage problem is a bit less complex than developing a board from scratch.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: MarkT on Jun 25, 2015, 10:55 am
Quote
max they take is about 4.8V
A maximum that's "about" isn't a very useful specification!

They will take it.  Just don't run the Arduino and servos from the _same_ supply.

NiMH cells are about 1.3V, not 1.2V, that was the NiCd cells they replaced.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 25, 2015, 08:06 pm
A maximum that's "about" isn't a very useful specification!

They will take it.  Just don't run the Arduino and servos from the _same_ supply.
Their stated max is exactly 4.8V. However, knowing that servos can take a slight overvoltage, I said "about". They probably will work fine on 5.2V or so, but not sure about 6V.

What do you mean arduino and servos from same supply? So I need to get 2 batteries either way? Any reason for that if both servos and arduino can work on the same voltage, and I can use a capacitor to smooth power to arduino in case of spikes due to servo usage?
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: DVDdoug on Jun 25, 2015, 08:57 pm
Quote
BTW I would not use the full Arduino board as a permanent installation, only for development.
That's up to the individual, but I'd go-ahead and use the factory Arduino board unless you have a reason not to.     I use the Arduino board as the permanent-final board.   I assume 80 or 90% of Arduino users do the same.   

I would only consider using a custom board if I was going into volume production (to lower the cost), or if I had space limitations.

To me, the big attraction to the Arduino is that the production board is the development board and programmer, and the IDE is free.    With a typical microcontroller, you'd have to buy a separate development board (which can cost a few hundred dollars), you might have to buy a separate programmer and you might have to pay for the software development kit.

The Raspberry PI is a complete single-board-computer and it has all of those same advantages over a bare microcontroller chip.

Quote
I'm planning to use the arduino board as a start, both for development and simple controls like walking. I'm quite new to electronics, so that's easier atm. I was hoping to move on to something more advanced such as a raspberry pi 2 once I'm ready to program it.
I wouldn't recommend that.   The Raspberry will require different software, a different software development environment, and the hardware interface will be different.

It will be like starting-over, except that you could use the same mechanical robot parts and motors.  If you think the Raspberry is going to be the better solution, now is the time to make that decision.

I've never used the Raspberry, but my feeling is that the Arduino is better (or easier) for things like motor control and the Raspberry is better for user interface (especially if you want a keyboard, mouse, video screen, or advanced sound).
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: DrAzzy on Jun 25, 2015, 09:51 pm
You might have to change fuse settings to keep the board running at low voltage, but with BOD disabled, you should be good down to at least 3.8, and people say they often work below that at 16mhz. If you switch it to run at 8mhz, you could get it to run below 3v.

The problem with running arduino and motors on same power source is that the motors put a lot of electrical noise onto the power source, which can then reset the board unexpectedly. You can certainly get shared power supplies to work, but could need extra filtering - whereas using a separate power source just takes that worry (and all the other power related issues in this thread) totally off the table, so you can get on with the fun part of your project, and come back and clean up the power supply situation later (when you can test known working code with your new power source, so you know new problems are power related - thus sparing you from the constant question "Is that problem something wrong with my code? Or is the board resetting because I didn't do a good enough job of supply filtering" during the first part of the project).
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: Wawa on Jun 25, 2015, 10:40 pm
I don't understand why people think you have to supply a 5volt Arduino (or 5volt servos) with ~5volt batteries.
Why not use two (7.2volt) or three (10.8volt) LiPo cells. Or a 12volt sealed lead/acid battery.
And a buck (step-down) converter.
Buck converters are cheap and efficient.
Use one for the servos and, if you have to, one for the Arduino.
Leo..

Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 26, 2015, 12:16 am
I wouldn't recommend that.   The Raspberry will require different software, a different software development environment, and the hardware interface will be different.

The arduino is much easier to work with and will provide me with good experience in developing controls for the robot's movement (that'll probably be by far the hardest part, I have 4 servos per leg, which is not the standard design) and working with sensors. In its ease of use and ability to interface with sensors it's considered superior to the pi. The problem is, I'd like to eventually make the robot autonomous, i.e. be able to navigate on its own, do some basic image recognition, etc. I won't be able to manage that with the arduino due to its processing power and memory limitations, unless I send all the data to a server and have that do the work, then control the robot (not a bad initial solution, but no truly autonomous robot).

You might have to change fuse settings to keep the board running at low voltage...

The problem with running arduino and motors on same power source is that the motors put a lot of electrical noise onto the power source, which can then reset the board unexpectedly...
I'll research how to change the fuse settings then. I agree with the point about noise, I'll probably use a variable power supply for the motors during initial tests and power the arduino from USB to guard against that. I probably could try that with batteries too, perhaps find one small one for the arduino that wouldn't add too much weight.

I don't understand why people think you have to supply a 5volt Arduino (or 5volt servos) with ~5volt batteries.
Why not use two (7.2volt) or three (10.8volt) LiPo cells. Or a 12volt sealed lead/acid battery.
And a buck (step-down) converter.
Buck converters are cheap and efficient.
Use one for the servos and, if you have to, one for the Arduino.
Leo..

I actually don't know the efficiency of a buck converter, but assumed it's not that great, so didn't consider it. Assuming the servos can easily draw a few amps of power during regular operation, would the converter not lose too much power? If so that's definitely worth looking into.

Thanks for all the suggestions so far.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: Wawa on Jun 26, 2015, 12:33 am
Look e.g. here (https://www.pololu.com/category/131/step-down-voltage-regulators) for the latest generation of low drop buck converters.
Graphs included.
Leo..
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 26, 2015, 01:05 am
Look e.g. here (https://www.pololu.com/category/131/step-down-voltage-regulators) for the latest generation of low drop buck converters.
Graphs included.
Leo..
Good to know, though at that price point (I'd probably need the 5A one for $15) it'll become the single most expensive part of the robot. Plus I'd still be losing 5-15% of the battery's capacity. Definitely a valid solution, though possibly not the most cost-effective.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: DrAzzy on Jun 26, 2015, 01:21 am
You can get cheaper converters on ebay. not quite as efficient though.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: Wawa on Jun 26, 2015, 01:40 am
A higher battery voltage and a buck converter is the only way to keep things fully/reliably working, and use the full capacity of the battery.
Leo..
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: larryd on Jun 26, 2015, 01:43 am
I fully agree with using a SMPS buck converter.
Use one and get on with your project.

Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 26, 2015, 03:48 am
I agree the buck module is a nice suggestion, and I'm not trying to discredit it, but the robot has 16 total leg servos, plus 2 servos for a camera, as well as the board and sensors. Assuming all 16 servos stall at once, for example (unlikely, but possible scenario), that's an 8A power draw. That's without the amps or so the board and sensors will be using (the ESP8266 wifi module alone, which I'm planning to use, takes about 300mA I believe). So I'd need quite a bit of a safety margin or a lot of buck converters. I did find a 10A converter on ebay for a reasonable price, but it's too big and probably too heavy to fit on the small robot. At that point I'd really be better off getting a small separate battery for the arduino, I just wanted to avoid having to go that route.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: larryd on Jun 26, 2015, 04:46 am
This is the highest amperage version I've used.
http://www.ebay.ca/itm/DC-DC-Step-Down-Power-Module-4V-38V-to-1-25V-36V-5A-LED-Voltmeter-Adjustable-/371358493678?pt=LH_DefaultDomain_0&hash=item5676b0ebee (http://www.ebay.ca/itm/DC-DC-Step-Down-Power-Module-4V-38V-to-1-25V-36V-5A-LED-Voltmeter-Adjustable-/371358493678?pt=LH_DefaultDomain_0&hash=item5676b0ebee)

All the versions I have used are short circuit (you could call this stall current) protected.

I see there are 12 and 15 amp versions on eBay.
.

Title: Re: Powering arduino with 4.8V NiMH battery
Post by: DrAzzy on Jun 26, 2015, 05:37 am
Yeah, that is actually a pretty good point on just using a buck or boost converter.

12A, $5 shipped. http://www.ebay.com/itm/DC-DC-CC-CV-Buck-Converter-Step-down-Power-Supply-Module-7-32V-to-0-8-28V-12A-EC-/221670461819?pt=LH_DefaultDomain_0&hash=item339c96d17b


Actually, you could use a buck/boost converter to supply the arduino with a constant comfortable voltage, while running servos straight off batteries....

$2 shipped buck/boost http://www.ebay.com/itm/DC-DC-Boost-Buck-Converter-Step-Up-Step-Down-Supply-Module-3-35V-to-2-2-30V-HG/271720088700?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D32237%26meid%3Dff97540d481642989f28d171bc93103a%26pid%3D100005%26rk%3D2%26rkt%3D6%26sd%3D290833291375&rt=nc

No endorsement of those specific vendors - there's a huge number selling same units and similar ones.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 26, 2015, 05:52 am
The step-down converter is too bulky to comfortably fit on the robot chassis. It's a fairly small machine.

Yes, that was along the lines of my original question. The step-up converter might be a good solution, it's a lot smaller since I only need enough current for the arduino, thanks for the tip.

Still, it'll take precious space and add weight, so if anyone happens to know whether the arduino itself might be fine with the 4.8V (as mentioned, a bit higher at peak and probably lower towards the end) I'd appreciate hearing it, it'd make the whole setup easier.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: Wawa on Jun 26, 2015, 06:59 am
Step-up converters have a different behaviour than stepdown converters.
Read up about noise, short circuit protection, dropout voltage, and efficiency before you choose one over the other.

Personally I think higher voltage batteries and buck converters that are just ok for the job (not calculating total stall current) are the best overall choice.
An efficient 5volt/2.5A buck converter should be the size of a postage stamp.
Use two if you have to.
Leo..

Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 26, 2015, 07:45 am
It's pretty difficult to grasp everything at once, didn't know there's a difference in behavior. Would something like this work?
http://www.ebay.com/itm/DC-DC-Converter-Mini-Step-Down-Module-BUCK-Adjustable-3V-5V-16V-for-RC-Plane-/371295065523?pt=LH_DefaultDomain_0&hash=item5672e915b3

Very small, 2-3 should provide enough current, efficiency characteristic for this DSN-mini-360 module is listed as 96% max. Not sure if there's a catch I'm missing.

I also ordered a XL6009 step-up board just in case, no idea about what it's noise is. Efficiency is 92% top but with an amp or so of current needed it's better than losing 4% of 5 amps. I feel like worst case I might be able to boost the signal up to 7-9V, then run it through the arduino power jack where the regulator will take care of the noise.

Need to figure out which of these setups will be more efficient so I can choose the battery.
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: Wawa on Jun 26, 2015, 08:48 am
I would try those small buck converters with a 2C LiPo (7.2volt).

Boost converters can be noisier with a small voltage difference, and buck/boost could be less efficient.
Lineair regulators are not very good at removing switching noise.
Capacitors and inductors are.
Leo..
Title: Re: Powering arduino with 4.8V NiMH battery
Post by: anvoice on Jun 26, 2015, 09:41 am
I'll get the step down converters, they'll be good to have around in any case.

After doing inventory of available LiPo/LiFe batteries, I noticed that all of them with reasonable capacity are a bit big to fit the robot chassis. The best thing I could find was a NiZn, which has smaller dimensions for the same capacity. Might have to give the step-up converter a try, if that doesn't work I'll make a filter for it, and if that fails switch to a step-down.

Thanks for the help, I appreciate it.