Current sensing on L298N with arduino - hardware question

Hi comrades,

I’m builting a hinged dooropener with arduino nano, two linear drives and two L298N dual H-bridges. I paralleled the two bridges of each L298N to to get the needed current.

As sense resistor I use 3 pcs of 1Ohm/2W SMD-resistors so according to ohm’s law I’ve got a Vrs of 1,1V @ ~3,3 A, so the voltage of the internal voltage reference of the nano.

the problem I’m now facing is, if I make the ADC conversion while the motors are running without load I get a ADC value of <= 0 or >=1023 and this values obviosly exeeding the limits and are therefore unusable …

My guess now is that the motors inductive load are causing noise at the sense resistors and due to the “fast” Nano it detects this overswings?

Does anyone know if I’m right with my guess and what I could do to eliminate this effect? My thought was to use capacitors or an RC network to filter the voltage over the sense-resistors to get a clean and usable voltage?!

I’d appreciate any hint on this!

thx so far!

cheers gueee

Could you provide a circuit?


found a hint in application note AN460 by ST on page 8

However, in applications using monolithic bridge drivers, like the
L298N, internal parasitic structures often produce recovery current spikes similar in nature to the diode reverse
recovery current and these may flow through the emitter lead of the device and hence the sense resistor.

Should be the problem in my case, so the only question left, will a cap between GND and VRS do the job?

first of all thanks Alan for your effort,

Could you provide a circuit?


here is the cirquit without measures taken: circuit

I did a first approach and put a tantal capacitor between Pin A2 and GND, but sadly it didn't change anything ...

updated circuit

Looked at the circuit - where's the sense resistor?


Don't connect that voltage from the sense resistors directly to the Arduino (noise and pin protection).
I suggest an RC filter of 10k between motor current sense resistors and Arduino analogue pin, and 100n from Arduino pin to Arduino ground.
Can remove that cap across the 3.3ohm resistor.