Some beginner questions regarding voltage (and maybe current)

I’m planning a project and have come up against a bit of a roadbump between reading about some things and how I would actually go about applying them, more specifically on the electronics side because ive only learned the software part so far.

Sorry if any of these questions are too basic or may have obvious answers (or are too complicated), I’ve just exhausted my resources and sometimes all you can do is ask.

But part of my project is to measure the voltage from a car battery (ranging from 10-24v, but I would like to measure from 0-25, if possible). I would imagine this would be done through analog pins, but my questions are:

-Does the car battery voltage differ from the Arduino input voltage in a way I might have to worry about something like greater current? If so, would this be circumvented through a voltage divider?

-How could I measure a variable range (for the voltage) without using a potentiometer? Additionally, is there some way this could be set up so you could input a variable range (without having to change the resistance for the input voltage each time), as in a way the Arduino could auto detect the input and adjust itself accordingly?

Thanks!

CatDadJynx:
-Does the car battery voltage differ from the Arduino input voltage in a way I might have to worry about something like greater current? If so, would this be circumvented through a voltage divider?

Use google and do a search for this : "arduino voltage measurement up to 25V"

You will find links like this: click here

They do use a voltage divider.

  1. You do need a voltage divider but current isn't the reason. Reason is that an input pin can only handle up to Vcc (which on most Aduino's is 5V)

  2. Just build it for the largest range, it can do smaller as well. Of course this will limit the resolution in the lower voltage batteries but besides that it's fine. Aka, if you use a 5:1 voltage divider on a Uno you can measure up to 25V with a resolution of 25V / 1024 = 25mV. Is that sufficient?

Also a note, you can never measure voltage on a point, you can only measure voltage between two points. For example, connecting your multimeter just to the positive terminal of a battery does nothing. The reference (the other or 0V side) of the ADC on an Arduino is the GND. Aka, you can only measure if the other side is also somehow referenced to the same GND. This can be for example tricky if you want to measure the voltage of multiple cells individually which are connected in series. Because now you can't also connect the negative terminal of each battery to GND.

Assuming that your Arduino is set to the default analog reference setting, you can read an analog input from 0 to 5 volts. As the Arduino is a 5 volt device, this is the maximum input.

So, for a 0-25 volt input, a voltage divider is required. The Arduino could be programmed to read various input ranges by using relays to set different voltage dividers for the different voltage input ranges, but remember, the Arduino must always start at the highest divider.

It would also be a good idea to include a clamping circuit to prevent the Analog input from voltages over 5v.

Good luck and have fun.

For more accurate measurements bring down the voltage to no more than 1V and use the internal 1.1V reference.

So you'd need a 1:24 divider.

Ah, thank you all so much! I definitely understand voltage dividers and stepping down the input voltage but I don’t know why it didn’t occur to me that since I was reading the analog pin that would be the resolution -_- sorry. Thanks again!

Also, I have a pretty good understanding of Ohms law, but what is the difference between the voltage/current/resistance in a car battery versus a smaller battery?

I just know there’s a pretty big difference and that’s why I was a bit more wary of how it might be input at first :stuck_out_tongue: I also know one of the biggest differences between the two (aside from ‘power’) is that car batteries consist of multiple cells whereas something like a lithium ion battery is one cell, I’m just not sure how the difference is worked out on paper.

Thanks!

CatDadJynx,
I'm curious to know why you want to measure up to 25V for a car battery. If it goes above about 15V something is very wrong. I'd think a range of 10 to 16V would cover all circumstances with a gap at each end of the scale.

Honestly I’m not even sure, if that’s the case, I’m making it at the request of a friend who’s into car audio (for a car audio system) and those were just the specifications he gave me based on something on the market for the same thing. I’ll ask him about that :stuck_out_tongue: thanks!

24V battery maybe?

wvmarle:
24V battery maybe?

No, because then you'd need to measure to 28V when charging.

I agree 25V range is a bit on the high side for a margin but then again, better save then sorry :stuck_out_tongue:

CatDadJynx:
Also, I have a pretty good understanding of Ohms law, but what is the difference between the voltage/current/resistance in a car battery versus a smaller battery?

Nothing really. Like you said, it only has a higher voltage. And it can supply quite a bit of current. That being said, small LiPo batteries can also do that.

CatDadJynx:
[...] is that car batteries consist of multiple cells whereas something like a lithium ion battery is one cell

Not per definition. You also have lithium ion batteries with multiple cells. And heck, a normal 9V battery even consists of 6 smaller cells. As long as you only care about the voltage across the whole battery and not about the individual cells you don't need to differentiate between single cells and batteries (with 1 or more cells).

Sorry, but are there any concerns involving current that I might need to consider, also? Just because from what I gather the current is what’s different between a car vs household battery (and by default, the resistance also), I’m just not sure if this is something that might be an issue when inputting into the arduino

A car battery is nothing special really!

And, might need to read a bit about ohms law. A battery is a voltage source. It can supply current (and a lipo or car battery quite a bit) bit it will not magically do so. It will just follow Ohms law for that U = I x R aka I = U / R.

So if you keep the resistors in your voltage divider pretty high you can see the current will be pretty low. But it doesn't matter what type of battery (or even a power supply!) you connect, as long as it will about the same voltage it will draw the same current.

So as long as you remember not to exceed 5V on an Arduino pin, you don't have to worry about currents other then the one in the resistors (following Ohms law).

I am aware of ohms law, just moreso in theory than application (read about and understand it but haven’t applied it yet), I just wasn’t quite sure of the difference between a car battery and household battery (and still am not entirely sure) and figured it had something to do with that.

I also knew that current and resistance were directly correlated, just not sure why it didn’t click that if the resistance is a set value then the current/voltage would also be changed accordingly (regardless of the current potential of the battery). Thanks!

septillion:
As long as you only care about the voltage across the whole battery and not about the individual cells you don't need to differentiate between single cells and batteries (with 1 or more cells).

Although just about everyone calls a single cell a 'battery' I suggest that the word 'battery' is only correct for 2 or more cells, not for 1 cell.

PerryBebbington:
Although just about everyone calls a single cell a 'battery' I suggest that the word 'battery' is only correct for 2 or more cells, not for 1 cell.

For as long as most people call single cells batteries and understand batteries as including any number of cells then making that theoretical distinction is just a way of confusing most people. Not really in what I think of as the spirit of this forum.

Steve

I am aware of ohms law

I also knew that current and resistance were directly correlated, just not sure why it didn't click that if the resistance is a set value then the current/voltage

I have to ask, are you AWARE of WHAT OHM'S SAYS ?

(because you can't be aware of ohm's law and then make a comment like that. You either know it, or you don't. Being aware that it exists isn't of any value if you don't know what it means.)