Maker Pro
Maker Pro

Transient noise and microcontroller

wrinke

Feb 25, 2023
16
Joined
Feb 25, 2023
Messages
16
Hi everyone, I m new here. I m software developer that I hug elettronica as hobby, so I have not strong knowelage in this subject. I built a small project of clothes hangers lifter, that involve a 12v 3A motor. For the time being I don't bore you all with details and I go direct to question. My micro (atmega328) receive this transient voltage spike in power pin. Taking in consideration the amplitude and the duration, Is it dangerous? Seems working correctly, but i have no idea if this spike will cause future problem or It Is under tollerance level. Someone can give me some advise? Tnx very much
 

Attachments

  • bmp_last.png
    bmp_last.png
    8.7 KB · Views: 5

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,651
Joined
Nov 17, 2011
Messages
13,651
Yes, a spike of that dimension can destroy the µC.
The best way to eliminate the spike is correct wiring, keeping the power section (motor and driver) as separate as possible from the µC section.
Show us your circuit diagram (schematic) and the real physical setup. Sometimes simply moving a few connections can work a miracle, sometimes additional measures like filters are required.
 

wrinke

Feb 25, 2023
16
Joined
Feb 25, 2023
Messages
16
Ok, thank you very much, I will provide to post what you ask me for, soon as possibile. I confess you, I m a little bit embarrassed to show my artifact, as I already told you, this isn t my field... Thanks again
 

danadak

Feb 19, 2021
725
Joined
Feb 19, 2021
Messages
725
Post a pic of prototype board wiring as well.


Regards, Dana.
 

wrinke

Feb 25, 2023
16
Joined
Feb 25, 2023
Messages
16
I draw a schema related to motor / mic interface. It isn't well done because the free trial account of service that I used to design it expire before the end................. (can u suggests me some good free software / service to design circuits schema?)

Summary.
I have two power supply. One 12v, one 5v.
The 12v is connected to motor by two relays that control the direction of motor.
The current sensor hall effect is used to limit max torque of motor

The schema has an mistake that I notice just now, the ground of various relays and hall effect sensor aren't connected direct to ground, but are connect to n-channel mosfet controlled by micro. That in order to switch off all components during stand-by

Furthermore, to complete the schema, there are connected to micro
- a buzzer connect by npn transistor
- the endstop of motor
- push button (used to switch on the system)
- n-channel mosftet (for the time being with drain not connected, in the future should be used to control the motor current, but there is already that big spike, I cannot imagine what can happens connect the two power supply ground together....)
 

Attachments

  • schema.png
    schema.png
    55.2 KB · Views: 5
  • BOARD.png
    BOARD.png
    2.6 MB · Views: 5
  • IMG20230226103809.jpg
    IMG20230226103809.jpg
    257.1 KB · Views: 5
  • IMG20230226120606.jpg
    IMG20230226120606.jpg
    353.9 KB · Views: 5
  • IMG20230226120640.jpg
    IMG20230226120640.jpg
    324.5 KB · Views: 5
  • IMG20230226120720.jpg
    IMG20230226120720.jpg
    279.6 KB · Views: 5

danadak

Feb 19, 2021
725
Joined
Feb 19, 2021
Messages
725
Good bypassing at micro pin would be a parallel tantalum and ceramic disk (say .1uF).

The best tants are polymer, "Wet Al" = Electrolytics):

1677423135648.png

1677420941977.png

Lead length short to minimize L which effectively negates the C properties to shunt
AC signals and transients to ground.

Also where possible a single point ground where all loads, micro, motors, relays come to
a common point. Single point ground as close as possible to power source ground.

if C bypassing not enough consider L in Vdd line to micro. So Vdd >> L >> C to gnd and micro Vdd.
This may sound counter-intuitive, given that we want lead lengths minimum to reduce L, but in
power supply feed to chip small L and the parallel to ground ceramic disk and tantalum can filter
noise to a chip.



Diodes across relay coils and motors (where appropriate) should be fast diodes and very short
lead lengths.





Regards, Dana.
 
Last edited:

wrinke

Feb 25, 2023
16
Joined
Feb 25, 2023
Messages
16
Thanks a lot Dana, the capacitor that I use was really too big, and the small one was far from micro. Very usefull the pdf that you post, I will keep it carefully.
I will proceed to add 0.1µF cap near to pin.

