Basic oscilloscope - Page 1
Forum section: electronics / projects

author: Karamel
author_rank: Regular Contributor
timestamp: March 26, 2016, 01:04:59 am
content: Hi,In this summer, I would like to make basic oscilloscope(hobby project). I am therefore searching schematics of basic scopes. I found something on internet but exactly, I didn't understand. For example, schematic given below, has 2 opamp which is working inverting mode. Input and feedback resistors also are same so, input signal exactly equal output signal, am I right? Why are they used?What kind of circuit should I use for basic scope? Can you give me some details about this problem?Best regards,Karamel

author: ataradov
author_rank: Super Contributor
timestamp: March 26, 2016, 02:51:14 am
content: The first one is an input buffer to maintain 1 MOhm input impedance. You can't just connect your signal to the ADC input, since they typically have very low input impedance (10-100 KOhm in a typical MCU).The second one it another buffer, it is not as important as the first one, but they had a dual opamp, so why not make the second half useful. It also helps to decouple that AC/DC capacitor from the ADC input, which does not hurt either.

author: Karamel
author_rank: Regular Contributor
timestamp: March 26, 2016, 01:02:22 pm
content: Hi,Thanks for replying. I understood clearly my first questions. There are also second quesitons here. How can I measure ACc signals with adc unit of mcu? If I shift it to zero, how can I understand that, it is ac? if I don't make it, adc unit can not measure nagative voltage? and also it can be hurt?Here I have simulated this. Input exactly looks like output but it has negative side. I have mentioned on the above, How it is possible measuring negative voltage? (opamp produce negative output?) How does it works?And the last question. I have designed trigger circuit. You can easily see on the picture from top side. It is basic derivative op amp circuit. Can i use it for hardware trig? is it good idea? If it is not, Can you suggest any circuit to me? (it is exactly digital output)Yellow: InputPurple: OutputBlue: Trigger

author: ataradov
author_rank: Super Contributor
timestamp: March 26, 2016, 07:48:21 pm
content: Quote from: Karamel on March 26, 2016, 01:02:22 pmADC can't measure negative voltages. Use P1 to adjust your trace to be within ADC range.It is not about AC or DC, this problem will happen on any type of signal. You have to manually bring the trace into the right range.Quote from: Karamel on March 26, 2016, 01:02:22 pmThere are clamping diodes on all inputs of the MCU, so it typically will be fine.Quote from: Karamel on March 26, 2016, 01:02:22 pmIt will not work. First of all, trigger has to be adjustable, otherwise what's the point of having it? Then it needs to operate on a voltage presented to the ADC, not the input voltage.But in this case, why not do triggering in the software? The mega is certainly fast enough to do that.

author: daybyter
author_rank: Frequent Contributor
timestamp: March 26, 2016, 07:56:27 pm
content: Very, very basic scope...http://www.stm32duino.com/viewtopic.php?t=107In fact, it won't get more basic than this project...

author: Karamel
author_rank: Regular Contributor
timestamp: March 26, 2016, 08:53:59 pm
content: Quote from: ataradov on March 26, 2016, 07:48:21 pmCan you give me some trigger circuits for me? and can you give more information about what are the differences between hard and soft trigger?

author: ataradov
author_rank: Super Contributor
timestamp: March 26, 2016, 08:57:59 pm
content: Quote from: Karamel on March 26, 2016, 08:53:59 pmIt is very dependent on the rest of your scope design. Basically it is the same comparator, but it compares signal that goes into the ADC input with a reference voltage set from the MCU (using DAC).Quote from: Karamel on March 26, 2016, 08:53:59 pmWith software triggering you just look at every single sample from the ADC and compare it to a trigger level value. With kind of sampling rates you get from this scope it is absolutely doable and no external components required.

author: Karamel
author_rank: Regular Contributor
timestamp: March 26, 2016, 09:04:52 pm
content: Quote from: ataradov on March 26, 2016, 08:57:59 pm-It is a little bit difficult but I guess, I can do it. I have to see some trigger schematics. I am freshman at electronics so, sometimes, I can ask some stupid question. Sorry.-software trigger must be slower than hardware? or not?

