Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

O-scope input

Status
Not open for further replies.

Ambient

New Member
I am going to try building my own DMM/Scope with a PIC18F and graphic LCD from Sparkfun. Right now I am trying to get the analog parts prototyped. I had some bookmarks of scope projects that I lost, and cannot find them again for some reason. So I started my own. Does anyone see any problems with the schematic I have so far? (I still have to make LPF and threshold detector.)

**broken link removed**
 
Would you care to post a link to the schematic you mention in your post?
 
Well as it's only a crude block diagram it doesn't really show very much, but what's the polarity indication for?. For a scope you normally simply bias the input half way, so zero volts reads mid scale, positive above, and negative below.
 
You're right, forgot about that. I don't need it at all. I realize it is just a block diagram, but I wanted to make sure my idea was fine before I start ordering parts. Some of them are not very cheap, like the low offset r-r op-amps. I will probably post the entire project in the project section when I finish.
 
Ambient said:
Some of them are not very cheap, like the low offset r-r op-amps.

You might try checking my PIC analogue tutorial hardware, it nicely avoids the need for a rail to rail opamp - which I'm doubtful really exists anyway! :D
 
Yea r-r is just relative, but my lm6134's have an output that can get up to 10mV away from the rail. I am not sure about the input end though, cause the spec sheet says it can take -.25V to 5.25V (5V supply), with a 250uV offset. I am assuming they mean that it will still operate as it should with that Vin range?

The tutorials are very helpful, but won't your analog board allow negative voltages onto the A/D input? That is why I was considering using a single-ended supply (that is what the virtually r-r op-amps are for) to only get positive voltages.
 
Ambient said:
Yea r-r is just relative, but my lm6134's have an output that can get up to 10mV away from the rail. I am not sure about the input end though, cause the spec sheet says it can take -.25V to 5.25V (5V supply), with a 250uV offset. I am assuming they mean that it will still operate as it should with that Vin range?

The tutorials are very helpful, but won't your analog board allow negative voltages onto the A/D input? That is why I was considering using a single-ended supply (that is what the virtually r-r op-amps are for) to only get positive voltages.

Yes it 'would' which is why I have a limiting resistor from the opamp to the PIC pic, to keep it safe (in conjunction with the protection diode in the PIC). Bear in mind the tutorial board is designed for positive input only - you would simply need to bias the opamp half way, to give a +1.25V/-1.25V maximum input range.

But this simple (and cheap) method means true 'rail to rail' performance (0-2.5V), using only basic opamps, plus using the precision reference gives better accuracy. I put a LOT of thought into the design - and didn't like the idea of using a supposed rail to rail opamp, because they don't really manage it, and I wanted a zero reading for zero volts input, and a 1023 reading for a Vref input.
 
How does this sound:

Virtual Ground = 2.5V
Vref = 5V
max input swing = +/-1.25V
Pic will automatically switch to voltage divider for higher voltage if 4.75V<=A/D<=0.25V
The Pic will start measuring with the lowest scale divider and adjust accordingly to get within range.

This way I avoid the rails just like you recommend.
 
Last edited:
Ambient said:
How does this sound:

Virtual Ground = 2.5V
Vref = 5V
max input swing = +/-1.25V
Pic will automatically switch to voltage divider for higher voltage if 4.75V<=A/D<=0.25V
The Pic will start measuring with the lowest scale divider and adjust accordingly to get within range.

This way I avoid the rails just like you recommend.

Except you're only using half of the PIC's resolution, by using a 2.5V Vref you get full resolution, and better accuracy (because of the precision reference voltage).
 
I can't believe I added those numbers wrong lol. The problem is that I have to avoid getting within 25mV of either rail, right? So:
Virtual Ground = 1.5V
input swing: +/-1.25
Vref = 3V

Or still use 5V Vref and allow input to swing +/-2.25V

The second option may be easier, but since I want to measure very small voltages I may use a lower value Vref.

But with your idea of using a double-ended supply, I can put the input directly into an op-amp instead of a voltage divider with high resistance. But I still cannot measure more than my power source voltage.