Anyway this morning, before your answer, I investigate more in deep and I discover a big spike (more than 100V amplitude between 12v power supply pin, so I add another tvs 15v diode there. Magically the noise on micro became really small now. I m confident that with you suggestions on decupling cap will be removed completly.

So, do you suggest me to join the grounds together? I was thinking that could help noise propagation, am I in wrong?

I attach the screen shoot of the spike after tvs diode added, seems accpetable now, right?

Thanks a lot,
Marco
 

Attachments

  • 17mic.png
    17mic.png
    11.3 KB · Views: 2

danadak

Feb 19, 2021
725
Joined
Feb 19, 2021
Messages
725
Thanks a lot Dana, the capacitor that I use was really too big, and the small one was far from micro. Very usefull the pdf that you post, I will keep it carefully.
I will proceed to add 0.1µF cap near to pin.

Anyway this morning, before your answer, I investigate more in deep and I discover a big spike (more than 100V amplitude between 12v power supply pin, so I add another tvs 15v diode there. Magically the noise on micro became really small now. I m confident that with you suggestions on decupling cap will be removed completly.

So, do you suggest me to join the grounds together? I was thinking that could help noise propagation, am I in wrong?

I attach the screen shoot of the spike after tvs diode added, seems accpetable now, right?

Thanks a lot,
Marco

Its 6.5V which is out of spec for chip, but fairly narrow width, so you might be OK.
Another way of doing that measurement is turn on infinite persistence and capture
many cycles on screen to get real pk-pk measurement. Greta way of looking at
supply rail noise. Atmega has 6.0 Vmax for spec.

Did you take that with a probe with very short gnd lead, and right at chip pins ?

A possible fix is use a ferrite bead close to chip, tied to supply pin along with the 2
caps suggested earlier. Something like this -

1677444773584.png


Regards, Dana.
 

wrinke

Feb 25, 2023
16
Joined
Feb 25, 2023
Messages
16
The prob was not so near (i connect two jumper cable of 15cm more or less to pins, and the the probe). Is 6v of spec. considered as continous? I was thinking that as peak the tollerance was higher, but probabily I m in wrong. I did the infinite persistence test to find the peak level and after I regulate the trigger to catch the spike that I post. Thanks a lot for your help. I learning many concepts from you
 

danadak

Feb 19, 2021
725
Joined
Feb 19, 2021
Messages
725
The 6V rating is the max. Its what you must observe to not have a worst case
chip not fail in situ. Your post of scope capture did not seem to make it onto
this thread.....

On probing, 15 cm for high speed stuff, which a micro is asking for misinterpretation.
See the following on probing considerations (section page 46 on ground lead length) :

1677586194594.png




15 cm way too long.....so reprobe with better lead length, maybe your problem
will vanish because you have done a better measurement. Also do the scope probe
compensation adjustment to make sure thats addressed.

In case you have to make measurements on AC line related stuff, attached.
This will prevent you from burning out the front end analog processing in your
oscilloscope.

Your oscilloscope is your stethoscope, take the time to read the ap notes, they
will save you a lot of misery.

Regards, Dana.
 

Attachments

  • Tektronix.Application_Note_1.pdf
    851.6 KB · Views: 1
Last edited:

danadak

Feb 19, 2021
725
Joined
Feb 19, 2021
Messages
725
.1 uF Ceramic
10 - 50 uF Tant typical, determined by loads on micro pins and its own
current consumption. Datasheet typically has this info in it.



Regards, Dana.
 

danadak

Feb 19, 2021
725
Joined
Feb 19, 2021
Messages
725
Saw this today, attached.


Regards, Dana.
 

Attachments

  • an88f.pdf
    107 KB · Views: 0

wrinke

Feb 25, 2023
16
Joined
Feb 25, 2023
Messages
16
Sorry guys, I m back again to bore you with my questions!
I fix the transient spikes on motor stop....
Now I discovery another noise.
My circuit has two relays to move motor, another one to switch on/off the 12v motor power supply. When that relay switch on (only with load connected) another spike appear. I read somewhere that It Is normal due emi generated by sudden change of current and that usually the solution Is RC snubber connected in parallel to the relay endpoint. But, I m in AC, so if I put capacitor there mean that a little bit of current will flow in the circuit also with relay open....or not?! Di I understood well the location of snubber? Can be used in AC? Thanks in advance
 
Top