author: ataradov
author_rank: Super Contributor
timestamp: March 26, 2016, 09:09:06 pm
content: Please quote only relevant part of the message you are replying to.Quote from: Karamel on March 26, 2016, 09:04:52 pmIt all depends on your goal. Real high-end trigger circuitry can be quite complicated.Quote from: Karamel on March 26, 2016, 09:04:52 pmSlower in what sense? ADC in mega can sample 100 ksps or so. This is as "fast" as your scope will go anyway.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 01:58:26 am
content: Hi,I want to use stm32f407 microcontroller.Anyway, I have changed my trigger circuit like that and I can change trigging time and it looks working every type of signals. Is it true or not?

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 02:02:17 am
content: Triggering needs to take signal that goes to the ADC. Take your last picture and switch SW2 on. Your signal will be divided by 2, but triggering will not notice it.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 02:22:27 am
content: I guess, You misunderstood me. There are two circuit. Above circuit is my trigger circuit. Below is exactly same with first schematic which I found it in internet.I admit that, pictures are so crowded but, In pictures, top circuit is just working. Up to now, Still, I did not understand two things.How can I decide RV1 voltage to everytime? for example, if I want to masure 10Vpp I need 5v on PV1? if I want to measure 20Vpp, I need 10v. Thus, How can I decide this voltage and How can I menage it with microcontroller? So, It must be digital control.(everytime, I can't set it up by hand)

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 02:29:28 am
content: Quote from: Karamel on March 27, 2016, 02:22:27 amI understood you quite well. Your circuit must take its input from the output of the circuit below, not directly from the input signal.Quote from: Karamel on March 27, 2016, 02:22:27 amThere are many ways. For example DAC of the MCU amplified by an opamp.Or here is another idea - find a better front end schematic. There are a ton of open source scope designs. Have a look at Xprotolab oscilloscope front end. It has a good design for a low-end thing like that.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 02:44:44 am
content: Now, Is it Okay?Op-amp is a good idea but How can I mesaure peak voltage? if I know it, this schematic can be useful.Besides, I am fresman. If you don't here, I couldn't understand anything. Thanks for all.

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 02:49:03 am
content: Yes, that looks better.What do you mean by "measure peak voltage". Peak voltage of what? If you mean fixed voltage applied to the variable resistor, then you don't need to change it. Higher input voltages are accommodated in the front end by dividing the input voltage.One more time, I would strongly suggest you look at different designs of the front ends. This one is one of the worst I've seen.

author: tautech
author_rank: Super Contributor
timestamp: March 27, 2016, 02:49:42 am
content: Have a look at member Bud's work RE'ing the DS2072 front end.https://www.eevblog.com/forum/projects/project-yaigol-fixing-rigol-scope-design-problems/msg890966/#msg890966

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 03:12:08 am
content: Now, I guess, I understood clearly to you. For example, Let's say my measure range of scope is 30Vpp, Once time, I will set fixed-voltage up to 15v and I can be using it below 30Vpp. if I want to measure such as 10Vpp I will see it a little bit up to x-axis. I know my fixed ground level of opamp which is 15V. I can easly calculate and I can measure input voltage.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 03:15:01 pm
content: Here is a one question of this topic. When AC-DC selection switch closed(selected dc mode) and if input is AC opamp circuit produce negative output voltage and adc unit of mcu can be hurt? How can I prevent this issue? My opamp circuit musn't produce any signal when input is AC and selection swicth selected DC.

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 07:25:55 pm
content: Quote from: Karamel on March 27, 2016, 03:15:01 pmYou really should learn more about electronics before building a scope. As I said already, it does not make difference if signal is AC or DC. What if you measure -5 V DC? The same exact thing will happen.Op amp in this circuit will never have negative voltage on the output. Opamp can only produce voltages within its power supply range. It can, however, produce voltage bigger than maximum MCU pin input voltage. To protect against that use clamping diodes. There are clamping diodes inside the MCU already, so you can just rely on them as long as you limit the current through them.Quote from: Karamel on March 27, 2016, 03:15:01 pmOpamp does not know what switches you have in your circuit.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 08:20:58 pm
content: It looks like that.When Input = AC and AC mode selected(with SW1) and signal has an offset.When Input = AC and DC mode selected(with SW1) andsignal has no an offset. Output has a negative peak voltage.Mr.Ataradov. If I annoy to you with my questions, Apologise for everything...

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 08:45:43 pm
content: Your circuit simulation program is simulating an ideal opamp. I don't see any power supply rails going to it. And there is no type specified. Not all opamps are the same

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 08:57:31 pm
content: Of course. There is no any power rail because, It simulate it like that.I am not really sure about it. I must set the circuit on bread board and check it in real life.

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 08:59:12 pm
content: Well, you have specified +/- 20 V supply, but your actual schematic has 0 and +8 V. Some mismatch there.Hint: if you have dual supply rails, you don't need all that monkey business with offset resistor. Just shift your signal up after the second opamp, so it is centered in the middle of the ADC range.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 09:35:12 pm
content: Don't mind supply values. I am just trying and learning something . (actually, I want to measure voltage ragne 15Vpp)Can you explain to me the last question? If input is AC and if I, mistakenly, choose DC (SW1) ADC input will have seen negative voltage. How can I solve this problem?

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 09:36:20 pm
content: Quote from: Karamel on March 27, 2016, 09:35:12 pmThis is the third time I'm telling you to use clamping diodes. Google it.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 09:40:23 pm
content: Okay. I got it cleary. Thanks for all Alex.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 09:54:59 pm
content: If I use this adc AD9224ARSZ (40msps), Can I make 4mhz scope? (with using stm32f407)

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 09:59:42 pm
content: Quote from: Karamel on March 27, 2016, 09:54:59 pmWhat is 4MHz? Bandwidth? Sampling rate?Both are possible, but why bother with external ADC? STM32F407 has 3 internal ADCs that can be interleaved to achieve 6Msps sampling rate.BTW, Figure 18 in the ADC datasheet shows proper clamping schematic.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 10:23:31 pm
content: Thanks. I have added clamping diode. Max adc sample rate / 10 is a good idea? or not?

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 10:24:27 pm
content: Quote from: Karamel on March 27, 2016, 10:23:31 pmI have no idea what you mean here.And if you mean 40 MHz sampling rate and 4 MHz bandwidth, then forget about it. There is no way you are getting that 40 MHz stream into the MCU.

author: Karamel
author_rank: Regular Contributor
timestamp: March 27, 2016, 10:32:57 pm
content: Let's think we have a 40 mega samples per second adc and we want to show a signal, which we dont know its frequency, on screen. Thus, If we get input signal frequency x 10 times. We can create a signal on screen? so, if this idea is true, our max. frequency of input signal could be 4mhz?

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 10:34:25 pm
content: The idea is correct, but there is no way you can get that 40 Msps 12-bit data inside the STM32.

author: ataradov
author_rank: Super Contributor
timestamp: March 27, 2016, 10:36:52 pm
content: Also, for 4 MHz bandwidth that frontend is not going to work well, you need to design something much better.LM358 has 1 MHz GBP.

author: MK14
author_rank: Super Contributor
timestamp: March 27, 2016, 10:40:44 pm
content: Here is a (somewhat low cost, Arm) MCU with 80 MSP (80,000,000 ADC samples per second), performing as a scope, for 99 Euros.http://www.embeddedartists.com/products/app/labtool.phpQuote

author: Karamel
author_rank: Regular Contributor
timestamp: April 01, 2016, 10:39:56 pm
content: Quote from: ataradov on March 27, 2016, 10:36:52 pmI guess, TL082 is good at bandwith. GBP = 4mhz and it is pin to pin same.

author: ataradov
author_rank: Super Contributor
timestamp: April 01, 2016, 11:36:02 pm
content: Quote from: Karamel on April 01, 2016, 10:39:56 pmBut there is still no way to get 40 MHz stream from the ADC into the MCU.