Go Down

Topic: Multiple Volt/Amp Sensors on common + rail (Read 74 times) previous topic - next topic


I have a need for a circuit for an Arduino project. I need to monitor amps/volts for three sources. They are all "12V" but that's only theory. A solar panel array of about 220 watts peak can go as high as 19V without load. The charger and "12V" battery can go as high as 14.8.

I want to read the Volts on the solar panel and the amps currently being used. This can be up to 19V and 20 Amps. Amps should never be negative.

I want to read the volts at the battery, and the amps going into the battery (+) or coming out of the battery (- amps when discharging).

Not required, but nice to have, would be voltage and amps going into the load. The voltage really can't be different than the battery voltage. Amps may be higher than what's being pulled from the battery because it could be getting at least part of the power directly from the solar panel.

I would like to connect this sensor module(s) using I2C for simplicity. Because everything is powered from a battery, I would also like to be energy efficient. Low quiescent and/or shutdown ability.

My design used three Adafruit INA 219 breakout modules. That failed and I realised that the (explitiv deleted) charger module had a common positive rail (solar panel, battery and load).  Connecting the INA219s to a common ground resulted in smoke signals of course.

I would prefer a design that I can build myself and to do that the design requires none or very limited use of SMD chips.


The first thing you should do is draw a diagram your circuit showing the various supplies, battery, and load and indicate what points you want to monitor. Right now I'm guessing at what it looks like and odds are, my guess is wrong.
Electronics and firmware/software design and assistance. No project too small


I have a solar "battery charger". https://www.amazon.de/gp/product/B00MNYVF1Y/ref=oh_aui_detailpage_o07_s00?ie=UTF8&psc=1

It has two terminals to attach solar panels. Two terminals to attach the battery. Two terminals to attach the load. The software within the charger will automatically turn the load off to prevent extreme discharging of the battery.

I will attach two "100 Watt" solar Panels. No load voltage up to 18 Volts. I also attach two 45AH 12 volt batteries.  The load is attached to a heating element and is approximately 80 watts.

The Arduino should monitor the temperature of a 200 liter drum which is to be heated.  The drum should be kept within a certain temperature range. The Arduino should also monitor the solar panel and battery state.

The idea is that the solar panels charge the battery through the charger. The Arduino can detect that power is available from the solar panels which is not being used to charge the battery. When this excess power is available and the barrel is not at its maximum temperature, the heat will be on.  If the temperature goes below the minimum temperature, the heater will go on and draw power from the battery.

So, the circuit I Need allows the solar charger to do ist Job and diverts Surplus power to Keep the Barrel warm


This looks like a simple solar charger, that  does not use MPPT & step down voltage converter.
That means when it is charging the panel voltage drops to battery voltage level.

You can compare voltages to know if the charger switches on or off the battery charging.

also is possible to control the heater with PWM, in a way that does not drop PV output voltage to lower than say 16V, so whenever battery charger draws large current from PV (and voltage drops below 16V) you stop the heater.

When the heater is switched to battery also is sufficient to monitor battery voltage in order to avoid excessive discharge.

Direct water heating panels are much more efficient/cost effective than PV:
-  One kwh will raise 200l water temperature with only 4-4.5 centigrades.
- There are not many days in which 200watt of PV will collect 1kwh.
- Battery life is seriously affected by deep discharges, 1kwh out of  2x12Vx45Ah batteries is >90% discharge.


You are correct. MPPT is not implemented. You are also correct, if the voltage on the Panel remains high, that means the charger is not using the available energy. That is exactly what I want to detect and reroute that energy to the heater. I have kept the Option of PWM for the heater open so that I can match the heaters consumption to the available energy (in a future Phase of the Project).

I cannot use direct solar water heating. On a small scale, pumps that can withstand the heat aren't cheap either. I Need the electricity because the battery also drives the Arduino, sensors, etc. as well as a pump for a few minutes per day. There is no heat extracted from the Barrel (except what escapes through 12cm of styrofoam insulation). If you are curious, the Barrel is a small Biogas digester. The bacteria provide some heat themselves but not nearly enough. They Need help (from the heater) to remain at a temperature to function well.

