Arduino Voltage Meter Wire Burnout

Hello.

I recently built an Arduino Circuit using the Mega 2450 Rev.3 to monitor 6 x heavy duty 12V lithium ion batteries for a electric boat project I have been building. They are wired in series produce 72V but are monitored individually.

The Board was running for a week or so, giving me lots of useful information for software purposes and battery balancing. Unfortunately a few days ago it turned it on and started getting seriously erroneous readings. I had a look at the circuit and realized one of the grounding wires measuring the voltage to the arduino had completely burnt out.

I am keen to get the circuit back up and running but also want it to be safe as it will be at some point automatically monitoring the batteries and controlling charging.

I would really appreciate if anyone had any ideas of what might have caused this failure or to comment on the circuit design, and how I can protect it going forward.

Below are a few details about the circuit along with the schematic.

All main measured batteries are fused with 5A fuses.

These main battires are connected to DPST Switches which connect to power Resistors which are used for battery balancing.

Each of the batteries is also connected individually to a 5 channel DPDT relay board. which using digital input from the arduino effectively cycles though each battery outputting a voltage at one the the terminals.

The Voltage that comes out of the DPDT relay board, goes through a voltage divider before being measured at A0 Arduino Output. I cant remember the exact resistors used for the voltage divider but the 13.3V fully charged battery gets read at around 2.5V. they are 0.6W resistors.

I am using an external voltage reference on 5V which is powered via the Arduino (I am aware i am loosing a fair bit of sensitivity using 2.5V voltage divider on a 5V source but I was experimenting with different values)

The Software running on the Arduino uses analogue referance (EXTERNAL) and cycles through the different batteries waits a few 10th of a millisecond and then takes 60 readings averaging them and sending via serial to a computer ( I had to take around this, as on charging, i was getting fluctuations and needed about this to create stable output)

I have some ideas that I might need to somehow current limit readings further but I assumed the resistors were doing a good enough job on this.

I also though as one of the battery fuses is blown there may have been a short circuit on the switches front when wiring.

Any thoughts most welcome.

Regards

Nick

[/img]

Hello Quertynb, welcome to the forum.

Your descriptions doesn't match your diagram, which makes it hard to diagnose the problem.

6 x heavy duty 12V lithium ion batteries for a electric boat project I have been building. They are wired in series produce 72V but are monitored individually.

They are not wired in series in the diagram, they are completely not wired to each other at all.

Each of the batteries is also connected individually to a 5 channel DPDT relay board.

Is '5' a typo?

I am going assume that the 6 batteries are in fact wired in series and leaving that off the diagram was either a mistake or an attempt to simplify. My advice is not to simplify, the problem might be in the bit you missed out.

I'm going to take a guess at what the problem is, one of 2 things:
Possibly 2 of the relays operated at the same time, or one of them stuck closed, then a second one operated, comes to the same thing, you are then shorting batteries out. That would account for a blown fuse but not the yellow wire melting.

Or possibly the ground on the measuring circuit came into contact with the battery ground, meaning it provided a short circuit path when any but the relay at the ground end of the relay chain operated. You should daisy chain the relays so that if 2 operate only one connects to anything.

I have assumed also that the lack of connection between the Arduino circuit ground and the battery circuit ground is deliberate because you have realised they cannot be connected.

In terms of design practice, having a ground which cannot, because of the design, actually be connected to ground, is poor design at best, and possibly dangerous. In your design the Arduino ground and the computer can be at something like 60VDC above actual ground, this is an accident waiting to happen.

A flying capacitor circuit would solve all your problems.

And ++Karma for posting your diagram correctly on your first post.

Hi Perry

First of all thank for for your quick response and for giving the circuit a look over

You are completely right the diagram is not completely accurate.
I have uploaded and more complete diagram which shows the batteries correctly wired and the 12V battery which supplys the inverter correctly named as an auxiliary battery.

The DPDT relay is one of these cheap Chinese relays with 10 DPDT relays which I only need to use 5.
The relay as you advised is daisy chained so even if all the relays are
on at once there is only one physical connection between a battery and the voltage
divider.

Just regarding the ground connection. are you saying that the circuit is currently unsafe given the physical connection to
any of the individual battery grounds or only if the circuit is connected to battery bank ground and then referencing other individual batteries that may be anywhere from 12-60V above the actual ground ?

As for flying Capacitor circuit, I have read up a little on them so thank you for pointing me in the right direction.

Should I integrate a capacitor at the end of the relay circuit so that each time a connection is made to a battery via the relay array it charges the capacitor. I could then have a relay that cycles the capacitor connection between the battery selected and the arduino voltage divider, would this mean the battery would be fully isolated from
the voltage measurement?

The only thing with this if I have understood correctly would be that when switching
between different batteries if the capacitor was at a higher voltage from a previous charge
cycle there would be reverse voltage back into another battery which could blow the fuse.

