Best way to temporarily power an Arduino from a 6V battery

Hello all! Here is my first post on the forums, I need some advice from the battery experts out there :)

I will be using an Arduino to monitor the rotation of a slow moving motor. The Arduino won't be doing much, just reading an encoder and counting. No LEDs or motors or anything. The motor is powered by a 6v SLA battery. I want to know if it is possible to power the Arduino from the motor's battery, and, if so, what is the best way to do it.

Thanks :)

The maximum voltage rating for the ATmega328 is actually 6.0V, but I might hesitate to power an Arduino directly from that. A quick and simple approach might be to put a diode like a 1N400x in series with the battery, it'll drop about 0.7 volts, things will still be a bit on the high side but I think should be OK. Or use two diodes, that'll get it down into the 4.5V range, where the MCU should still operate OK at 16MHz. Depending on the motor, I'd be prepared to provide some additional filtering, if the motor generates a lot of noise it's possible it could cause the MCU some difficulties. So I might try it without the motor running first if that's possible. If things look good that way, then put the motor back in the mix.

The series diode solution is simple, but bear in mind that when the SLA battery is on charge it will have nearly 7 volts across it, so you need to take account of this unless the Arduino is always disconnected during charging. I would use a 5v low dropout regulator such as the TL750L05CLPRE3 instead.

dc42: The series diode solution is simple, but bear in mind that when the SLA battery is on charge it will have nearly 7 volts across it, so you need to take account of this unless the Arduino is always disconnected during charging. I would use a 5v low dropout regulator such as the TL750L05CLPRE3 instead.

Mmmm, good point!

