News:

;) This forum is the property of Proton software developers

Main Menu

Protecting an ADC input - also used for battery monitoring

Started by Peter Truman, Nov 19, 2024, 04:15 AM

Previous topic - Next topic

Peter Truman

Hi

I'm working on a system that will have a main supply either from a either a 12v SLA (with Solar panel), 12v vehicle battery (so in the vehicle) or, a 24v SMPS mains supply, depending on where it is installed.

I have a supercap module that is able to keep the main 5v rail active for about 30 seconds if the power fails (this system has a modem is intended to send a 'last gasp' sms message in the event of a power supply failure)

I have a 10k / 1k potential divider feeding the ADC

My plan is - primarily to detect the absence of a mains power supply - in this case, the voltage at the ADC falls off a cliff and I trigger the last gasp process.
Secondarily - this same board may be installed where there is no mains supply, it will run from an SLA charged from a Solar Panel. In this case, I intend to monitor the value at the ADC at say 3am every morning - I will track the value in the hope of detecting a failing supply (battery or panel) - the board should run for several days with no sun at all.

I'm not too worried about the 12v vehicle battery situation - but I have to consider it, because it is the same board in all 3 scenarios.

My concern is - how do I properly protect the ADC input that will work in all 3 scenarios? At testing I find I get a value of a bit more than 2v at 24v supply and a bit more that 1v at 12v supply (about what I expect)

The PIC itself is running at 3.3v Am I better off with just a couple of shotkky's from Gnd to the ADC pin and from the ADC pin up to the 5v rail (there are so many opinions on google I'm not sure what to do for the best)

Any advice would be welcome - thanks in advance

david

Hi,
Do you need Schottky diodes?  They tend to get a bit leaky at high temperatures if that's a consideration.
Clamping the ADC input via a diode to +5V means the ADC pin has to climb to around 5.4V before the diode conducts.  You could split the 10k/1k divider with a third resistor and clamp at a point that's a bit closer to 5V under normal conditions.
Why not use regular silicon diodes and clamp to Ground and 3.3V?   Maybe better still - use a much higher resistance divider (220k/22k) and use a 0.1uF on the ADC pin.  Just as accurate but now relying on the substrate protection diodes.

Cheers,
David

trastikata

Hello,

I usually buffer the input to the ADC via an OPAMP powered by 5 or 3.3 volts, that way it is guaranteed the OPAMP won't swing above that voltage and some of the OPAMPs are rated to accept input voltages higher than supply voltages.

JonW

