Monitoring voltage before and after solar charger - Page 1
Forum section: electronics / projects

author: TomS_
author_rank: Frequent Contributor
timestamp: May 24, 2022, 07:05:37 am
content: Hi all.Im working on a project, and Ive become a bit stuck. I am trying to monitor voltages of a solar panel, and also a battery connected after a charger that is connected to that solar panel.The difficulty is that the solar charger uses a common positive rail, and the negative side is switched.This presents a bit of an issue for how I have designed my circuit so far - my ADC channels are connected to the respective positive terminals, with a common ground. But this simply results in the same voltage reading for both sides of the charger, which is incorrect. Ordinarily I'd expect the positive side to be switched with a common ground.So I need some help figuring out the best way to connect my ADC channels to be able to read these two voltages when the ground is changing. My current thought is to use an analogue multiplexer, something like a 74HC4052, to change which ground reference is presented to the ADC. But Ive also seen that there are some chips out there that can do voltage and current sensing in one package. The only difficulty is that all of the ones Ive found so far only have a single ground connection, which puts me back at square one - I'd need something that has separate grounds for the digital side and the bus side?Does anyone have any suggestions? Ive attached some images with basic circuit details including (roughly) how things appear in the charger based on my own investigations, but I can go into more detail as required.edit: maybe I got the direction of the MOSFETs around the wrong way, but hopefully you get the basic idea - ground is switchedThanks

author: Terry Bites
author_rank: Super Contributor
timestamp: May 24, 2022, 08:51:03 am
content: diff amps? I am guessing no great accuracy is needed so home brew amps will do?Create a negative supply with a 7660 or similar

author: Siwastaja
author_rank: Super Contributor
timestamp: May 24, 2022, 12:09:38 pm
content: What kind of charger? If it's a super cheap crap charger (sometimes marketed as "PWM") which is not an actual DC/DC converter but only connects and disconnects the solar panel directly to battery using MOSFETs, ignoring MPP, then there are no two voltages to sense. Just sense the battery voltage, and it will be equal to the panel voltage during energy production. Unless you want to know the OCV of the solar panel, there is no separate input voltage to sense.

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 24, 2022, 12:44:45 pm
content: there is.. except during disconnection (the time when you want to do PV measurement), the PV -ve terminal will be way below the battery -ve tab, this means you need either dual rail opamp or difference opamp that can accept out of rail (robust) input. once you got |voltage| wrt battery -ve tab, you can just add to battery +ve voltage to get PV open circuit voltage, but this can be much involved such as sensing/tapping mosfet's gate to know its state etc. care also during the night when PV -ve terminal = battery +Ve terminal, your difference amp will supposedly output -ve output, you'll need dual rail anyway, unless maybe you want to do measurement wrt the common +ve terminal. i have such common +ve PPM cheap china unit, made a teardown, and OP's idea passed through my mind, but i think its not worth the effort, so i just let it run as the way it is. i would say they are "not so stupid" at collecting energy from PV, they are less than $10 cheap and are okaish if you dont want to be so particular about wasted energy, a lot better than connecting directly the PV to the battery. ymmv.

author: Peabody
author_rank: Super Contributor
timestamp: May 24, 2022, 02:47:37 pm
content: I have a more basic question about why you would measure the solar panel voltage, along the lines of Siwastaja's comment. I recently worked on using a solar panel with a linear Li-ion charger with load sharing, and what I observed was that, depending on the illumination level, the solar panel always provides as much load current as it can at the battery voltage, and its voltage is therefore equal to the battery voltage. And it's only when illumination increases beyond the point that the panel is providing ALL of the load current that the panel voltage starts to rise. Well, I really don't understand how these panels work, but I wonder if measuring the panel's voltage really tells you anything even assuming you could figure out a way to do it. It seems to me that what you need to know is the battery voltage. Perhaps you could explain how the panel voltage information would be used in your circuit.

