Read solar panel voltage and battery voltage using 1 arduino nano

I am trying to build a solar panel powered box for some low power circuitry (using a small solar charge controller) and would like to measure solar panel voltage+current, battery voltage and load current. I am having a real trouble deciphering how to measure the 2 voltages on the same nano. According to what I have read, I have to connect the gnd from the voltage divider circuitry to the nano ground and also to the voltage source negative side.

In my case, I have 2 negative sides: the solar panel and the battery. I dont believe I can connect these 2 together to the arduino ground. Can someone please confirm if this is correct or not. If not, what are my options?

Thanks

The Arduino measures voltage with respect to its own ground, so to measure several voltages, you must connect all the grounds together.

Please post a photo of a hand drawn circuit diagram for your setup (not a Fritzing diagram).

jremington:
The Arduino measures voltage with respect to its own ground, so to measure several voltages, you must connect all the grounds together.

Please post a photo of a hand drawn circuit diagram for your setup (not a Fritzing diagram).

Please take a look at the attached picture. The problem connection is shown in red. I am not showing full connections (current, controller load, etc) to keep it simple.

Thanks.

What is the "voltage sensor" mystery box?

If you want help with a circuit, post a complete circuit diagram, identifying all the components and their values, and post links to the modules used.

jremington:
What is the "voltage sensor" mystery box?

If you want help with a circuit, post a complete circuit diagram, identifying all the components and their values, and post links to the modules used.

The voltage sensor is this. Sorry for the omission.

That "sensor" is just a 5:1 voltage divider, the V out will be 1 / 5 the voltage in. What is the voltage difference between solar - (ground) and battery - (ground)?

Your photo, posted properly. See image posting guide.

Of course you forgot to post a link to the "solar charger", but if the two "-" connections are common on the charger module, the ground connection in red is already made.

Do yourself a favor and get a decent multimeter, so that you can check voltages, continuity and resistance.

Do not use a lithium based battery in this circuit, if the battery is also loaded. There are no charger modules on the hobby market that can safely charge a lithium battery under load.

Solar chargers can have a common negative, but more often a common positive.
Measure it.

But why are you interested in solar 'voltage', which is somewhat irrelevant.
I would measure battery voltage (negative to Arduino ground), and solar/charging current (high-side).
That could be done with an INA226 breakout board.
Leo..

jremington:
Your photo, posted properly. See image posting guide.

Thanks for the info. I will keep this in mind in the future.

Of course you forgot to post a link to the "solar charger", but if the two "-" connections are common on the charger module, the ground connection in red is already made.

Do yourself a favor and get a decent multimeter, so that you can check voltages, continuity and resistance.

It is a small chinese generic charger and does not come with a manual. The positives are connected together as mentioned in Wawa's post below. I don't know which resistances you want me to measure or why but the solar-to-battery resistance is about 17 Kohm and battery-to-load resistance is 24 Kohm. The solar panel rating is 15 Watts, max 18 Volts and the battery is 12 volts.

Do not use a lithium based battery in this circuit, if the battery is also loaded. There are no charger modules on the hobby market that can safely charge a lithium battery under load.

I am aware of this. I am using a small lead acid battery. Thanks for the warning though.

Wawa:
Solar chargers can have a common negative, but more often a common positive.
Measure it.

Yes, you are right in my case; the positives are connected together.

But why are you interested in solar 'voltage', which is somewhat irrelevant.
I would measure battery voltage (negative to Arduino ground), and solar/charging current (high-side).
That could be done with an INA226 breakout board.

I would like to measure solar panel voltage and current so that I can calculate solar radiation as per this.

I would measure battery voltage (negative to Arduino ground), and solar/charging current (high-side).
That could be done with an INA226 breakout board.

Can you please explain what do you mean by "solar/charging current (high-side)"? Do you mean the current from the solar panel?

Thanks for the replies.

Solar radiation is AFAIK done with a short-circuited solar cell (current only), not by measuring solar voltage.
I wouldn't trust that article.

High-side means in the battery (or panel) + line.
There you can measure/log solar>battery charge current and battery discharge (load) current.
Solar generation is IMHO more practical than knowing solar radiation.
Leo..

As above, to measure solar irradiance, you measure the short circuit PV cell current. The article you linked is simply wrong.

For an Arduino, it is a reasonable approximation to measure the voltage across a low value resistor "short circuiting" a small solar panel (e.g. 6V). Use the 1.1V Arduino reference, and a resistor value that produces about 1V under full sun at noon.

Wawa:
High-side means in the battery (or panel) + line.
There you can measure/log solar>battery charge current and battery discharge (load) current.
Solar generation is IMHO more practical than knowing solar radiation.

I plan to use an ACS712 to measure the current. The docs say to connect this in series after the load. To measure panel current, should connect ACS72 to solar panel +? To measure load current, I should connect another ACS712 to battery + or load +?

Thanks

To measure load current, you can connect the ACS712 between load and ground. The voltage drop is negligible.