I feel like i need to do a bit more electronics homework for this. :frowning: :frowning: :frowning:

Any other advice most welcome.

Regards

The DPDT relay is one of these cheap Chinese relays with 10 DPDT relays which I only need to use 5.

I don't get why you are saying you are using 5 relays, or is it because the daisy chain means the first relay switched between V7 and V6?

Just regarding the ground connection. are you saying that the circuit is currently unsafe given the physical connection to
any of the individual battery grounds or only if the circuit is connected to battery bank ground and then referencing other individual batteries that may be anywhere from 12-60V above the actual ground ?

Err, um :confused: I've read that several times and I am not clear if....

You have 6 * 12V batteries in series, it is normal practice to connect one end (usually, but not always, the -ve end*) to ground, that way you have a definite reference point for everything else. Your diagram doesn't show either end connected to ground. If you are not going to connect any part of the circuit to ground then you have to have a good reason for not connecting and you have to make very sure it stays not connected, because everything else you are doing is then relying on the whole circuit never coming into contact with ground, even under fault conditions. Connect one end of the battery to ground, probably the -ve end. You cannot have different grounds, there is only 1 ground, if you don't believe me go outside and look around.

Now you've done that you have a testing circuit WILL have its ground connected to: battery ground when V7 relay operates, 12V when V6 relay operates, 24V when V5 relay operates...you get the idea. So, if testing circuit ground comes into contact with real ground something will go bang, quite possibly your yellow wire.

As for flying Capacitor circuit, I have read up a little on them so thank you for pointing me in the right direction.

OK, good, because it's late, I'm tired, I didn't want to have to draw one for you.... :o

Should I integrate a capacitor at the end of the relay circuit so that each time a connection is made to a battery via the relay array it charges the capacitor. I could then have a relay that cycles the capacitor connection between the battery selected and the Arduino voltage divider, would this mean the battery would be fully isolated from
the voltage measurement?

That sounds about right.
I first saw the flying capacitor concept on here and thought "that's brilliant, I wish I'd thought of that!". I've never actually made one. Flying capacitor

If you are concerned about excessive currents with the flying capacitor something like a 220 ohm resistor in series with it will limit charging currents to something reasonable, in any case, no sensible size capacitor is going to blow your fuses. Remember that the voltage across the capacitor is only ever the voltage across 1 battery, roughly 12V.

Speaking of fuses, please put a fuse between the batteries and the load, possibly between V4 and V5. A short circuit on a 72V battery could easily result in 1000A or more, and that means a fire or worse very quickly. The fuse should be HRC (high rupture capacity) because 72V will draw and arc and the current will continue to flow. HRC fuses have sand (or something) in them to quench the arc.

*I work in telecoms, telephone equipment is earthed at the +ve, so runs on -50V. I believe this is so that earth currents do not corrode the exchange earth connection.

Many Thanks for your Reply.

I built a new test circuit with the some 10uf capacitors and voltage dividers
and did some charging discharging measurements with the arduino and a handheld voltmeter.

I was expecting the capacitor to discharge a little bit during measurement effecting the final
output but I was getting pretty significant decay of the original voltage. This was partly due to the voltage divider being connected between the capacitor and the arduino but even when the capacitors were read with just a multimeter and a 10K resistor there was significant discharging.

I was measuring with a frequency of 10ms with the Arduino and did not get any two measurements with the same value.

I put a few capacitors in parrallel along with some additional resistors however the signal still decays too much on measuring. I have read that the input to analog pins has to have below 10K impedance so I guess I cant just keep increasing the size of the resistor from the capacitor to the
analog pins without negatively effecting the arduino ability to read a voltage.

I read about OP amps recently especially the voltage follower circuit, and think I may have to integrate this circuit after the charging capacitor to ensure there is a stable low impedance source for the arduino to read that also doesn't discharge the capacitor too fast.

I am hoping this works, and thank you very much for pointing me in the right direction.

Nick

Hi,
Can you post a copy of your flying capacitor evaluation circuit please?
Just for one cell will be enough.

Thanks.. Tom... :slight_smile:

Try putting your resistive divider on the charging side not the reading side of the flying capacitor circuit. You want to end up with the capacitor charged to a voltage that can be directly connected to the analogue input without a divider, then there won't be any discharging before the measurement is taken. I would expect* that a 10μF capacitor connected to the analogue input for the amount of time needed to make a measurement would work OK.

*I've never built a flying capacitor circuit, so I am talking about what I think would work based on my knowledge of electronics. As Tom says, a circuit diagram would help!

Hi.

