ADC - Shunt resistor spikes - Page 1
Forum section: electronics / beginners

author: nixie84
author_rank: Newbie
timestamp: June 24, 2019, 12:00:35 pm
content: Hello everyoneI try to measure current on DC motor using shunt resistor - 5V Atmega ADC.I use 0.1 shunt resistor. On multimeter i have:0,03V -> 0,3A - no load0,1V -> 1A - on load0,5V -> 5A - stall currentEverything looks OK.But on a scope i see spikes with a higher voltage than i expected and multuimeter shows.First circuit:Circuit 1Spikes are above 10V but only for couples of microseconds.Second circuit:Circuit 2Spikes repeated less frequently. About 7,5V.The diodes should limit voltage to 0.6.Third circuit:Circuit 3Like in second circuit.Why is this happening? Is this dangerous to 5V Atmega? If so how to prevent it?Thanks!

author: Kleinstein
author_rank: Super Contributor
timestamp: June 24, 2019, 12:26:36 pm
content: The mechanical contacts at the carbon brushes can cause current spikes, e.g. from some kind of make before brake action. The wire wound resistor used will have some parasitic inductance than can make current spikes look larger than they actually are.Some 7.5 or 10 V spikes could cause trouble to the AVR. Die Diodes are really effective only with some series resistance. Ideally there would also be some resistance in front of the ADC input to limit current here if the voltage goes out of range.Diodes parallel to a shunt are a known way to protect shunts, but it need strong diodes and may lead to some leakage currents that can be relevant for the smaller range.

author: nixie84
author_rank: Newbie
timestamp: June 25, 2019, 12:36:45 pm
content: Fourth circuit:Circuit 4Something like that?DIY 0,1 Ohm bifilar resistor ;-)Spikes appear less frequently but are still at a high level.

author: ArthurWozniak
author_rank: Newbie
timestamp: June 29, 2019, 01:01:57 am
content: Hello,Use some filters, as Snubber filters. They are good for smoothing those voltages spikesBest regards,

author: nixie84
author_rank: Newbie
timestamp: July 02, 2019, 12:24:01 pm
content: I assembled the electronic circuit from the diagram.It works probably ok.The 2nd channel of the oscilloscope shows output. 1st channel show spikes on motor.What are the other ways to solve this problem?

author: radiolistener
author_rank: Super Contributor
timestamp: July 03, 2019, 01:06:52 am
content: that's normal behavior for inductive load with interrupted contact. And yes, it can be dangerous for your ADC. But you can use low pass filter in order to filter these pulses. Also add protection diodes. But, note - when voltage is near to diode open level, it will leads to distortions and in such way it will affect your measurement results. So, you're also needs for some voltage divider to keep voltage below the level of diode open.

author: Psi
author_rank: Super Contributor
timestamp: July 03, 2019, 01:18:42 am
content: You will need a RC filter.This will remove most of those high voltage spikes from getting to the ADC. Motors are very noisy with lots of high frequency crap and you're only interested in the slow current changes.Adding a TVS diode would be a good idea as well.Signal ------1k Resistor------------------------------------- to AVR INPUT| |10uF cap 5V TVS diode (optional)| |GND-----------------------------------------------------------to AVR GNDThis will smooth out all the spikes and get a nice slow changing DC signal you can measure with the AVR ADC.First thing to decide is how fast do you want your AVR to sense the motor current at.This will depend what you plan to do with the data, but if its just to see the current i would go with 15hzTo spec an RC filter for 15hz you can use many online calculators.Try a 1k resistor and 10uF capacitor and see how that works.

author: nixie84
author_rank: Newbie
timestamp: July 15, 2019, 10:02:03 am
content: I have tested some circuits.I noticed a strange thing. Not a single RC filter works.Either it is interference from the air or im doing the measurement incorrectly.Just add 10k resistor to the probe tip and then everything is OK.How to explain it?

author: StillTrying
author_rank: Super Contributor
timestamp: July 15, 2019, 11:18:07 am
content: Just add 10k resistor to the probe tip and then everything is OK.That proves the RC filters must be working.Measuring noise spikes is always difficult. To measure the noise in the 0.1R the scope probe and GND should be as close as possible to the 0.1R's leads, as in your 1st post.To measure the effect of the RC filter the scope probeand GNDshould be as close as possible to the 100nF's or 100R's leads inWorking.png,the 100R in series with the 100n doesn't do anything useful there, it could just be linked/shorted out.

author: hsn93
author_rank: Regular Contributor
timestamp: July 16, 2019, 01:42:46 pm
content: Quote from: nixie84 on July 15, 2019, 10:02:03 amhi,would be very nice to have description or (photos from your oscilloscope instead of saying (working / not working / everything is OK). this is a great place where people communicate and its very nice to have a skill of describing the things and let others to be synchronized to the information on your mind from first comment / post.

author: max_torque
author_rank: Super Contributor
timestamp: July 16, 2019, 01:49:36 pm
content: Also: Be careful with your Oscope ground clip! You may be introducing unwanted current paths, depending on how your motor is driven and the power supply arranged! (and where the current shunt sits in the circuit). The high frequency common mode rejection ratio of your Oscope won't be all that great, and by attaching your probing, you could be providing a nice AC (or DC...) path for high frequency currents from your motor and motor drive.

author: nixie84
author_rank: Newbie
timestamp: July 16, 2019, 08:18:10 pm
content: I put all circuits in post #7.Oscillogram with and without spikes is in #4 post.All others oscillograms looked similar, that's why i wrote it works or not.I try to be careful. I have already seen:I would like to go back to this circuit:If there is only a resistor without a capacitor, how is the RC filter formed here?I know that the probe has some capacity but very small.With 1k resistor spikes appearing. With 10k or more all looks good. Why?

author: perieanuo
author_rank: Frequent Contributor
timestamp: July 17, 2019, 05:51:23 am
content: Probes have their own capacity.rtfm first and work after, especially with things you can damage,like the scope...Envoyé de mon iPad en utilisant Tapatalk

author: StillTrying
author_rank: Super Contributor
timestamp: July 17, 2019, 12:23:44 pm
content: Quote from: nixie84 on July 16, 2019, 08:18:10 pmThe ringing in your scope shot is about 70MHz, the scope probe's ~17pF is only about 200R at that frequency so the 10k in series with the probe gives about 50 times less amplitude to the ringing.

author: nixie84
author_rank: Newbie
timestamp: July 24, 2019, 11:07:23 am
content: Thanks all for help!I think I understand how it works now.I will put together bellow circuit on PCB and i will check how its work with Atmega and scope.PS. Diode on right is schottky.