7
\$\begingroup\$

I know that some of these PICs have ADCs built in, and I may want to use that.

I am wondering if there is a way I can effectively dither the input to a low-bit (like 8 bits) ADC with the fewest parts (like no unnecessary op-amp) and all cheap and widely-available vanilla-flavored parts.

The voltage measured might be DC or very low frequency, likely always less than 10 Hz. The effective sample rate might be as low as 50 Hz, but this is after averaging the 500 kHz samples from the ADC.

The ADC was just randomly picked because it looked cheap. The Zener was chosen to be less than 5v breakdown. The resistors are guesses.

My questions reside among the Zener and associated resistors. What's a good cheap Zener to use for a noise source? What kinda r.m.s. AC noise output can I get from some cheap Zener? I want this voltage to be somewhere around the LSB voltage of the ADC which is VREF\$\cdot 2^{-8}\$ or VDD\$\cdot 2^{-8}\$ I do not want to need more than +5v and GND power supply.

The idea is to get, cheaply, much better than 8 bit precision, by dithering and averaging. Anyone do this before? What can I gain from your experience?

schematic

simulate this circuit – Schematic created using CircuitLab


Denouement:

Just FYI: I finally found a reference of someone measuring noise output of zener diodes. It looks like the noise from a zener in breakdown is about 1.5 µV which is far less (about 80 dB) than the 19 mV LSB and won't do much to dither unless one were to amplify it, which makes it less cheap (and I wanted to do this on the cheap).

So Tony EE "RocketScientist", that is the reason the circuit will "certainly not" work. And you didn't say a word why that's the case.

