EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: aussieW on February 07, 2019, 12:22:20 am
-
Hi
I am building a circuit to control some 12 volt RGB LED strips that I bought on AliExpress ( https://www.aliexpress.com/item/SMD-5050-RGB-LED-Strip-Waterproof-5M-300LED-DC-12V-24V-CCT-RGBCCT-RGBW-RGBWW-WHITE/32903257649.html (https://www.aliexpress.com/item/SMD-5050-RGB-LED-Strip-Waterproof-5M-300LED-DC-12V-24V-CCT-RGBCCT-RGBW-RGBWW-WHITE/32903257649.html)). I am controlling each of the R, G, B channels through a mosfet which in turn is being controlled by a PWM signal from an ATMega328. The LED strip and ATMega are being powered using a 12 volt linear bench power supply. The LEDs seem to behave as expected, however, when I looked at the PWM signal on the scope (probing the Gate pin) I was surprised to see spikes in voltage of ~22 volt . That seems strange to me as I would expecting to see a nice clean square wave with a max voltage of 5 volts, but as I am a newbie I am seeking guidance from experts as to whether this is normal behaviour, whether I may potentially do damage to my LEDs, what I may have done wrong in my circuit, etc. I have attached a circuit diagram and a screenshot from the scope for reference.
Any advice/assistance would be most appreciated.
-
Could be layout problem, could be probing problem. Most likely both.
First thing to ensure - proper probing (of high speed signals) so what you see on the scope screen is what actually happens in your circuit. Use spring clip, not ground "crocodile tail" and measure between two pins of the transistor (gate/ & source). Never connect ground of your scope probe at random ground point, always pick ground connection as close to probe tip as possible. For slow signals "crocodile tail" is ok, but for fast and hi-current spikes in nearby (ground?) wires - it acts like antenna.
https://www.youtube.com/watch?v=2vzvWUqUtb8 (https://www.youtube.com/watch?v=2vzvWUqUtb8)
-
Thanks for the tip. My probing method was obviously the problem. After I got the probes as close as I could the wave form was a much cleaner square wave ranging from 0 to 5v.
-
Having the trig level right near the level of the 5V noise is a bad position, moving it down onto the pulses, or up onto the spikes would be better. :)