Homemade oscilloscope to detect PWM DIY guide
martin PicoScope is a software only for PicoScope oscilloscopes. You need either:
Linux: OpenHantek (https://github.com/OpenHantek/openhantek)
Windows: The official software from Hantek for Windows (http://www.hantek.com/en/productdetail_2_31.html) or one of the alternative softwares for Windows. PCSCOPE was recommended by Wootever: http://www.eevblog.com/forum/testgear/hantek-6022be-20mhz-usb-dso/msg1099490/#msg1099490. There is also BasicScope, (http://pididu.com/wordpress/basicscope/) which looks a little strange: http://www.eevblog.com/forum/testgear/hantek-6022be-20mhz-usb-dso/?action=dlattach;attach=281643;image. There is also Open6022BE which I don't find the link for. It is buried somewhere in above eevblog thread. All those Windows versions might not run on Windows 10 as some users reported.
Android: HScope (http://hscope.martinloren.com/)
- Edited
Viktor Yes, I tried to do that. But the battery had no impact at all. Maybe my soldering was too bad. So I took my second OPT101 and used it without the attached board, effectively overheating it within seconds.
However, I think the OPT101 may be too slow due to the official bandwidth specification of 14 kHz.
Edit: Viktor I realized I soldered the OPT101 to its board the opposite way. Would this make any difference? I had to switch the probe tips to get a positive voltage.
- Edited
My recent LED measurements (see above) which showed no perfect square waves bothered me a little and I began to wonder whether the LED or the photodiode was too slow for the PWM signal. So I wanted to know how much impact the 9V battery really has, and as you can see in this screenshot, it speeds up the rise time a little.
Blue=9V battery, Red=no battery; Frequency: 5000 Hz, 100K resistors
However, reducing the resistance from 100K down to 10K speeds up the diode almost proportionally by the factor 10:
Blue=10K resistor, Red=100K resistor; No batteries
The downside is that 10K is not only 10 times faster but also delivers a 10 times smaller voltage, so I believe for now 100K are a good trade-off. If anyone has ideas how to make this faster or can measure his OPT101 rise times, let me know. With the Raspberry Pi How-To you can create your own PWM-controlled LED circuit and measure the speed of your oscilloscope setup: https://ledstrain.org/d/375-howto-create-pwm-led-flicker-with-a-raspberry-pi
- Edited
KM There is a small notch on the photodiode to help with the orientation, this should be the correct layout:
Edit:
Test with a Nokia 6 at <17% brightness:
result from notebookcheck.com:
Edit2:
I tried to create a pwm signal with the arduino status led:
Code:
void setup()
{
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
delayMicroseconds(100);
digitalWrite(13, LOW);
delayMicroseconds(100);
}
It looks like both the working OPT101 + 9V battery solution and the BPW34 + 9V battery + 100K resistor share the same responsiveness, with the OPT101 delivering a higher voltage.
Both suffer from their slow rise and fall times.
I am thinking about a new approach the whole day now: connecting multiple BPW34 in parallel to maximize the photocurrent, and using a low impedance resistor - 10K or lower - to maximize the voltage. High responsiveness and still decent voltage output.
Using the photodiode circuit wizard at: http://www.analog.com/designtools/en/photodiode/ it shows that a BPW34 + AD8066 should be able to output a bandwith with 500kHz:
The AD8066 can be found here: https://www.ebay.de/itm/261101423440
OK somebody else must take over from here. I don't have the electronic knowledge to connect such devices and build circuits and I realized learning it in an autodidactive way takes a lot of time and endurance which I don't have.
KM
I set it up this way. Worked nice on my CCFL monitor. Here is a picture:
But I was surprised that my laptop doesn't show the 1000Hz PWM I expected (Chi Mei N173HGE), it shows constant voltage there (no picture attached). It's possible it has no PWM because there are many versions, but there are certainly devices which have 1000Hz.
My question now is: Can I conclude from the steep downfall in the picture that my setup would detect 1000Hz PWM although the PWM of my CCFL monitor is only 180Hz?
I would says "yes" because the downfall is only 0,4ms long. What do you think?
- Edited
Hanzebenger I think you should even see 10 MHz PWM - as long as it's full on/off PWM. As you can see in my pictures in which I compared battery vs non-battery waves, a few posts above: https://ledstrain.org/d/312-homemade-oscilloscope-to-detect-pwm-diy-guide/52
The wave will not look like rectangular PWM anymore, and it will float above zero, but you can see spikes that have the correct frequency.
When the flicker is just a small ripple riding on a DC signal though, as seen in "flicker-free" displays, it might not be displayed. But such small flicker may matter: FRC/temporal dithering, unresolved software eye strain - all those have just a very tiny flicker. So I imagine if a backlight has a similar small flicker, it might trigger eye strain, too.
You can see such small waves a little easier when you switch your PicoScope oscilloscope to "AC" mode. The Hantek 6022BE doesn't have such a mode.
In fact I think there is a higher frequency riding on top of your waves (where there is no thin line but distortion) which you could make visible by adjusting the time axis.
I believe the largest part of your rise times is related to the slow CCFL response. You should easily detect 1000 Hz PWM.
Viktor Can you connect the OPT101 only with the rezistor like in @KM s post? I tried but it doesn work, it doesnt show anything. When I use it with my soundcard, it works, but then the waveform is bad, thats why I wanted to fix it with the Hantek. Or could I just use the BPW34 instead with the rezistor? Are they that different?
I have the opt101 with the board and everything, but Im afraid that when soldering it to the board, ill just connect all the legt together with the tin and it wont work.
- Edited
Viktor On your first photo of the photodiode orientation, and on the second, the diode is reversed. Which one is the right orientation please? The notch is first pointed towards the place where oscilloscope gets connected, then it is pointed to the other side. I am a bit confused. Also how do you connect the 1m/OUT and -V/COM together, soldering it together?
This image is my first attempt. The wires are from battery. Is this the correct way to connect it?
Here is the reversed orientation of the diode and I soldered some of the pins together as per the diagram. Is this the correct way?
This is how it works with my soundcard oscilloscope.
Could you please share photos how your battery and oscilloscope are connected to the board so it works? Thank you!
I have read that you can also connect a photodiode to speakers, which is exactly what my expensive LiFli flicker detection device does. I just plugged my headphone into its oscilloscope output which happens to be a regular headphone jack and I could hear the humming 100 Hz flicker of my bulbs and lower frequency LEDs. It should be possible to connect a BPW34 to a standard headphone jack, both cheap parts, and then plug in headphones and go hunt for flicker-free devices. At least flicker-free in a sense that the flicker, if any, is in the audible range of below 20 kHz. This should be an ultra-cheap but precise setup with your ears as oscilloscope.
- Edited
Here you can see notebookcheck's PWM setup in action as they test the iPhone Xs:
https://youtu.be/sE6OjuRAHpEOscilloscope: Rigol DS1052E, ~300 €
Photosensor: Thorlabs PDA100A-EC, 327,29 € (PDA100A2) excluding VAT, https://www.thorlabs.com/thorproduct.cfm?partnumber=PDA100A-EC
The latter mentioned here on their German website: https://www.notebookcheck.com/Wie-wir-testen.1948.0.html
- Edited
- Edited
Could you please advise me about oscope results? I have fashioned the BPW34 with the rezistor as posted by @KM .
I am measuring my camera display which is a source of pain. In the first image, the brightness is set on +3 out of a range -5 to +5. It clearly shows PWM on the graph, but it doesnt show the frequency.
On the second image, the brightness is +2, there it shows PWM and freq as well (20 Khz).
Am I doing something wrong? The ***** symbol instead of the freq number also shows with brightness below -3, so -4 and -5 show no freq. Is it because the display then is too dim and the diode cant pick it up? It obviously must have PWM at lower levels as well, if it has PWM at -3. Could it apply for the too bright setting as well?
I am confused as then I do not know how well to trust the measurements I make with this. When I measure with the soundcard oscope, it shows PWM at all brightness levels of 15Khz.
Also there is a red switch on the probe, either to 1x or 10x. When its set on 10x it doesnt show any readings, so I leave it at 1x.
- Edited
martin I think their implementation of their frequency software counter only recognizes waves that have a high peak-to-peak difference. OpenHantek suffers from the same problem. But what you could do is try and move the rulers to manually mark a single wave. Then the frequency might appear somewhere. As seen here in the OpenHantek screenshot: https://ledstrain.org/d/312-homemade-oscilloscope-to-detect-pwm-diy-guide/39 the rulers are labeled "1" and "2" and can be moved manually. Hopefully Hantek's software has such rulers, too.
martin When its set on 10x it doesnt show any readings, so I leave it at 1x.
That is normal behavior, we need to keep it at "1x".
By the way, even PicoScope's frequency counter is not very accurate, so I always use the bars there, too. The counter is useful only for quick evaluation but I rarely use it. Stopping and then manually marking the wave is always more accurate.
martin I am confused as then I do not know how well to trust the measurements I make with this. When I measure with the soundcard oscope, it shows PWM at all brightness levels of 15Khz.
I would trust the oscilloscope, as it is the more precise tool. If you want to, you can create pretty precise PWM with a Raspberry Pi and low budget parts (the breadboard isn't even needed) and verify if the frequencies are correct: https://ledstrain.org/d/375-howto-create-pwm-led-flicker-with-a-raspberry-pi
First, I'd like to thank Martin and everyone else who contributed to this. I finally got around to mimicking what Martin came up with, namely:
- BPW34,
- PicoScope 2204A,
- 100,000 Ohm resistor,
- 9V battery.
When I started, I had never used an oscilloscope, but it was pretty easy to figure out. I am so happy that I did this. Now I don't have to guess (so much) at what's causing my nausea, headaches and tinnitus.
I do have a question that is perhaps off topic. I've configured everything I know about:
- Turning the brightness all the way up,
- Going into Intel Graphics Settings and disabling the Intel power saving features (laptop only),
- Going into advanced power options and making sure that the max brightness is 100% (laptop only),
- Going into the bios and making sure that the max brightness is 100% (PC/laptop only),
- Disabling the adaptive brightness/ambient light sensor (if applicable).
But there are still times when the screen flickers with noticeable PWM under certain scenarios. For instance, on my daughter's laptop, when it's on the facial recognition screen when you're trying to log in to Windows, the screen will exhibit PWM (and therefore cause nausea, headaches and tinnitus). The screen does not flicker at full brightness when you're entering a PIN or your password - it's only on the facial recognition screen. I suppose it's trying to reduce glare in the camera.
So here's my question: does anyone know of other scenarios where we should be testing for PWM? The obvious ones are on battery vs. plugged in, and when the battery is low (say, less than 20% remaining).
My problem is that I often get nausea, headaches and tinnitus presumably caused by PWM, but I'm unable to pin down the exact source because our environment is so full of screens and the onset of my symptoms often isn't immediate. If my phone or laptop is occasionally using PWM, it might take me months to pinpoint under exactly what scenarios it happens.
tl,dr; Does anyone know of scenarios, other than what's listed above, where we should be checking for PWM?