\$\endgroup\$
5
  • \$\begingroup\$ Define your acceptance criteria for Voltage resolution and accuracy with expected SNR and noise bandwidth. Perhaps you can improve by optimizing dynamic range with an offset voltage and gain but certainly not by your schematic \$\endgroup\$ Jul 24, 2018 at 5:06
  • \$\begingroup\$ You picked the wrong ADC to begin with. If you want to measure low-frequency signals with high precision, there are many low-cost devices on the market that are optimized for exactly that. 24-bit precision is readily available. \$\endgroup\$
    – Dave Tweed
    Jul 24, 2018 at 12:08
  • \$\begingroup\$ @TonyEErocketscientist "certainly not by your schematic" ... since i don't even know what the expected shot noise would be (there's about an mA going through R1, but i do not know what the physics are that define the noise voltage or noise current), of course the circuit will not work if that noise level is so much lower than the LSB of the ADC (and i wouldn't want to put in an op-amp to boost it). but if the noise level is in the ballpark of the LSB, there is some summing happening at the IN pin. with a constant Vin, i would expect slightly different values for each sample. then average. \$\endgroup\$ Jul 24, 2018 at 19:00
  • \$\begingroup\$ @DaveTweed, what if i wanna use the 8-bit ADC that is already built into this cheap PIC? and i have far more samples-per-second than i need? averaging is a way to squeeze out more resolution (one bit for every factor of 4 oversampling). averaging and downsampling cost nothing. it was suggested that we just let the ambient noise of the circuit be the dither, but if it's not enough, i could be averaging the same 8-bit number until the cows come home and still have only 8-bit resolution. \$\endgroup\$ Jul 24, 2018 at 19:06
  • \$\begingroup\$ my real question is how much shot noise can i expect to get outa this Zener? i don't have a lab with parts and such anymore (haven't had anything like that for 3 decades or more, my old Tek scope doesn't even work anymore). \$\endgroup\$ Jul 24, 2018 at 19:09

2 Answers 2

4
\$\begingroup\$

This is not a direct answer to your question, but addresses your actual problem.

This is probably not the best way to achieve what you want:

Many, probably even most, PICs come with internal A/Ds. Very likely you can find a PIC with built-in A/D that is cheaper than your "cheap PIC" plus external A/D. The result will also be smaller, and the A/D easier to drive in the firmware.

Before you think about dithering a low resolution A/D, consider:

  1. Do you really need to? Noise is everywhere. Often there is enough random noise, or even non-random noise below half your sampling frequency, so that explicit dithering is unnecessary. Just sample a lot faster than you need, and low pass filter the result. I do this routinely. And yes, this is usually with A/Ds built into PICs.

  2. Use a higher resolution A/D. You say you are using a 8 bit A/D. Very low end PICs come with 8 bit A/Ds, but many also have 10 bit A/Ds available. Instead of hoping to pick up another 2 bits with dithering, just get a A/D with two more bits in the first place. Most newer PICs nowadays even have 12 bit A/Ds, although usually not in the absolute lowest cost models.

\$\endgroup\$
3
  • \$\begingroup\$ the fact is, this is about someone else's design that already has such a PIC on the board. the ADC is connected to a knob (pot), but it could get connected to a "control voltage" or LFO. the PIC spends more than 90% of its time jerking off and i wanna put it to work squeezing a couple more bits of resolution out of that control voltage. \$\endgroup\$ Jul 24, 2018 at 19:13
  • \$\begingroup\$ "...explicit dithering is unnecessary. Just sample a lot faster than you need, and low pass filter the result. I do this routinely. And yes, this is usually with A/Ds built into PICs." that's the good news, Olin. i hope you're correct, because i think that's all we're gonna get to do. i just wish we could toss in something that would guarantee dithering the LSB, as i am afraid that the circuit might be too quiet to effectively dither the 18 mV LSB of the ADC. \$\endgroup\$ Jul 24, 2018 at 19:17
  • \$\begingroup\$ Olin, while i hope it's the case that the 8-bit input need not be explicitly dithered because of 19 mV of circuit noise naturally dithering it. for a changing Vin (like the output of an LFO or similar), i think that sampling a lot faster and averaging (or LPFing) will do. but i suspect i will lose this extra resolution for a constant DC control voltage (like what will come from a pot). i might just be averaging the same input voltage quantized to the same 8-bit DC value without the variation needed to squeeze out any extra meaningful bits. \$\endgroup\$ Jul 25, 2018 at 2:28
9
\$\begingroup\$

You don't need to use a noise source, you can generate a square wave and filter it to be a triangle wave. Make the amplitude just a little more than 1 LSB and make the frequency significantly above your highest to be digitized but not so high that you lose time resolution with your base sample rate: -

enter image description here

The triangle wave causes the ADC's D0 bit to be 1 for about 20% of the time when Vin is zero. If Vin increased from 0 volts to say 0.25 LSB, D0 would be 1 for a longer period of time. This is a form of dithering and is probably more easily translated to a practical solution because you can use a spare IO generating a square wave and RC filter to a approximate a low amplitude triangle wave.

There are many variations of what I've decribed above and my suggestion is just an example. For instance, here's an article that gives a little more detail: -

enter image description here

It shows an analogue signal of amplitude 116.357 dithered with a triangle wave producing a count of 117 for 35.7% of the time and 116 for 64.3% of the time. So if you have good time resolution in your sampling you can trade this against poor amplitude resolution.

It's the same idea for sigma delta ADCs - you counter poor amplitude resolution by having great time resolving ability. It also goes right back to early ADCs that used a digital ramp and a comparator: -

enter image description here

In effect, the digital ramp generator is the dither signal and the comparator is resolving whether the net signal of dither plus Vin is above a certain threhold or not.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ This amounts to turning the LSB into a PWM modulator. Works nicely, and if your MCU has a spare timer/output pin, it can supply the square wave to multiple ADC channels. \$\endgroup\$
    – user16324
    Jul 24, 2018 at 10:37
  • \$\begingroup\$ doesn't look particularly cheap. and the frequency of the triangle wave would have to be carefully chosen to not be related (with a simple fractional ratio) to the sample rate. i.e., every sample should hit the triangle at a different phase. \$\endgroup\$ Jul 24, 2018 at 18:52
  • 1
    \$\begingroup\$ @robertbristow-johnson a spare IO line, a resistor and a capacitor makes a decent enough triangle wave of low amplitude. And that cost is split amongst as many inputs as is needed. \$\endgroup\$
    – Andy aka
    Jul 24, 2018 at 18:56
  • \$\begingroup\$ i get it, Andy. i think i'm gonna take Olin's advise and just hope that the circuit is noisy enough without doing anything and i'm gonna try to get that PIC (someone else is programming the PIC) to average about 40 samples and maybe that will squeeze out 2 or 3 more bits. \$\endgroup\$ Jul 24, 2018 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.