If you are not going isolated and there is a risk of transients, then I would use a split input protection circuit.  If ADC matching is not needed, then use the lowest reference and highest resistive ratio to limit the positive excursion on the ADC.  Add gross fast positive clamping and negative protection with a unidirectional TVS and low leakage, high speed, low capacitance Schottky or ESD diode.  Just watch the capacitance if you need high speed.  I would likely do something like this..  I would also connect the scope and test with a Surge + Esd generator (if you can't get one, crackle a load onto the input and test ).  The Pic will also have ESD diodes on the input.  You can work the input resistance split to suit the leakages etc.  Like already mentioned, leakages and capacitances vary with temp and voltage.  Should be pretty rugged, keep the trace length short and the TVS + (may consider removing the input R)  close to the input and the CBulk close to the BAS16



Non-iso ADC Protect.jpg

                               

See_Mos

With a 10K input resistor you could just decouple the input pin with a small electrolytic to suppress possible transients then add a 3v3 zener across the PIC supply. The internal diodes will shunt anything a little over 3V3 into the zener. The 10K will provide sufficient current limiting.

I would not use this method if I was actually measuring the input value but I do use it in a battery monitor used in a device attached to a welding system.  Rather than AtoD I use one of the comparators and a timer.  If the voltage drops the timer starts running unless the input is restored.  If the timer reaches the preset limit the unit shuts down the operation.

rick.curl

A while back I realized that the input resistance on an A/D channel is extremely high until the A/D samples it. As long as you don't need high speed, I usually put a big ceramic capacitor on the A/D input, like maybe .1uF.  This capacitor will charge up to the voltage being measured, and when you do the sampling, the Internal sample/hold capacitor gets charged from the external capacitor.  Doing it this way I have been able to get away with putting a 1 Meg resistor in series with the A/D input. This not only filters out spikes, but it goes a long way toward protecting the A/D input. I admit it does add a slight error to the measurement, but as long as you're measuring a supply rail, battery voltage, or something that changes very slowly, it's a great way to protect an input. Also, the high value series resistor limits the current into the body diodes of the PIC in case there is a big voltage excursion.

I know a lot of folks will disagree with this approach, but I have used it on many thousands of boards in production over many years, and it just works.

-Rick

Fanie

The correct way (in my humble opinion) is to use a transzorb and not a zener.
They come in unipolar and bipolar.
For pin protection use the unipolar, it will clamp FAST and conduct fast with overvoltage and if polarity is swapped.  It is just a very fast zener diode that can clamp large transient spikes.
If you cannot find a 3V3 or 5V (whichever you use) version, use a voltage divider after the transzorb to lower the voltage suitable for the pic, and have at least a buffer resistor in series with the input.

I used them in my gate control, and touch wood, has survived to date many severe thunder (and lightning) storms

John Lawton

Quote from: rick.curl on Nov 20, 2024, 02:31 PMI know a lot of folks will disagree with this approach, but I have used it on many thousands of boards in production over many years, and it just works.

I wouldn't disagree at all, I have used a divider of 2M2 input & a 1M + 100nF cap to 0V on a mass production board for battery monitoring with a very low discharge current.

John

JonW

I do a lot of product development with RF/DC/Ethernet in outdoor products using long cables; we have to meet all the IEC 61xxx for ESD and Surge and what you think works, often doesn't.  If you have ever worked in this area, you will know that speed and energy density, plus good circuit layout are critical to suppression; we often mix transorbs (TVS), varistors, GDT's for bulk current but then have to add higher speed protection (like Schottky or ESD diodes on both rails) further down the line mixing the protection to suppress the energy. In most cases, the negative ESD pulse excursions do the damage or the length of the surge waveform and the joules that destroy the TVS.  Semiconductors are extremely intolerant to negative-going transitions, and GND is a complex impedance to much of the energy in these waveforms; the energy in the transients can easily extend into the GHz range, and often, these high-speed pulses destroy the input protection in a nanosecond.  I would always rely on something other than the device's internal ESD for a product. A big cap is a good suppressor for low-speed transients.  Give it a go and see what works for you.

John Lawton

I got the impression from the OP that it was a small battery operated system so probably not the noisiest of environments and he was just asking about protecting the ADC input.

Of course the rest of the circuitry would have to be properly engineered also to withstand any transients probably coming from the power source.

John

JonW

Maybe I've read it wrong, John  :-[ , I thought the ADC was connected to an input that can be removed and reconnected to a different source.

david

I assumed it was an internal monitoring connection rather than user accessible and that therefore the rest of the system would have to tolerate reverse polarity connections and over-voltage situations.
If used in a vehicle then load dump is probably the worst to deal with as it involves 70V pulses for durations of up to 600mS depending on the class level of testing.  This has to be protected using fast, short term protection followed by a longer term electronic switch in the supply line. 
On top of conducted transients there's also a raft of automotive tests for coupled transients both capacitive and inductive coupling applied to any cables coming out of the product.   These can be high voltage but low energy and are easily catered for.
The SLA looks pretty safe.  Can't figure out why you would design for a 12V SLA, a 12V vehicle battery but a 24V SMPS mains supply. 

Fanie

I stopped using SLA's, the LiFePo4 batteries are a much better option.

Peter Truman

Quote from: See_Mos on Nov 20, 2024, 02:21 PMWith a 10K input resistor you could just decouple the input pin with a small electrolytic to suppress possible transients then add a 3v3 zener across the PIC supply. The internal diodes will shunt anything a little over 3V3 into the zener. The 10K will provide sufficient current limiting.

I would not use this method if I was actually measuring the input value but I do use it in a battery monitor used in a device attached to a welding system.  Rather than AtoD I use one of the comparators and a timer.  If the voltage drops the timer starts running unless the input is restored.  If the timer reaches the preset limit the unit shuts down the operation.
Thanks See_mos, I do need to use the ADC to monitor the health of the SLA / Solar panel supply system. I'll track the average SLA battery voltage in the middle of the night (no solar) and see if it drifts very much. Could use a comparator for this but I think I'll get better results if I can see the trend downwards in advance / instead of a flat out failure. 

Peter Truman

Quote from: JonW on Nov 20, 2024, 03:42 PMI do a lot of product development with RF/DC/Ethernet in outdoor products using long cables; we have to meet all the IEC 61xxx for ESD and Surge and what you think works, often doesn't.  If you have ever worked in this area, you will know that speed and energy density, plus good circuit layout are critical to suppression; we often mix transorbs (TVS), varistors, GDT's for bulk current but then have to add higher speed protection (like Schottky or ESD diodes on both rails) further down the line mixing the protection to suppress the energy. In most cases, the negative ESD pulse excursions do the damage or the length of the surge waveform and the joules that destroy the TVS.  Semiconductors are extremely intolerant to negative-going transitions, and GND is a complex impedance to much of the energy in these waveforms; the energy in the transients can easily extend into the GHz range, and often, these high-speed pulses destroy the input protection in a nanosecond.  I would always rely on something other than the device's internal ESD for a product. A big cap is a good suppressor for low-speed transients.  Give it a go and see what works for you.
Thanks Jon - this is an odd one, in that I don't know (or control) where these boards are going to be used. I know of the 3 scenarios I described and I am designing to suit those. In all 3 applications I can specify the sensor cable length but you can bet a pound to a knob of goat shit someone will ignore that and expect it to work with 10 times the specified length - there won't be any 'obvious' reason for the failure and I will just have to fix it! I often ask myself 'what would Airbus do' (it used to be 'what would Boing do' but... well you know!). I'm tempted to try a hybrid of Trastikas op amp, a series resistor a ceramic cap and a transzorb - in that order. I don't think (sand I may be wrong) that a single rail op-amp could possibly pull the ADC input low whatever happens? 

Peter Truman

Quote from: david on Nov 20, 2024, 07:52 PMI assumed it was an internal monitoring connection rather than user accessible and that therefore the rest of the system would have to tolerate reverse polarity connections and over-voltage situations.
If used in a vehicle then load dump is probably the worst to deal with as it involves 70V pulses for durations of up to 600mS depending on the class level of testing.  This has to be protected using fast, short term protection followed by a longer term electronic switch in the supply line. 
On top of conducted transients there's also a raft of automotive tests for coupled transients both capacitive and inductive coupling applied to any cables coming out of the product.   These can be high voltage but low energy and are easily catered for.
The SLA looks pretty safe.  Can't figure out why you would design for a 12V SLA, a 12V vehicle battery but a 24V SMPS mains supply. 
It's a board that can be used in a number of different environments - in one case it could be used in a vehicle (12 or 24v DC) (I don't really need to monitor the voltage here so I may need to consider some means of disconnecting the whole thing until the supply is stable - more thinking to do there!, but it will be connected anyway (because it's on the PCB after the supply terminal). In another case it will be in an agg pumpshed with a mains supply (via a SMPS) at 24vDC. In this case I need to detect any mains supply failure (so I can notify the user using my 'last gasp' supercap UPS) and, in the last case it could be installed with a solar panel and SLA (or LifePO4 - thanks Fanie) - if this is the case I want to monitor the battery voltage trend to detect a failure in time to fix it before it fails fully - if possible). The reason I'm designing it to operate on 12v for a vehicle and 24v for an agg installation (24V is pretty well standard there). It may be that any solar installation is also 12v (I need very little power so 12v keeps the cost down). The whole thing is a multipurpose base baord with a variety of modules that are fitted depending on the circumstances. Thanks for the advice - always good to hear from people with experience.

JonW

Hi Peter

There are loads of good answers here, and it's always a what-if. We also go by the rule that if it can go wrong, it will. A round hole or square plug doesn't mean squat when it's rammed in with a hammer. I have had products with a sheared F-connector that you can swing off, but they still manage to break them off.

Transorbs will provide gross protection; they have a maximum operating voltage and a breakdown, and these can vary a lot.  TVS devices are designed to go right at the connection point.  If you have a long DC feed then at 24V you could use a fuse and a 24V TVS as this will likely breakdown at 36+ volts.  Then use any of the above if they are proven.