Strange PWM behavior - Page 1
Forum section: electronics / beginners

author: Bobblank77
author_rank: Contributor
timestamp: October 16, 2014, 07:13:36 am
content: Hi, I've been watching the EEV blog for a while now but this is my first time on the forums. I've really enjoyed Dave's videos and I am quite excited to join this community!I've been trying to swap some LEDs on my keyboard but when I used a multimeter to measure the forward voltage across the existing LEDs I got a max value of 2.3v which I believe was much too low to drive the blue LEDs which were installed by the manufacturer. I also probed the LEDs with an oscilloscope and I got a very strange waveform (see attachment/picture). I expected to see a square wave like when I measured the PWM signal from arduino but it turned out to be some weird thing I don't even know how to explain. Has anyone ever seen this before?I also checked the oscilloscope (same settings) with a 1khz square wave (shown in the last pic). So I don't think it's my scope that's messed upAll advice/wisdom sharing is appreciated. Thanks!Also, has anyone heard of a blue/white led that can run off of a low voltage (1v-2v ish) without using a step up converter?

author: owiecc
author_rank: Frequent Contributor
timestamp: October 16, 2014, 07:20:13 am
content: It looks like you are not connecting your probe ground terminal properly or measuring with AC coupling. Switch to DC coupling and connect the ground probe terminal to the groud of your keyboard.

author: Bobblank77
author_rank: Contributor
timestamp: October 16, 2014, 07:53:24 am
content: Oooh. You got me. Turns out my oscope was on AC coupling. I'll try it again on DC coupling tomorrow. But even on AC coupling, wouldn't I expect to see a square wave rather than what was displayed on the screen? Sorry, i'm still very new to a lot of this.Thanks a lot!

author: miguelvp
author_rank: Super Contributor
timestamp: October 16, 2014, 08:36:33 am
content: If I have my coupling in AC while running a PWM signal it dances up and down but only when the duty cycle changes.At a constant duty cycle it stays put

author: mrkev
author_rank: Regular Contributor
timestamp: October 16, 2014, 05:31:30 pm
content: Quote from: Bobblank77 on October 16, 2014, 07:53:24 amFunny thing is that you can clearly see from both photos you've posted that you had DC coupling at CH1 and you were switched on CH1...I would say dodgy ground connection and you are actually getting good old 50Hz added to your signal...

author: Bobblank77
author_rank: Contributor
timestamp: October 16, 2014, 08:16:54 pm
content: QuoteThere was actually another selector switch on the other side of the oscilloscope which was set to AC coupling. I'm not exactly sure what each of those switches do but the other was def. switched to AC coupling.As a side note, when I changed the time/div I saw the same waveform pictured but repeating several times. Not sure what this means

author: mrkev
author_rank: Regular Contributor
timestamp: October 16, 2014, 11:11:10 pm
content: It could also be the ground connection. Your oscilloscope is grounded by mains plug, your arduino could be in fact grounded too by its power source. There could be some cap from the output to the mains ground or just some parasitic capacity to the live or neutral. From that picture, I would say that you are getting 50Hz from somewhere. It could be whole bunch of things from bad connection (f.e. broken wire in probe), some loop that is going from the place of measurement back to osc. by mains, etc. Do you use separate power source, or 5V USB plug to the computer for powering that board up?

author: miguelvp
author_rank: Super Contributor
timestamp: October 17, 2014, 12:07:57 am
content: You could just unhook the ground clips, put the scope in A-B mode and use two probes (without ground clips) so that the scope ground doesn't affect the reading.Edit: by looking at the picture here: (i'll fix the image in a minute, tablet not cooperating,fixed)from:https://www.eevblog.com/forum/beginners/what-is-a-hameg-hm650-and-kikusui-cos-5060-worth-what-does-ch3-do/You can pull ch-2 position to get the inverse and then do ch1+ch2 with the Add button. I think.But maybe you are already doing that? can you show your probes and how you are using them?

author: Bobblank77
author_rank: Contributor
timestamp: October 17, 2014, 03:49:43 am
content: Okay, so I remeasured everything with the scope on DC coupling and I got the same result. I definitely connected grounds on the keyboard and the oscope (see my pic with the probe). And to double check again I measured a PWM signal from an arduino hooked to the same powered USB hub as the keyboard and I got a square wave with a duty cycle of 50%.I wasn't able to get your plan with the 2 probes and inverting the second channel to work because the scope wouldn't trigger correctly.Additionally, I probed the microcontroller controlling the transistors controlling the LEDS and I got a square wave with a frequency of about 900Hz (the same frequency measured at the LEDs) and ~100mV amplitude.

author: owiecc
author_rank: Frequent Contributor
timestamp: October 17, 2014, 02:18:18 pm
content: Can you put the probe ground lead on Arduino GND terminal, probe tip at keyboard ground and post the picture of the waveform?Alternatively you can turn off everything from power and check the resistance between keyboard's and Arduino's ground.

author: nali
author_rank: Frequent Contributor
timestamp: October 17, 2014, 02:59:43 pm
content: The Arduino signal is a logic level output being actively pulled high & low - that LED signal looks like it's being driven high then going into a high impedance state.So the slow decay after the main pulse is probably an artifact of capacitance discharged by the scope probe, and the higher frequency squarewave some stray pickup from a nearby signal.PS the AC/DC coupling switch on the RH side of the 'scope is for the trigger...