Author Topic: Using the same battery to power both Arduino and motor load?  (Read 311 times)

0 Members and 1 Guest are viewing this topic.

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: us
Using the same battery to power both Arduino and motor load?
« on: October 28, 2024, 10:57:19 am »
Hi,

I'm using the Arduino Nano for a project that involves a DC motor that comes with its own driver. The fan uses 12V and I have a 12V battery pack for it. To avoid using a separate battery for the Arduino, I hope to use the same battery to also apply 12V to the VIN pin of the Arduino. Even though the battery voltage might drop as it gets depleted, I don't think this will be an issue as the Arduino VIN pin can take 7V to 12V.

I'm not sure if the fan might interfere with the stability of power to the Arduino if used this way. The motor draws around 0.4A and seems to be a brushless DC type. (similar to PC fans).

As a side question, I wonder if there are "in-line" ammeters that I can connect in series with the load? I know it's possible to roll my own, but I wonder if there are "off the shelf" ammeters that I can just connect two ends in series with the load and it'll show me the current on a small display?

Thanks
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 2132
  • Country: is
Re: Using the same battery to power both Arduino and motor load?
« Reply #1 on: October 28, 2024, 12:39:07 pm »
Second question first, Of course there are ammeters you can connect in series. Just look on Ebay and pick your favorite style, front facing, edgewise, analog, digital? Your motor being .4 amp run may have a 4 amp start up current. You may want at least a 2 amp scale meter. As for power from the battery to the nano, perhaps a 1 ohm up to maybe 2.2 ohm resistor in series from the battery + to the nano and a bulk capacitor from the nano side of the resistor to battery negative. Suggesting 2200uf at 16v or even 25v. The motor wiring could radiate noise so the motor wires should look like a twisted pair. Any ADC functions will probably require a regulated supply voltage. Not sure exactly what you have in mind as your project.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline PGPG

  • Frequent Contributor
  • **
  • Posts: 384
  • Country: pl
Re: Using the same battery to power both Arduino and motor load?
« Reply #2 on: October 28, 2024, 01:29:08 pm »
but I wonder if there are "off the shelf" ammeters that I can just connect two ends in series with the load and it'll show me the current on a small display?

Most digital multimeters:
- are "off the shelf",
- can be used as ammeter,
- have small display.

Panel analog ammeters like this:
https://kamami.pl/en/ammeters/235103-analog-panel-ammeter-0-100-ua-5906623401314.html
or this:
https://uk.rs-online.com/web/p/ammeters/9010368
can work powered only by current.
Any digital ammeter need a battery or other voltage source, I think (I don't know any digital display working supplied with for example 0.1V drop that exists at ammeter).
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 6893
  • Country: ca
Re: Using the same battery to power both Arduino and motor load?
« Reply #3 on: October 28, 2024, 02:33:32 pm »
same toughts

If the panel meter works from the main line and all dies,  you don't have any display ... always use secondary supply for the panels meters,  when possible

some panel  even in serial need at least 3 wires, they will not supply themselves thru a shunt resistor, the voltage drop is very low

they will sense by the positive or the negative line
 

Offline Infraviolet

  • Super Contributor
  • ***
  • Posts: 1172
  • Country: gb
Re: Using the same battery to power both Arduino and motor load?
« Reply #4 on: October 29, 2024, 07:50:12 pm »
You can do this, you just need a voltage regulator to take the motor's high voltage and provide a lower voltage for the arduino. I cannot rememebr the usual max voltage for an arduino's onboard voltage regulator (if powered via the DC barrel jack), it might be 12V, or maybe 15V? Check for your board, it may vary between exact models. For a 12V battery you're going to have a bit more than 12V when it is freshly charged and not much current is being drawn. The arduino board contains a linear regulator, quite inefficient but ok for the low current an arduino typically uses. If it isn't able to handle the voltage of the batteries, or if you're powering a lot of low voltage sensors as well as the arduino, then buy a switching regulator, pololu sells a lot of them as "step down" DC regulators/converters. It sells a variety with a 5V output, each capable of different maximum currents.

The really important thing here is to put plenty of decoupling capacitors between the arduino's Gnd and 5V rail, this way if the higher voltage supply which is powering the motor drops so severely (like during a sudden start) for a moment that your lower voltage regulator hasn't enough voltage to run, then the big caps (several 100 uF, you can get big SMD ceramics of 100uF each 5V rated, but if you use electrolytics instead then parallel them with atleast a few uF of ceramics) wil keep the arduino and any low current-draw logic powered until the higher voltage rail is back to normal and the regulator can work again. Put these decoupling caps physically close to the arduino.

For current sensing, I would not bother with measuring this for the arduino, the current going there will be minimal compared to that going to the motor. For the motor, if you put a very small, but precise, shunt resistance (like 0.05 ohms, you can buy special resistors with this resistance and a high wattage (therefore current) rating) between the ground of the motor driver (you might be using an ESC module when a brushless motor is in use) and the overall ground of the system (which will also be the ground of the battery), you can use an op-amp to measure the voltage across this small resistor. That voltage signal can be amplified by the op-amp so that your maximum expected current (say 4A) corresponds to a 5V signal coming out of the op-amp and a zero current corresponds to zero volts out of the op-amp. 0.4A in the motor would read around 0.5V in this scanerio. You can read that 0 to 5 V signal with an arduino analog input pin, then on the arduino do the maths to convert it back to a current, and print the result to some sort of character display module. I had a thread recently about op-amps for current sensing, the thing I was after (bi-directional) at the time was a fancy feature you won't need here, but some of the simpler circuits discussed in the thread could be exactly what you'd need.
https://www.eevblog.com/forum/beginners/bidirectional-op-amp-current-measurement-for-shunts-with-both-ends-outside-rails/msg5256327/#msg5256327   (see my image on the first post there)

EDIT: this simulator lets you see what I mean about current monitoring via an op-amp
https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCCsB0AM8MUgLAUwLQA4SegJkzAE4B2STTEgZiNskhCtiimcgzDACgqTnMqeKESFh42SCPAhmsHn3DjhoscmXTZXAE7hV6sHnjrZ+LgHNwhtlIPIJUzVQBs2F9kJOQZISUMyZ5jhEniQuQSGYapoA7uFeznGh2HKxRAY4diBpQh4BsZjBGdjZRXlxFPyFkclcqem5bjhgnnI6YrDumJWeFf7trYod8T2F1C2DKYPuglM4XWXt2GOzXZptsL5zzItb-lbaipvLO8vM+wCGK81Z9ddE4AzoYAz9CDLQzZh49AJOzU5UQgQWAfFx4JySKjPZr0TgTeC1Q4+BJiCjDBZ6SQqWBqU6I1FLFF6PGxAxGLGWIy9SZiTa9Mn8eZyZCwKi7Jws2Z8KIyAD6YF5sH532QkEFcHgArAEtIAMw9FZHTwVF5T15eEFvKoXDAJFxkXUjQpEE5ILwIggACVUABnACWNoALucAHYAY1QiJIBopAiEFMmyycQyDkBaXoSEM8wdcYYClpAMcTccgBGT42YnPSsnekC4AHtpDNtshnLr3ggIHhoIIRBs-jRZZAqDzRIwCyA1MWQAAPc5Q9JOfCwJyjviGJzfIjwBggyvSIQgx5EbBdxPQKJcIA
move the resistance up and down to vary the current, see how the output voltage tracks linearly with the changing current. Imagine the variable resistor in the sim represents your motor. The resistor values in this sim are not yet optimised for your use case.
« Last Edit: October 29, 2024, 08:02:38 pm by Infraviolet »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf