Idea design a DC U-I Monitor. Comment, suggestion, … - Page 1
Forum section: electronics / beginners

author: sangseu
author_rank: Contributor
timestamp: July 05, 2017, 07:48:12 am
content: I’m designing a DC Voltage, Current Monitor. I open this thread to update log when working. I hope anyone feel free to leave comment, suggestion for me.1. DescriptionA DC U-I Monitor.- Target: Power flow through a BLDC motor.- MCU: STM32F103- Input range:U: 0 -> 77 (V)I: -10 -> +35 (A)---Modified 7-6-2017Accuracy desireVoltage: 0.2%Current >= 15A: 0.5%Current < +-15A: 0.2%---2. Schematic- Using Voltage Divider to scale input voltage to MCU’ ADC range- Using Shunt Resistor for current measuring3. Question- How to measure -10 -> +35 A current?It is a bi-direction current. My solution is using Shunt and ACS712-5A in parallel. ACS712-5A will monitor Regenerated current.R_shunt = 10 mRR_acs = 1.2 mRI_acs / I_shunt = 1.2 / 10At maximum current 35A:I_shunt = 31.25 AI_acs = 3.75 AAny suggestion to measure -10 -> +35 A current?Will my solution work?

author: alm
author_rank: Super Contributor
timestamp: July 05, 2017, 01:10:30 pm
content: I am not sure about the hall sensor paralleled with a resistor. For starters, what is wrong with just using the shunt resistor (since you have one capable of handling the current) or hall sensor with higher rating? Too low resolution/accuracy at low currents? You did not specify any resolution/accuracy requirements.I am also not convinced that the 1.2 mOhm typical at TA= 25°C is stable enough as to not screw up your accuracy. I could not find any information about minimum/maximum values, spread, stablity over time and over temperature. Is the parallel resistor trick discussed in any application note? Keep in mind that any trace resistance in series with the hall sensor will add to the inaccuracy and temperature coefficient.If the low level resolution/accuracy is sufficient, then I would just use a 35A+ bidirectional hall sensor or shunt + scaling to bring it in range for the STM32 ADC (or external ADC).If resolution is an issue, then you could have two shunts in series. You use a higher value shunt at low currents, and clamp the voltage across it (e.g. with two sturdy anti-parallel diodes). Once the voltage across the higher value shunt gets close to clamping, you switch to the lower value shunt, Obviously this would require two ADC channels sampling at the same time and combining them in software. I attached a snippet from the HP 66311 service manual which uses a similar scheme. You might be able to to the same with two hall sensors if the lower one can handle the overload.

author: sangseu
author_rank: Contributor
timestamp: July 06, 2017, 01:26:40 am
content: Quote from: alm on July 05, 2017, 01:10:30 pmMy problems are resolution and bi-direction current.Quote from: alm on July 05, 2017, 01:10:30 pmI proposed that solution base on this Notehttp://www.allegromicro.com/ja-JP/Design-Center/Technical-Documents/Hall-Effect-Sensor-IC-Publications/Current-Sensor-ICs-In-Current-Divider-Configurations.aspxYou are right. I forgot effect of temperatureI hope accuracy desire are:Voltage: 0.5%Current > 15A: 0.5%Currnet < +-15A: 0.2%Is your schematic attached can handle bi-direction curent ?

author: alm
author_rank: Super Contributor
timestamp: July 06, 2017, 02:24:12 am
content: Sure, as long as you shift the voltage across the shunts to be in range of your ADC, e.g. centered around VCC/2. But you lose the isolation from a hall effect sensor, so if this is critical (convenient for high-side sensing), then a hall sensor might be superior. The burden voltage will also be much higher.Both shunts and hall sensors can deal with bidirectional currents, In the case of shunts you just have to prepare to handle both negative and positive voltages across the shunt. For Hall effect sensors you have to ensure that the one you pick is designed for bidirectional currents. For currents up to 35A the hall sensor seems to be the obvious solution to me, however, since you planned to have a shunt that can handle 30A, I just wanted to point out that you could do the same with just shunts.If you are aiming for 0.2% accuracy, then I would say the ACS712 is already out with its 1.5% typical (not max) total output error. Unless you plan to calibrate and characterize the part yourself. And I am not convinced that the parallel resistor trick will do the accuracy any good. You would need to use a more accurate current sensor with ideally an accuracy < 0.1%. (to not eat up your entire error budget). Something likethiscomes closer (but still only 0.25% accuracy.You could go for a very low value shunt likethis one, and then have a precision or chopper op-amp amplify the +/- 70 mV full scale to the half the full scale of the ADC. This is not unlike the µcurrent. It might be good to read through Dave'sarticleand watch some of his videos about the µcurrent. You will have to figure out if this will provide sufficient resolution or if you need a second shunt like in the example I posted. This way you might just be able to meet that 0.2% spec, assuming you have a decent voltage reference for your ADC.What is the lowest current you want to resolve?

author: sangseu
author_rank: Contributor
timestamp: July 06, 2017, 06:39:16 am
content: Lowest current about 100 mA.Accuracy desire look like overwhelmed with beginner like me.- I admit poor accuracy cause the cost of components.- Safety Isolation is important for MCU so I will design follow your solution, using hall sensor.- ACS758-50A look simple. Can I use it ?

author: alm
author_rank: Super Contributor
timestamp: July 06, 2017, 01:21:10 pm
content: Yes, accuracy costs money, especially at high currents. You could use the ACS758 as long as you get one of the bidirectional ones. Keep in mind that it (together with the ACS712) is not recommended for new designs (do not use it if you want to commercially sell this product). No problem for a one-off hobby project. Not sure how much better the performance of the ACS758 would be relative to the ACS712 with the parallel resistor trick (Allegro are very silent about the accuracy or temperature coefficient of that method). Just do not expect 0.5% accuracy from either without doing your own calibration. Resolving 100 mA will be a problem. Looks like the noise would be about 0.25A p-p and the electrical offset +/- 0.3A (25°C to 150°C).If you just want to measure currents down to 100 mA then you may be able to solve it with a second hall sensor in series that can handle the 35 A (but not accurately measure it). But if you want to measure 15 A down to 0.1 A, then it may be tough to find a Hall sensor that can do that.

author: soligen
author_rank: Contributor
timestamp: July 06, 2017, 07:19:07 pm
content: I did a voltage/current monitor using an Arduino and ADS1115 16 bit ADC. I don't do negative current, but the ADS1115 can do differential inputs it should be possible as long as you bias the voltage of both inputs above ground. Code should port fairly easily to STM32duino.I don't know how accurate it is (its good enough for me), but maybe this project will help you in some way.https://github.com/soligen2010/PowerSupplyMonitor

author: sangseu
author_rank: Contributor
timestamp: July 07, 2017, 12:39:32 am
content: Quote from: soligen on July 06, 2017, 07:19:07 pmI'll make a note of it.Quote from: alm on July 06, 2017, 01:21:10 pmLow cost component usually come with noise, oscilloscope, offset.Can you explain me how a Multimeter measures current on -10 -> +10 A range ?

author: alm
author_rank: Super Contributor
timestamp: July 07, 2017, 01:03:22 am
content: Run it through a low-value shunt (e.g. 0.1 Ohm) with Kelvin connections that is large enough so it will not heat up too much (heating is a major source of error). Plus the necessary protection circuits (fuses, diodes). This gives you a +/- 1 V signal. At this point it is basically a DCV measurement and it will be scaled and shifted as appropriate for the ADC. Obviously a DMM does not care about isolation from the current source because the entire input circuit is floating.For lower ranges a DMM will switch a different shunt in series or even have the user switch jacks (with different shunts).