Arduino measurements of high voltage

I am trying to build a solar system monitoring system using Arduino uno and various other devices. My problem is measuring DC voltages from the solar panels and the battery. Why… because the charge controller isolates them because of pwm charging. So when I try to measure them the grounds no longer become isolated. So I tried 2 ads1115 with voltage dividers to get from 25vdc max to 5v for the ads1115’s and an isolated power supply for the Arduino… but still burn up the ads1115’s… any idea as how to measure isolated DC voltages with 1 arduino?
jkidder3@nc.rr.com

Hi Jack,

Thank you for your inquiry. You could use precision resistors to make sure you are at the 5V you need to hook it up to the Arduino. You can measure the voltage this way by setting a certain Analog pin to call out on your serial monitor. Make sure that the voltage does not exceed the 5V as this could possibly damage the Arduino.

I guess you don’t understand my problem.

On the input side of my solar charge controller are solar panels.

On the output side is q battery.

The charge controller isolates them because of the way it was designed maybe because of PWM charging of the battery.

If I try to connect the grounds of the input of the charge controller and the battery the controller doesn’t work.

So when I try to measure the 2 isolated voltages it destroys my ads1115… which has a proper voltage divider input to it to reduce solar pannel and battery voltages to less than 5vdv… I use the ads1115 so I don’t damage the arduino.

Hi Jack,

Sounds like you need to isolate the ADC on the solar panel side, referenced to the panel ground, but keep the Arduino on the battery side, assuming that the battery is powering your main system.

There are I2C isolators which can transmit I2C data across an isolated boundary, allowing your Arduino to stay on the battery side while still communicating with the ADC. Here are some I2C isolators to consider. Most of these require a separate isolated power supply to provide power across the isolating barrier, but the ADM3260A actually produces its own power supply along with the isolated I2C interface in a single package. It can supply 5V at 150mW to power itself as well as relatively low-power devices like the ADS1115.

Here’s a typical block diagram:
image
Note that they also use an LDO to drop the supply voltage to the ADC in this case. That may not be necessary in your application, but an LDO also reduces noise on the supply voltage, which can be useful if you need very high precision measurements. For prototyping purposes, we also carry the ADM3260A on a little board from MikroElektronica, the MIKROE-2609, shown here:

image

The ADS1115 has four single ended / 2 differential inputs so only one IC is needed and in fact you only need to use half the inputs. Basically you should be using just Differential channel 1 on a single ADS1115 .

That should not be happening if you have a truly isolated power supply on the Arduino and the voltage divider is correct.

You can check the voltage divider resistor choices by hooking up just the divider and measuring the output voltage on a multimeter.

Do you have anything else connected to the Arduino?

A USB or serial connection will bypass the isolation of an isolated power supply because they are referenced to earth at the PC.

I’m an electrical technician… and the reason for using individual ads1115’s is because I destroyed too many by trying to read both voltages on a single one.

So I am using 1 ads1115 to read 2 current sensors Hass 50’s. I am using 1 ads1115 to read solar panel voltage which never gets above 22vdc and 1 ads1115 to read the battery which never gets above 14vdc.

My biggest problem has been finding programmers reference manual for the ads1115’s. As I think that could be a part of my problem. I am setting the gain slightly different on the ads1115 reading the hass50’s but haven’t had an issue with that one yet… only the 2 reading the voltages.

All I can find are program examples and an ads1115 document that explains some but not everything pertaining to Arduino programming.

Oh… and I have 2 30amp current sensors ACS712 Reading current off 2 separate solar panels.

OK I misunderstood your opening post, one point I was making stands, you want to use differential mode for your voltage measurements because there is no common reference signal ground.

On the programming side take a look at the following Adafruit page and the full ADS1115 datasheet from the TI website.


http://www.ti.com/lit/ds/symlink/ads1113.pdf

No problem… hate having to condense info due to trying not to spend all day typing.

Yes, I use differential mode and due to lack of information as to switching, switch over, other ads1115 mux info and other internal chip information is why I ended up using 1 ads1115 for each voltage source… just in case.