The first circuit made was as you thought with the voltage divider on the Arduino side. (note I put as many capacitors as i had no other particular logic behind the flying capacitors_

I was noticing rapid discharges, and as you said this was mainly due to the voltage divider discharging the circuit.

I then though I would just do manual measurements charging up the 3 x capacitors with 12V,disconnecting the power source and watching the voltage discharge on a multimeter. as per below diagram

This is at which point it thought I would need to use an OP amp as I was charging the capacitors and even with 40K of resistance when measuring with a multi-meter I was still getting significant voltage decay.

Upon reading the messages this morning I rebuilt the circuit again as follows with the voltage divider on the input side

And Amazingly it worked !!! voltage held steady with readings on the Arduino stable for at least 10 secs before decay.

I was confused how this could work as per my previous experiment with the multi meter was showing fast voltage drops.
It turns out that if I charge the capacitor bank to around 3.5 V it holds it's value during measurement, but if I charge it to 12V it quickly decays. I think i need to read up on capacitors, but I guess the 4 x higher voltage may have discharged 4 x quicker?

Either way I am happy with the final outcome, There will be a few bits to tweak like the input voltage divider to make the capacitors charge a little faster but I think it might be ready.

It turns out that if I charge the capacitor bank to around 3.5 V it holds it's value during measurement, but if I charge it to 12V it quickly decays.

What voltage are the capacitors rated at? Are you exceeding their rated voltage at 12V? Or maybe you have a leaky capacitor. Or are you connecting them the wrong way round?

I have just tried 470μF on my DMM and it decays very slowly, I didn't time it, but maybe a minute to drop half a volt.

Have a read about time constant which explains how long it takes a resistor to charge or discharge a capacitor when you know the value of each. As a rough rule of thumb* it takes 5RC seconds to completely charge or discharge a capacitor through a resistor.

*Rough because in theory you can never completely charge or discharge a capacitor through a resistor, but for most purposes 5RC seconds is close enough.

Put the voltage divider BEFORE the relay contacts and you only need a small cap, like 0.1 uF or less.
flyCap.png
Pulse the relay just long enough to charge the cap, then read the NC contacts.

flyCap.png

PerryBebbington:
What voltage are the capacitors rated at? Are you exceeding their rated voltage at 12V? Or maybe you have a leaky capacitor. Or are you connecting them the wrong way round?

I have just tried 470μF on my DMM and it decays very slowly, I didn't time it, but maybe a minute to drop half a volt.

Capacitors are all rated above 25V and are connected the right way round. I guess a minute to decay half a volt sounds about right from what I was measuring as well. I think you are right about the RC constant, seems like gradient of the voltage decay is much less than at top of range voltage of the capacitors. I would have thought the voltage decay would have been the same from whichever voltage you start discharging from but i guess not.

Makes me think whether it would be better have higher voltage capacitors on the input which might give an even more stable input.

Either way, I am happy with the reading stability for the time being. and it is enough for my purposes.

Would like to thank everyone for their help and advice.

Next Step is to think about building a battery balancer, with all the logic on the software side. but I will leave that for another day.

I would have thought the voltage decay would have been the same from whichever voltage you start discharging from but I guess not.

That depends on what you mean by 'the same'. In percentage terms it is the same, so the time taken to decay from 100V to 30V is the same as from 10V to 3V, however the first example is decay of 70V and the second of 7V.

Hi,
I'm not sure why you are worried about decay, all you do is measure the capacitor voltage immediately after you switch the capacitor over from battery to controller analog input.
The read time only needs to be one or two samples in your code then you store it.
This would be allowing for relay delay, 1/8 or 1/4 of a second, then read.

How often do you aim to sample the battery voltages?

I would now be setting up a test circuit with code to see what sort of timing is needed for relay switching and accuracy/consistency of the analog reading in the code.

Tom.... :slight_smile:

TomGeorge:
Hi,
I'm not sure why you are worried about decay, all you do is measure the capacitor voltage immediately after you switch the capacitor over from battery to controller analog input.
The read time only needs to be one or two samples in your code then you store it.
This would be allowing for relay delay, 1/8 or 1/4 of a second, then read.

Hi. With the current setup I am no longer worried about decay as I am getting stable measurements over a new seconds so as you said a few hundreds of a second to read is even less of a big deal.

As for sampling rate, I am aiming to sample the whole pack every 5 secs, this is being generous with 500ms capacitor charge time, 200ms relay and 100ms read. Comes out at around 4.8 secs for 6 batteries. I have calculated the necessary voltage divider for this.
You are right however, I should set up a bit of a test circuit to get all the timings right. I am not too concerned about sampling rate either as I have implemented alot software side warnings that give plenty of stats about upcoming battery states.

My original circuit setup which somewhat melted !! took 50 random samples over a few 100th second as it was required to get a stable reading, I suspected there was some ripple current coming from the charger. I realize there is no point sampling the capacitor more that lets say 3 times per cycle, for error purposes only. I am hoping the input capacitor post voltage divider will do a good job of buffering the slight ripple during charging and give a stable reading for the the main reading capacitor.

I will get on to building this all now

Thanks for everyone's help.