Hmm, I was under the impression that 6v was the lower limit (I'm using a nano, if that makes any difference) like it says on the nano spec page. Is there something I'm missing here? On the page, it says its recommended input voltages are 7-12v.

EDIT: The battery will always be disconnected when charging.

I'd just use the built in regulator. Worst case the 6v battery actually runs at 6v and the 2v dropout on the regulator gives you 4v. Every 328 chip I've run into (as well as every jeenode on the planet) runs happily at 3.3v 16mhz, 4v shouldn't be an issue.

It depends on whether the motor is putting spikes and drop-outs on that battery... Always safer to power digital electronics separate from motors. Without an oscilloscope its hard to know the quality of the power, but adding good decoupling to the battery is a wise precaution. What counts as good decoupling depends on the motor's current draw.

Bobnova: I'd just use the built in regulator. Worst case the 6v battery actually runs at 6v and the 2v dropout on the regulator gives you 4v. Every 328 chip I've run into (as well as every jeenode on the planet) runs happily at 3.3v 16mhz, 4v shouldn't be an issue.

Carefull, the DEmileunoave board needs a minimum of 7v because it's 5v regulator is not a LDO type. If you input 6v you may end up with 4v for the microprocessor, since the avr can operate at 16mhz at even 3.3v this would not turn out to be a problem IMHO.

The UNO has a MC33269ST-5.0T3 , which is a LDO of 1v, so 6v is just enough to give you a guaranteed 5v output.

limescout: Hmm, I was under the impression that 6v was the lower limit (I'm using a nano, if that makes any difference) like it says on the nano spec page. Is there something I'm missing here? On the page, it says its recommended input voltages are 7-12v.

There are two different things here. The power connector goes through the inbuilt voltage regulator, and thus (because of the drop-out) needs to be 7+ volts (judging by the circuit it also goes through a diode which would drop around 0.7V). That's why you plug 7+ volts into the power connector (which shows up at Vin after the diode).

However the 5V pin on the board is after the regulator. That is where I would be plugging a 5V supply into. In fact, I often connect two Arduinos together ... one is powered by the USB or the power connector, and the other by connecting the two 5V pins together.

So either plug around 5V, preferably regulated, into the 5V pin or 6+ V into the power connector (probably Vin would be OK as that is after the diode). According to the spec the MC33269 is a 800 mA drop-out regulator.

[quote author=Nick Gammon link=topic=68963.msg512745#msg512745 date=1313223127]

limescout: Hmm, I was under the impression that 6v was the lower limit (I'm using a nano, if that makes any difference) like it says on the nano spec page. Is there something I'm missing here? On the page, it says its recommended input voltages are 7-12v.

There are two different things here. The power connector goes through the inbuilt voltage regulator, and thus (because of the drop-out) needs to be 7+ volts (judging by the circuit it also goes through a diode which would drop around 0.7V). That's why you plug 7+ volts into the power connector (which shows up at Vin after the diode).

[/quote]

Absolutely correct, i forgot about that diode, that is why you need 7v input to get 5v from the regulator. ie you need 6+0.7 = 6.7 at least.

A bit of measurement on my Uno, powered by a (nominally) 9V battery reveals this:

  • Battery voltage: 8.81V
  • After diode D1 (an M7): 8.07V
  • On the Vin pin: 8.07V (confirms Vin is after the diode)
  • After voltage regulator: 5.004V
  • On the 5V pin: 5.004V (as expected)
  • On the 3.3V pin: 3.302V

This confirms that the initial diode D1 drops 0.74V, roughly as expected. It also demonstrates that Vin is past that diode, so if you want to save the 0.7V voltage drop, connect your battery to Vin, not to the power input terminal.

Of course, the diode protects your board from incorrect polarity (and also from AC voltage to an extent, presumably) so you need to be cautious how you connect the battery.

Since the voltage regulator has a 800 mA drop-out, and the diode drops the voltage 740 mA, then to get 5V on the board you would need to connect up at least 6.54 volts to the power plug, or 5.8 volts to Vin. No doubt this is why they say to connect it to 7 to 12 V DC supply (saying 6.54+ V would look confusing).

Judging by the table of page 316 of the Atmega328 spec, it will operate correctly at 20 MHz from VCC of 4.5V upwards so you would have a bit of leeway if the battery voltage drops. If speed isn't an issue you could run at 10 MHz down to 2.7V.

[quote author=Nick Gammon link=topic=68963.msg513255#msg513255 date=1313277873] A bit of measurement on my Uno, powered by a (nominally) 9V battery reveals this:

  • Battery voltage: 8.81V
  • After diode D1 (an M7): 8.07V
  • On the Vin pin: 8.07V (confirms Vin is after the diode)
  • After voltage regulator: 5.004V
  • On the 5V pin: 5.004V (as expected)
  • On the 3.3V pin: 3.302V

This confirms that the initial diode D1 drops 0.74V, roughly as expected. It also demonstrates that Vin is past that diode, so if you want to save the 0.7V voltage drop, connect your battery to Vin, not to the power input terminal.

Of course, the diode protects your board from incorrect polarity (and also from AC voltage to an extent, presumably) so you need to be cautious how you connect the battery.

Since the voltage regulator has a 800 mA drop-out, and the diode drops the voltage 740 mA, then to get 5V on the board you would need to connect up at least 6.54 volts to the power plug, or 5.8 volts to Vin. No doubt this is why they say to connect it to 7 to 12 V DC supply (saying 6.54+ V would look confusing).

Judging by the table of page 316 of the Atmega328 spec, it will operate correctly at 20 MHz from VCC of 4.5V upwards so you would have a bit of leeway if the battery voltage drops. If speed isn't an issue you could run at 10 MHz down to 2.7V. [/quote]

The other issue with input voltage is that it be high enough for the auto-voltage selector circuit to properly isolate the on-board +5vdc from the USB +5vdc if and when you plug into the USB while still on external power. It's not good to have the on-board regulator output connected to the USB power buss, so that is the purpose of the auto voltage selector function.

Lefty

How does that auto-voltage selector work? As far as I can make out, and I am no expert, if Vin drops below 6.6V then it turns on T1 which connects USBVCC to +5V.

That’s it whole and only purpose in life. So +6.6vdc (or maybe a tad more :wink: ) at the Vin pin is the minimum requirement for proper USB power isolation when required. +5.8 could be problematic.

Lefty

Well I presume from the original post that this is battery powered and not connected via USB (then he wouldn't need the battery power).

But I take your point that, if you connect Vin to less than 6.6V, and then connect the board up to a USB port as well, then the USB is not properly isolated.

Isn't there a design problem here though? It is recommended to connect the power plug on the Arduino to 7 to 12V DC, so if you connect it to 7V, then after the diode drop of around 0.7V, Vin will be 6.3V. This is too low for the auto-voltage selector which will also attempt to connect it to the USB. Also the hardware page for the Uno says:

Input Voltage (limits) 6-20V

So connecting the power port to 6V would mean Vin would be 5.3V, which is definitely under 6.6V.

[quote author=Nick Gammon link=topic=68963.msg513372#msg513372 date=1313296532] Well I presume from the original post that this is battery powered and not connected via USB (then he wouldn't need the battery power).

But I take your point that, if you connect Vin to less than 6.6V, and then connect the board up to a USB port as well, then the USB is not properly isolated.

Isn't there a design problem here though? It is recommended to connect the power plug on the Arduino to 7 to 12V DC, so if you connect it to 7V, then after the diode drop of around 0.7V, Vin will be 6.3V. This is too low for the auto-voltage selector which will also attempt to connect it to the USB. Also the hardware page for the Uno says:

Input Voltage (limits) 6-20V

So connecting the power port to 6V would mean Vin would be 5.3V, which is definitely under 6.6V. [/quote]

Yes, it is a pretty 'fragile' design and consumes too much board space and uses too many components for the problem trying to be solved, IMHO. The first original arduino USB board used a simple 3 male pins with a jumper clip. You placed the jumper at one side for USB power and the other side for external power. Simple, fool proof, and effective. They might have considered upgrading to a manual two position switch like the Seeeduino designs uses, but they went with an over-engineered design that adds more costs then required for the function needed. Plus if you power the board with an external regulate +5vdc wired to the shield +5vdc pin (as many users do), there is no isolation from the USB port when uploading or using the serial monitor. I know, Artist don't deal well with jumper clips, and OMG they may lose the jumper clip. ;)

The Seeduino design went one step further and powers the on board FTDI chip from only USB power, cleaver as if you have nothing plugged into the USB port why would you want the FTDI to consume +5vdc board power? That would help in battery powered projects. And speaking about battery powered application, maybe have a trace cut pad so the on-board power led can be disable for power sensitive applications. There is still room for the Arduino to continue to improve the design of the basic board instead of just concentrating on adding new features.

Lefty

I like the idea with a jumper clip or perhaps a clearly marked slide switch as a means to select power source, but I’m not confident that below is a good idea to copy:

retrolefty: The Seeduino design went one step further and powers the on board FTDI chip from only USB power, cleaver as if you have nothing plugged into the USB port why would you want the FTDI to consume +5vdc board power?

The problem as I see it is that you risk parasitic power back feeding through FTDI Rx/Tx. Not only will the chip continue to consume power (although limited by the series resistors), but specifications may be violated and the chip could behave in all kinds of undocumented and potentially harmful (more likely self-destructive) ways. To me this seems like an idea along the lines of what they had for their first Mega design where AVCC and VCC could be powered with 3V3/5V respectively. That is it would be a nice feature to have, but not functional and clearly in violation with specifications.

The problem as I see it is that you risk parasitic power back feeding through FTDI Rx/Tx. Not only will the chip continue to consume power (although limited by the series resistors), but specifications may be violated and the chip could behave in all kinds of undocumented and potentially harmful (more likely self-destructive) ways.

I hear what you are saying. But Seeeduino has been using that design on most of the their present 328 and 1280 Arduino compatible boards for several years now, and I know at least I haven't had any problems. I suspect the 1k isolation resistors keeps any parasitics from being destructive.

However it's the Arduino auto-voltage selector design I really wanted to discuss. Anyone think it's a well thought out design? They certainly allocated plenty of parts and board space for it.

To me this seems like an idea along the lines of what they had for their first Mega design where AVCC and VCC could be powered with 3V3/5V respectively. That is it would be a nice feature to have, but not functional and clearly in violation with specifications.

Yea, that was quite the brain fart. The next revision they just have a simple 3.3/5 voltage selector switch and run everything at the selected voltage. Yes 3.3v @ 16Mhz, but lots of people run that way inspite of AVR recommendation.

Lefty

retrolefty: I hear what you are saying. But Seeeduino has been using that design on most of the their present 328 and 1280 Arduino compatible boards for several years now, and I know at least I haven't had any problems. I suspect the 1k isolation resistors keeps any parasitics from being destructive.

Instant death is obviously not the issue then, but there is still more to this than meets the eye at first.

The FTDI datasheet (FT232R) states that current draw in USB suspend mode is only 70uA typical (versus 15mA for normal operation). Parasitic power draw may be as high as 5mA (or twice that if both Rx and Tx contribute) and so this design may actually consume far more power than if it was just left powered on also when disconnected from USB. Integrity and stability of the FTDI chip may also be compromised over time.

Another issue is that parasitics tend to cause oscillation and so may generate RF/noise that lead to instability and issues for other components. Examples designs might be a high resolution 24-bit sigma delta ADC or perhaps a sensitive op-amp bridge amplifier circuit. We may then have a case where the design works well with a Duemillanove, but may be unstable or even fail on a Seeeduino.

[quote author=Nick Gammon link=topic=68963.msg513372#msg513372 date=1313296532] But I take your point that, if you connect Vin to less than 6.6V, and then connect the board up to a USB port as well, then the USB is not properly isolated. [/quote]

But am I wrong perhaps? The transistor T1, even if it switches on, will only conduct current "forwards" (from USBVCC to +5V) and not in the opposite direction, won't it? So it isn't really putting parasitic power onto the USB bus?