But still ends up destroying one or more during operation… on the bench it all seems to work, but attach it to the running system not so much.

The info you mention contains a lot of good stuff but really lacks in programming to arduino and other areas… I have been in touch with TI but they point to Programmers on the Arduino side.

Again one of the pieces of missing info is if I change the resolution or scaling I am trying to do it to only 1 of the 3 I am using… the one reading Hass50’s… but if programming is changing them all that could be a problem.

How do you have separate address’s set up for both of the chips you are using?

I’m not sure if you would be able to set each chip individually with gain, however, you will get incorrect readings if you have them all set to the same address.

Also, did you change the gain for the chips?

Looking through the Adafruit examples from the library mentioned in the link above, once the gain is changed from the default 2/3 gain, the chip is not able to read the same amount of voltage. It looks like once you change the gain to a 1x the voltage range changes to ±4.096V instead of the ±6.144V of the 2/3 gain. The voltage range keeps dropping with each increase in gain.

If your ADS1115 is being damaged, your code and register settings are not your primary concern. As long as you have it physically connected properly (proper isolation, not exceeding voltage limits of device, etc.) it may or may not behave as you expect, but it shouldn’t be damaged. However, since it IS being damaged, it is almost certainly from one of the following issues, in order of likelihood:

  1. You have an isolation issue. You need to make certain that everything connected to the Arduino and the ADS1115 either uses the same ground reference or is galvanically isolated from them. Based on what you have described, your solar panel is isolated from the battery, and therefore, you can’t assume the grounds are at the same absolute potential. This includes any USB cables used. If you do not isolate the Arduino from the ADS1115 measuring the solar panel voltage, then you must tie the Arduino ground reference to the negative voltage of the panel. Additionally, you must then isolate the Arduino from the battery voltage and from any USB cable you happen to be using. (We do sell USB isolators, such as - USB-ISO or BB-UH401-2KV).

Regardless of how your system is connected, it is also essential that the ground pin (Pin 3) of the ADS1115 is electrically connected to the negative terminal of the solar panel. If the Arduino is on same ground plane as the ADS1115, then only one connection, via the Arduino, is necessary.

I would instead recommend isolating the ADC from the Arduino, as I described above. This allows you to keep the Arduino ground at the same potential as your battery ground. If you choose to connect it this way, be certain to connect the ground pin of the ADS1115 (pin 3) to the negative terminal of the solar panel. The point is that you cannot connect various parts of your circuit with different ground references together without damaging something unless you galvanically isolate them.

  1. Your voltage divider is not what you think it is, as PaulHutch stated. Get that wrong, and the ADS1115 will be damaged.

  2. You have an ESD problem. If there is a lot of noise on the panel voltage rail, it could be damaging the ADS1115. You might want to look at mitigating this by placing a TVS at the output of the solar panel to clamp the voltage seen by your voltage divider network. If you have a scope, you could take a look at that signal and get an idea of how noisy it is.

I failed to emphasize on one other thing in your system. You can not measure both the solar panel voltage and the battery voltage without isolating one or the other from the Arduino. You MUST isolate one of the two, or both.

As you stated, the grounds of the solar panel and the battery are isolated, so one of your ADC’s must be, as well. That is also a reason why you could not use a single ADS1115 - the different channels are not internally isolated from each other - they all use the same ground reference and have a maximum common-mode voltage of 5.5V.

Your current sensors, on the other hand are not a problem, as they are galvanically isolated from the current they are measuring.

1 Like

@Jackkidder3, Sorry, came late to this thread, here are the Voltage/Sensors INA219 we use on the Digi-Key Weather Station: 3x solar panels (20V @ 0.5A each)…

https://www.digikey.com/product-detail/en/dfrobot/SEN0291/1738-SEN0291-ND/10279750

https://www.digikey.com/eewiki/display/WeatherCenter/Gen+2020+DFRobot+Lead+Acid+Charger

While the current charger is no longer Arduino based, the previous one was, here is the old sketch…

Regards,