author: TomS_
author_rank: Frequent Contributor
timestamp: May 24, 2022, 05:00:53 pm
content: The reason for wanting to monitor the PV voltage was because I was intending to use its voltage, along with some other parameters, to determine when to turn on some relays to connect a second charger which handles a different battery (specifically, that of a motorcycle). The theory was that once the PV voltage had risen sufficiently then I would know I could turn on the second charger. I had also planned to collect some stats about voltage and current and upload over LoRaWAN for graphing remotely.But its sounding like that wont work - my chargers are of the "cheap crappy PWM" type, which uses MOSFETs to switch the battery and load terminals in and out, but via - instead of +.My circuit is powered off the load terminals of one charger, rather than the battery terminals, which means it is "theoretically" on a different ground to the battery, so I think even if I ignore the PV stuff and just pay attention to the batteries, I still need to find a way to monitor a couple of different voltages where the grounds are different.Hope that helps a bit more with some of the "why".

author: Siwastaja
author_rank: Super Contributor
timestamp: May 24, 2022, 05:49:01 pm
content: Use battery voltage as an indicator. High battery voltage -> battery full -> enable charging of secondary battery.

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 24, 2022, 07:15:06 pm
content: Quote from: TomS_ on May 24, 2022, 05:00:53 pmto switch on the Load terminal is using mechanical switch (if what you have is similar to mine) with the mcu in between in turn to control another low side mosfet. if you want to control that terminal that will be quite a mess of hacking and tapping circuit. if you just use battery terminal as power source, you can free the burden and usage to the Load terminal and make your aux circuit much simpler, no different ground mess.

author: TomS_
author_rank: Frequent Contributor
timestamp: May 24, 2022, 09:12:12 pm
content: Ok, so power my circuit from the battery and remove the whole different ground reference faffery.If I also wanted to monitor the voltage of the second battery, how would I go about that? The ground reference issue would still exist because that battery is charged by another charger, right?

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 24, 2022, 11:30:28 pm
content: few that i can think...1) power the 2nd charger entirely from 1st battery using boost convertor of some sort, IMAX B6xx lipo balance charger is one example that can accept 12V input and charge up to 6S lipo including 12V SLA battery iirc. PV will always charge the 1st battery only. you can use Load terminal too if batteries not need the same gnd, additional floating charger like IMAX doesnt care.2) buy another the same cheap PWM solar charger and share the same PV. 2 chargers, 2 batteries, 1 PV... with relay in between PV to 2nd charger only turn on when 1st battery is full etc.btw you didnt tell your entire purpose, so advices can be not suitable for you.. YMMV.

author: TomS_
author_rank: Frequent Contributor
timestamp: May 25, 2022, 05:41:49 am
content: Quote from: Mechatrommer on May 24, 2022, 11:30:28 pmApologies, I am happy to expand to any level of detail required, I just don't know how much is required/relevant to answer the question of how to monitor voltages which have different grounds to the ADC. :-)#2 is what I am doing now.One charger handles an old car battery, the load output powers my circuit and has some lights connected to it via a switch so I can light up my garage which is disconnected from the house (no mains available).The circuit then powers up a second charger via some relays, which is used to charge up a motorcycle battery when I am not using it (more often than not these days in a post-commuting world). When that second charger is turned on was originally meant to be some function of PV voltage, time of day, and motorcycle battery voltage, but I'm happy to drop the PV bit if its simply not going to work like that - it was more of a stretch goal if you will to monitor those parameters.I still think monitoring the second battery voltage will have the same issue with the different ground reference due to the second charger.At the moment my prototype circuit is quite dumb - just turn on the second charger between certain hours of the day. I had hoped to make it a little smarter by only turning it on when necessary/possible.

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 26, 2022, 05:16:59 am
content: If just to topup lost battery charge during the night, then its not so much to do, within few minutes the sun rise, your battery is tip top again, maybe there will be race condition among chargers during that first minutes, but they maybe will find their way, not sure. My pv and charger is just doing that for the last few months to maintain few of my unused sla.