Oscilloscope Single Shot Capture? - Page 1
Forum section: electronics / beginners

author: glee
author_rank: Contributor
timestamp: July 27, 2022, 02:27:49 pm
content: Hello. I'm new to oscilloscopes but interested to learn. My current goal is to use a Hantek 5072P to capture two separate single events: a) charging and b) discharging a capacitor in an RC circuit. This seems like it should not be hard. But so far I have been unable to capture these wave forms. I hope someone with experience using this scope might be able to see what I'm doing wrong.For guidance, I am using the Hantek DSO5000P Series User Manual (Version 1.1).Section 6.4 Example 4 reads:QuoteI understand in general what each setting on the relevant menus aims to do but no doubt subtleties are lost on me. Using this recipe I have been able to capture a single instance of the scope's own 5V square wave calibration signal. I cannot understand why I have not been able to capture the RC circuit wave forms.The RC circuit is constructed on a breadboard using 100nF cap and 1k resistor connected to variable DC power supply set to 3V. I have a push button switch connected across the capacitor to discharge. I can see with a multimeter that the circuit behaves as expected: with power supply on the capacitor shows ~3V. When the switch is closed the voltage across the cap drops to ~0V, when open it returns to ~3V.With the 10x probe on CH1 of the scope connected to the positive side of the cap and the ground clip connected to the circuit ground, I can see a trace showing constant 3V when the scope is in Auto mode. My understanding is that for this circuit tau = RC = 100 x 10^-9 * 1000 = 10^-4 = 0.1ms = 100us and I have the horizontal time base of the scope set to 80us so that the charging event should take approximately 5 * tau = 500us = ~6 horizontal divisions to complete.On the Acquire menu I have tried Normal and Peak detection modes with DC Coupling.On the Trigger menu I have tried a) rising edge in either Auto or Normal modes. b) slope detection with a trigger value of +1V over 100us (a voltage which should be exceed during the first time-constant interval).Any insight appreciated. Thanks!

author: ledtester
author_rank: Super Contributor
timestamp: July 27, 2022, 03:11:12 pm
content: Try this configuration:Code://+12---o ---o--/\/\/--o--||----GNDP1 P2Connect probes at the points P1 and P2.Start with the capacitor discharged. Set your oscilloscope to trigger on probe 1, single-shot mode.When you close the switch the scope will trigger and start recording. You'll see the cap charge on probe 2.You can replace the switch with a square wave generator and you'll see the cap both charge and discharge.

author: glee
author_rank: Contributor
timestamp: July 28, 2022, 11:00:28 am
content: OK. Thanks for the suggestion. I have rearranged the circuit and again, can verify with the multimeter that the cap dis/charges as expected. But I'm still unable to trigger the scope.

author: eugene
author_rank: Frequent Contributor
timestamp: July 28, 2022, 02:28:24 pm
content: This is the standard circuit for observing RC charging and discharging. Flip the switch up to charge the cap and down to discharge it.Put a scope probe on TP1 for triggering. If you set it to trigger on a rising edge, then the scope should trigger when the switch is flipped up. A scope probe on TP2 will show the voltage across the cap as it charges. Now set the scope to trigger on a falling edge and flip the switch down. In this case you can watch the cap discharge on TP2.There's likely to be a problem with a mechanical switch. Namely switch bounce. That's because the contacts don't open and close cleanly; they bounce. Contact is made and broken over a few milliseconds. That will likely cause the scope to trigger repeatedly depending on where you have the trigger level set. If you set the scope to normal trigger mode (as opposed to auto) the last trigger will be saved on the screen. The problem is that your time constant is so short that the cap will have partially charged or discharged by the last trigger, so you won't see the entire charge/discharge event.The typical way to avoid switch bounce its to get rid of the switch and drive the RC circuit with a square wave from a function generator. That way you can see both charging and discharging at the same time.If you don't have a source of square waves handy, then you can increase the RC time constant to something much larger. That way, even if the cap charges or discharges a little before the last switch bounce, it will be only a tiny fraction of the total amount and will be insignificant. I have had students do this with a multimeter instead of a scope with a very long time constant like RC = 5 seconds. With a scope you could probably get away with RC around 1 second, but you will need a much larger capacitor and resistor.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: July 28, 2022, 02:41:11 pm
content: Your scope should have a square wave generator for calibration. Pratice capturing the rising and falling edges on the wave.

author: rstofer
author_rank: Super Contributor
timestamp: July 28, 2022, 03:08:10 pm
content: This display would be so much easier to create if the signal was repetitive.Your scope probably has a 1 kHz compensation output for probe calibration. As such the output is high for 500 us and low for 500 us (total 1 ms which is the period of 1 kHz).If you want to show 6 time constants on both edges (charge and discharge), you need an RC time constant of 500us / 6 or around 83 us. Given a 100 nF capacitor, the resistor needs to be83x10-6= R x 100x10-9soR = 83x10-6/ 100x10-9= 830 Ohms so 820 Ohms would be great, if available, but 1k Ohm will give just slightly less than 6 Tau.So, drive the resistor / 100 nF capacitor with the compensation output and adjust the scope for proper triggering, V/div and t/div. Once you have a stable and repetitive display, experiment with one shot.Triggering from a bouncy toggle switch isn't destined to end well.Personally, I would use an Arduino and the tone() function.

author: glee
author_rank: Contributor
timestamp: July 28, 2022, 03:50:29 pm
content: Ah. I see. Maybe I am too ambitious for a first try at this idea with a) such a short time-base and b) one-shot rather than repetitive sampling.I also hadn't thought about the switch bounce problem at all. These things all make practical sense.I don't have a function generator (other than the calibration signal from the scope, which I am able to capture) but I saw this post:https://www.eevblog.com/forum/beginners/is-my-math-wrong-my-scope-off-or-whats-going-on/with a schematic for a square wave generator ... maybe I can duplicate that...Meantime, I can play around with (much) longer time-constant combinations and see if I can get a one-shot capture. Are there some switch types which are less prone to bounce? I guess electronic ones are. Maybe I can use a transistor as my switch?Thanks for all the comments. Really helpful to understand what the limitations!

author: LordGeir
author_rank: Newbie
timestamp: July 28, 2022, 04:40:56 pm
content: QuoteHi there,That was my post, and I thought I'd just post a quick note.I'm using a LM324 quad op amp (to create 3 waveforms) but you could use a UA741 single op amp or LM358 dual op amp as well, if you have either of those on hand.

author: armandine2
author_rank: Frequent Contributor
timestamp: July 28, 2022, 06:00:11 pm
content: there are circuits which can de-bounce the switch - might enable you to recapture your ambition.[ed to add an example]

author: glee
author_rank: Contributor
timestamp: July 29, 2022, 01:05:53 pm
content: Quote@LordGeir: I looked at the LM324 and wondered if I could use the UA741 I already have... so that really does help, as I can try it this weekendHaha. That debounce video is great. Wonder how many edits that took?But among the few chips I have lying around there are some 555s, so I can play with that idea too. Thank you, too @armandine2.