News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Isolated voltage readings

Started by chris_cb_uk, Feb 04, 2022, 05:59 PM

Previous topic - Next topic

chris_cb_uk

I'm needing to take accurate voltage measurements of a 24v battery system but as it is prone to noise spikes and rubbish from brushless motors I obviously don't want it to zap the pic and therefore looking at some isolated way to interface.
So far I've come up with the following concepts.

>Voltage to pwm, opto isolated, Count pulse width.

>finding a linear opto transistor arrangement.

>i2c voltage monitor interfaced through an i2c isolator

>vco, opto, measure frequency.

>directly coupled to a voltage divider, through a buffer arrangement opamp with simple filtering and crowbar protection across the pic. (this is my least favourite as there is direct contact)

Am I overengineering the solution?

Yasin

HCNR200, HCNR201, LOC110 and series. my be suggestion.

JonW

A good method we have used for a long time in millions of low cost products and to avoid galvanic isolation, is a standard resistive divider to limit current and get to the required voltage and a bidirectional ESD Diode like PESD5V0F1BL providing secondary protection over the device internal ESD protection diodes.   These are extremely fast and very low capacitance.  We fit these on 24V inputs on long lengths of coax to protect the sensitive low voltage inputs of all  SOC's, these can protect to 10kV ESD and transient spikes. These also pass the IEC6100-4-2 test requirements (we have tested the NXP and they all pass).  Other devices like ULCE0505C015FR are good for high speed lines however if you have to pass IEC6100 then some vendors of these mail fail during repeated testing.




John Lawton

Common mode noise especially may be a problem though unless you use a balanced input arrangement (differential amplifier) on the measuring side.

Giuseppe MPO

You could also insert a PIC in a non-isolated configuration, obviously protecting the inputs adequately with various methods as they have already advised you. If possible you could also derive the power supply from the 24V batteries you want to measure, considering that the absorption of the PIC is negligible. With SW routines you could clean up the signal by taking numerous readings and processing the data in order to exclude noise and voltage fluctuations to have the most accurate final reading possible. Then you could transmit the data isolated optically, or even better with a radio link via RF.

chris_cb_uk

Thanks all, looking at the linear opto isolators with twin feedback seems to require more components to ensure the feedback is maintained correctly and overenginners the problem. I think I'll trial the crowbar protection method with dividers and a rc network to provide low current buffering to the pic.

Jonw this was one of my first considerations and ive used it before well. MY only reservation for having something coupled was the concerns of the client as their system is using pics and have had some failures but I have identified other reasons for the likely damage.

John L common mode noise isn't a problem, it's just 24v measuring for rough battery capacity.

Giuseppe the signal is just a dc battery, nothing a simple rc filter wouldn't smooth out bumps and issues. The data of this will form part of other monitoring for a remote operated vehicle, I'm only worried about any spikes and back emf causing issues womith the master pic used for control which is local in the machine. It's then going over RS232 and fibre to the remote control.

Giuseppe MPO

Quote from: chris_cb_uk on Feb 05, 2022, 12:50 PMGiuseppe the signal is just a dc battery, nothing a simple rc filter wouldn't smooth out bumps and issues. The data of this will form part of other monitoring for a remote operated vehicle, I'm only worried about any spikes and back emf causing issues womith the master pic used for control which is local in the machine. It's then going over RS232 and fibre to the remote control.


Absolutely yes, a good RC filter with some protection system (diodes, zener etc.) and then a nice voltage reducer from 24V to 5V with electrolytic in and out, this as regards the power supply then similar filters on the input of measure, and all, enclosed in a small metal box connected to ground, the PIC would be more than protected from any event.

shantanu@india

I suppose you are worried about inductive spikes. These are best suppressed by P6KE family of surge suppressors. You can use a 5.6 V unidirectional types connected across the Vdd and the analog input pin after necessary voltage conversion.You just cannot destroy a PIC if you can limit the current flowing into the pin
Regards
Shantanu

JonW

If you can afford the space and component cost then I would generally go for the safest option however I personally don't like increasing the BOM unless its absolutely necessary as this can also impact reliability, accuracy and procurement/lead time issues.

Watch out for the breakdown, clamp voltage and working voltage on the diodes, depending on the PIC VCC and reference you may be better off if possible, selecting a lower working voltage diode and using the lowest reference voltage/ divider network with the highest PIC VCC to minimise the transient peaks and ensure the PIC ESD diodes don't conduct and cause any potential latch ups.  TVS diodes will be slower in this application and as you do not require high clamping current, I personally would stick with low capacitance diodes for high speed applications.

chris_cb_uk

Yes I fully understand @JONW. I was considering low esr caps which will also present low resistance for spikes.

It's not really the esd aspect that worries me, as the entire machine is a metal enclosure with no real outside interface except fibre optic. It's more the brushless motor high current spikes potentially present.
The pic and controller side are powered from small cells than the heavy power motor drives, but its the monitoring of these high power systems which is my concern. The controllers are optically isolated from the speed controllers so there are 2 completely separated supplies.

JonW

The diodes will clamp any highspeed low current transients, not just ESD hence why they are used on HDMI and USB etc  Reading that the controller and interface have separate supplies then I would likely isolate.  Take a look at the LTC4151, very impressive devices, a little pricey, I use these on some high end test kit (page 10 gives isolated use case). 


JonW

Here is the code if you want to have a play, just setup the ports

'*************************************************************************************
' Name:                                LTC4151 PROC
'*************************************************************************************
PROC GET_LTC4151()

        Dim LTC_VSEN    As Word
        Dim LTC_VIN     As Word
        Dim LTC_ADIN    As Word

        I2COut SDA_LTC,SCL_LTC,$CD,[0]
        I2CIn SDA_LTC,SCL_LTC,$CE,[LTC_VSEN,LTC_VIN,LTC_ADIN]
        LTC_VSEN = LTC_VSEN >>4   ;             ; Get to LSB
        LTC_VIN = LTC_VIN >>4
        LTC_ADIN = LTC_ADIN >>4
ENDPROC
'*************************************************************************************

shantanu@india

Tap off the battery voltage with a 100K/10K potential divider to get 2.4V at 24 V. Put a 0.1 mfd mylar in parallel to the 10K and feed it to the ADC input of the PIC. I don't think anything can go wrong other than slight error in ADC readings due to high series resistance. This you can make up in software.
Obviously since the battery is directly connected to the PIC, you do not need any optoisolators anymore.
I have connected PICs directly to 230V mains through megohms resistances in the past without issues by taking suitable precautionary measures.
Regards
Shantanu

chris_cb_uk

Thanks @JONW I was actually looking at the INA219 also which can give basic info and current usage if required. I can see me needing to incorporate an i2c isolator device for other reasons now emerging so this much just be a necessary "tag on"

@shantanu@india yes this was also a consideration along with a 4.8v zener or soemthing to prevent the voltage rising in the pin in event of earthing issues.