You are correct that I Need to Monitor the battery to prevent excessive discharge. Exactly at this Point the Problem Comes in. The Volt/amp sensors I have seen thus far (keeping in mind that I want to use I2C) require the sensors to be attached to the Arduino ground and the negative of the circuit whose Volt/amp is being monitored.  Because the charger already has all the positives connected together, connecting the negatives of two or more such sensors causes a short circuit. Both positive and negative of solar Panel, battery, and load are thereby direct connected. Excellent for sending smoke signals but bad for power Management.


Today at 12:41 pm Last Edit: Today at 12:57 pm by blimpyway
I would like to connect this sensor module(s) using I2C for simplicity.
I think this is a wrong perception problem.

All you need - for the problem you described - is to measure two voltages: The voltage between PV positive lead and ground and the voltage between battery positive and ground.

For that you need only two voltage dividers, == 4 resistors to feed two analog inputs in arduino and no other sensors. No short circuit whatsoever.

But still...even if that is well insulated barrel, 200l with 10cm insulation would need at least 700wh/day to keep its interior at 40degrees over ambient. In long winter days without sun, you will not have enough sun to keep its temperature, 200watts of PV  will barely give 100wh in a cloudy day.

So you will need to have a small hot water pipe passing through the barrel to provide that needed heat with fire, either using wood or part of the biogas you collect.  Not much needed, burning 300g of biomass or 100l of methane/day  will give sufficient heat to keep the digester from dropping its temperature.


You say DC circulation pumps are expensive, which is generally true, but you don't have to mount it at the outflow of the hot water panel (hot water that goes into barrel) you can put it as well on the inflow pipe of the panel - and there you will be water coming out of the barrel which will not have more than 60centigrades, otherwise your bacteria will be dead.

There are cheap 12V plastic pumps with brushless motor (which means long life, no brushes to wear) that can easily survive up to 80-90centigrades.  Nothing powerful is needed, 3l/min of water at 10 centigrades difference will put 2kwatt of heat into the barrel. More than sufficient, a 2sqm flat panel will do, and with an temperature-aware arduino controlled valve you can redirect its excess heat into a domestic hot water barrel to save a lot of biogas for water heating.

Here-s a crappiest pump I quickly found at 9 euro, that will do the job.

Price isn't that prohibitive
Here-s one at 18euro, rated for 100centigrades and 6.5l/min. .


While I truly appreciate your zealousness in helping me with the design, I have been working on this device for almost two years. In the beginning, I planned on doing the heat directly from solar. I pitched that idea for several reasons. The ultimate Goal is to have this device run more or less autark and the total device also has other components. The Arduino and sensors as well as a small pump to move extra gas to a high pressure storage tank all require electricity. I can't get around the solar Panel, battery, charger, etc.  If I use direct solar heat, I have to run additional lines and they will Need to be insulated and the holes through the walls larger, etc. I also Need to provide for a drain-back (the best way to protect against freezing) which also means an additional tank for the fluid to drain into. I also start having Problems with Placement. Electric lines are pretty uncaring about Placement, length, etc. (assuming proper sized). If the Biogas digester is in the Basement of a two Story house (plus attic), I have around 8 meters to overcome. No Problem for electricity, but for example the pump you suggested only handles 3M static head. For These, and other reasons as well, I dumped the idea of direct solar heat.  A backup System for electricity could be easily done using the AC power of the house (though violating my own desire of it being autark). If I find that the solar Panels and/or battery are insufficient, I can scale it pretty much at will.

I don't think using 4 resistors will work. The analog pin of the Arduino will measure voltage between the Center Connection of two resistors and ground. The Arduino ground has to be connected to the negative pole of the voltage being measured.  Do that twice and the two circuits being measured have a common negative ground. Since in this case they already have a common positive Connection, I get unregulated voltage from the solar Panel straight to the battery through my measuring circuit. I couldn't measure the 18V of the solar Panel because the battery would pull it down and the solar Panel will eventually fry the battery by overcharging it.  Or, have I got something totally wrong here?

I am off work right now (3 days sick leave) and have been doing further Research. I have found what are called I2C Isolators (ADUM1250 I2C Isolator) and also a Volt/amp sensor with build in I2C with split SDA which means optical Isolators can be used. There are Problems with Speed but it seems the 6N137 is fast enough. I'm not sure I can put the two schematics together into one. Maybe I will post separate threads on those Topics and see if anyone has any experience that way.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131