The problem with using a high resistance divider (connected right to the input) is that an op-amp connected to it (also high resistance) will screw up the divider, right? I would need a lower resistance divider so that the op-amp has no effect on it? But then I will draw more current from my signal...which is not good practice.

Am I on the right track finally?
 
Last edited:
Ambient said:
I can't believe I added those numbers wrong lol. The problem is that I have to avoid getting within 25mV of either rail, right? So:
Virtual Ground = 1.5V
input swing: +/-1.25
Vref = 3V

Or still use 5V Vref and allow input to swing +/-2.25V

The second option may be easier, but since I want to measure very small voltages I may use a lower value Vref.

If you're using opamps on the input you simply adjust their gain accordingly, but it's still better to use a precision reference rather than the much lower quality Vdd rail.

But with your idea of using a double-ended supply, I can put the input directly into an op-amp instead of a voltage divider with high resistance. But I still cannot measure more than my power source voltage.

Of course you can, you simply fit an attenuator in front - like a scope, or like a meter.

The problem with using a high resistance divider (connected right to the input) is that an op-amp connected to it (also high resistance) will screw up the divider, right? I would need a lower resistance divider so that the op-amp has no effect on it? But then I will draw more current from my signal...which is not good practice.

You simply design accordingly, normally keeping the eventual input impedance the same - 1Mohm is standard for scopes.
 
With the second quote, I meant if I was using a direct input into the op-amp (no attenuation). By attenuator, I assume you mean voltage divider, which is what I was trying to avoid on the input. But if 1Mohm is common for scopes, I guess I should just use one, since I only need to measure up to +/-50V. I could just use a digital pot in that case (I want no moving parts).

Thanks for your valuable help!
 
Ambient said:
With the second quote, I meant if I was using a direct input into the op-amp (no attenuation). By attenuator, I assume you mean voltage divider, which is what I was trying to avoid on the input. But if 1Mohm is common for scopes, I guess I should just use one, since I only need to measure up to +/-50V. I could just use a digital pot in that case (I want no moving parts).

100V is quite a large range, be careful what you're using with it. If you put + or - 50V directly in the input of an opamp, you wouldn't have an opamp for very long!.

BTW, what sort of frequency range are you hoping to get?, and don't forget you need to low-pass filter the input to the PIC.
 
Yea, I am going to use a divider like you suggested (digital pot) on the input feeding the op-amp. That way I can start off at the highest scale divider and have it auto-range down. If there are no digital pots that can take that voltage I can use resistor dividers and then use an analog mux off of those. But then I have to find a mux that will not get damaged also. So this may force me to lower my input range. Maybe also using a 10X probe will be good. I have to do some reading first.

I think the PIC18 I have coming in can get up to 40MHz max, but I will be looking up overclocking it a little more. I don't think I will be able to get a very large frequency range, as I need the PIC to run an LCD and control the mux at the same time. I doubt I would be able to get up to 1MHz. Maybe I should look at using one PIC for A/D and mux/pot control, and another for the LCD? It would be a good challenge to design a master/slave system. I figured it would be more time efficient to use the C compiler when dealing with the LCD and multiplication, so I chose the 18F serires.

I am trying to make the entire device for under $50, with the GLCD being $20USD. I think this is attainable.
 
You are talking about using a digital pot or analog mux to take 100 volts down to 5 volts. All the parts that I have use will not work above their supply voltage.
What you want to do is very doable. I just want to make sure you do not connect the mux/pot directly to the input connector.
 
That's what I was worried about. I will just have to use a 1% resistor divider with an analog mux then.
 
Ambient said:
I doubt I would be able to get up to 1MHz.

So do I :p

I suggest you may be looking at more like 10Khz?.

I wouldn't worry about the input stages for now, get the display system working just with the plain PIC input pin, and see what you can get.

If you check the Inchworm+ thread there is a link to just such a 'scope' as a GLCD demo.
 
10kHz would be kinda dissapointing...maybe I can get it higher by using 2 PICs. I hope so. The display will be the most complicated part, so I guess that would be better to get done first. Thanks for the help.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top