Measuring voltage with the MCP3008 - Page 1
Forum section: electronics / projects

author: hluzdun
author_rank: Newbie
timestamp: March 05, 2017, 09:22:26 pm
content: Hello everyone,I'm about to start a project to create a poor-man's oscilloscope using the Micro-Nova Mercury (Spartan 3 FPGA + MCP3008 ADC on the board). I figured I should start with a simple voltmeter that shows the measured voltage on the 7-segment displays on the baseboard. The problem is, I'm having a difficult time making sense of the MCP3008's datasheet. As far as I know, a voltmeter should draw as little current from the circuit that is being probed, but on the other hand a certain amount of current must flow to the MCP3008 for it to actually register an input.So assuming I'll be measuring voltage in the 0-5V range:1) What kind of resistors should I be using on the input probe?2) Where can I find the answer to question 1 in the datasheet (Minimum current for input)?Any help or pointers to an informative reading material would be appreciated, as I've been looking around the internet for a few days now and haven't found an answer.

author: cyberfish
author_rank: Regular Contributor
timestamp: March 06, 2017, 10:19:47 am
content: Quote from: hluzdun on March 05, 2017, 09:22:26 pmThe current draw is not constant.Page 18 gives you the equivalent input circuitry (inside the chip). Ignore the two diodes for now - if you don't exceed Vcc and Gnd, their effect should be negligible.That leaves you with the input pin capacitance Cpin, input leakage current Ileakage, switch resistance Rs, and sample/hold capacitance Csample.When the input changes, it has to charge Cpin (potentially high current, but very very short time), and also charge the sample and hold capacitor through Rs. The only constant current draw once all the capacitances have been charged is the input leakage current (page 4, 1nA typical, 1uA maximum).That means the input resistance determines how fast you can charge the capacitances, which decides how much bandwidth your system has (how fast can the ADC track your input voltage). Figure 4-2 tells you the relationship between your input resistance and maximum speed you can run the ADC at that would still give you good accuracy. For 5V range, that's about 500 ohms maximum. If you don't mind the ADC not being able to track faster signals (which is probably the case here since you can't read signals that fast from the 7-segment display anyways), you can use higher resistance. In that case you'll just have to make sure the 1uA maximum leakage current won't produce a significant voltage drop.If that's not acceptable, you'll have to add an external buffer using an op-amp for example -https://en.wikipedia.org/wiki/Buffer_amplifier#Op-amp_implementation

author: hluzdun
author_rank: Newbie
timestamp: March 07, 2017, 12:43:37 am
content: First of all thank you for your informative reply.Since my final goal is to develop a simple oscilloscope with as fast a sampling rate as the on-board ADC can handle, it looks like using an op-amp buffer is a must.So basically the plan is to hook up a two single power op-amps (one for each probe) in the following way -+IN <- Positive/Negative probe-IN <- Connected to Vout of the op-amp to form the negative feedbackV+ <- Connected to the Mercury's 5v power supplyV- <- Connected to the Mercury's groundand finally the Vout from each of the op-amps will be connected to CH0/1 respectively on the MCP3008 with a 100 ohm resistor.Does this make sense or am I making a huge mistake here?PS.For anyone coming without proper EE background (like me) reading this post in the future looking for information about how op-amps work - here are some videos I've found to explain the subject clearly (and most importantly without any current flow or amplification appearing seemingly out of nowhere):

author: cyberfish
author_rank: Regular Contributor
timestamp: March 07, 2017, 03:20:56 am
content: Quote from: hluzdun on March 07, 2017, 12:43:37 amYes, if you want typical oscilloscope impedance (1 megaohms at 1:1, 10 megaohms at 10:1), you'll most likely need a buffer. A "standard" oscilloscope would also have a variable-gain amplifier for scaling, and an offset circuit to be able to measure negative voltages.QuoteYes, that should work. Be sure to pick an op omp that is stable at unity gain, and still give you enough bandwidth (you'll be limited by the MCP3008 anyways since it's a pretty slow ADC, but this will be a problem if you use a much faster ADC).The 100 ohm resistor shouldn't be necessary. Connecting the op amp output directly to ADC input should work.