sigma Delta ADC
realolman1
Posts: 55
The sigma delta ADC result is stored in a long, but it only seems to go from 0- 500 as an integer.
That doesn't seem to be enough resolution for a long, or much resolution at all
Edit:
I guess more to the point: How many different voltage levels should I be able to read between 3 and 0 volts using the sigmaDelta ADC?
I am using a TMP36 temperature sensor that is supposed to output 10mV / deg C from -40 to +125 C ...what is the smallest increment of a Degree that I should be able to read? Should I be able to read 0.1 deg C?
thank you
That doesn't seem to be enough resolution for a long, or much resolution at all
Edit:
I guess more to the point: How many different voltage levels should I be able to read between 3 and 0 volts using the sigmaDelta ADC?
I am using a TMP36 temperature sensor that is supposed to output 10mV / deg C from -40 to +125 C ...what is the smallest increment of a Degree that I should be able to read? Should I be able to read 0.1 deg C?
thank you
Comments
For example: In this example I shifted right 5-bits so that my resolution goes from 0 to 127 which is very stable in my application.
The apparent resolution of a Sigma Delta is set by the integrate time, but the practical resolution is set by the real world.
See other posts for measurements of Prop ADC noise floor/effective bits, but IIRC in the order of 10-12bits is practical.
0.1'C is one part in 1650, or about one part in 3000 if you use no amplifier. That's pushing to ~12b.
The Prop use a simple CMOS inverter, so has poor absolute Zero tolerance - affected both by Vcc and the process.
You could run a second channel to give an 'auto-zero' ~50% value, and/or you could calibrate at some known temperature.
Selecting the integrate time to be a whole-mains cycle or multiple, can null the mains-pickup noise.
Or, you could look at a Digital Sensor like TMP05, if you want longer lead tolerance, and no degrade of the as-shipped calibrate.
and I'm not sure its doing as well as .33 degrees... I'm in the process of checking it out
I originally had a pot hooked up to 5 vdc... now I have a TMP 36 connected to 3vdc.
My main concern with this thread is: what is the potential resolution of the SigmaDelta ADC ? ...
ErNa and jmg seem to be quite knowledgeable, but I still don't know what it is
thank you all for your help
I presume you have read the Sigma Delta Analog Application Note. If not then look for it on the parallax propeller documents section of the parallax website.
The ap note they are referring to is AN008 which gives you the necessary details for connecting and operating the sigma/delta ADC.
Jim
https://www.parallax.com/downloads/an008-sigma-delta-analog-digital-conversion
You can find all the Application Notes from the store website by going to Support>Download, and typing in "AN0" in the Download Title box:
https://www.parallax.com/downloads
Attached is the file I modified slightly ( not the machine language) to Get the A-D conversions.
I have read the Sigma Delta Application note. But how do I modify this to read 0.1 degree, using a TMP36 sensor, which is supposed to be 10mV/ degree and 0.75 mV at 25 deg C?
I suppose , in other words, how do I make the ADC read 1 mV increments?
Google op-amp circuits for a zillion examples
The ADC measuring will take longer (8 times) but for your application it's still more than fast enough.
It will not be exactly 1mV resolution but in that range. If you really want exact 1mV you need to adjust the ADC_INTERVAL value until it fits.
Andy
"This particular approach
does not lend itself to the TMP36 because of its inherent 0.5 V
output offset."
I don't know what that means 'but' if the TMP36 has 10_bit analog resolution you should be able to get temperature in 0.1° increments but I would still recommend a dedicated ADC chip like the MCP3204 for that level of precision.
And lardom, I am not ignoring your advice, I am just trying to find out what resolution is possible, and why I am unable to get better resolution, using only the SigmaDelta ADC and the propeller without additional hardware.
I guess simply put...will the Sigma delta ADC and the propeller read 1 mV or not?
thank you
I have spent any patience I may have had over the years. I just want to know what the capabilities of the propeller are... I am disappointed that they don't have any "real" analog inputs, but instead rely on some circuit made out of discreet components
After all of this I still don't have the answer to my question... will the SigmaDelta ADC software and capacitor/resistor arrangement read in 1mV or less increments? If so, how?
thank you
Many on this forum aren't as young as they used to be, and there are many that are retired or close to it, so don't feel these things are too much for you, just give it a go and there are plenty of chaps standing around to give you a hand. You are not alone.
BTW, remember that the Propeller chip was not made by a team of design engineers in some international section of a big corporation so it's a credit to Parallax and Chip himself. Things like A/D and even perhaps Flash etc, things we take for granted these days are easy to implement if you can afford to pay the setup costs and take your chances. The P2 does have A/D and D/A galore, or more correctly will have, once it goes into production.
This is a somewhat common view of the Propeller when people start working with it, particularly if you are used to other MCUs that have analog I/O capabilities. The current Propeller is an all-digitial interface. The methods being used to connect analog inputs is the same as you would do on a digital I/O pin of almost any other MCU. Of course, the Propeller has counter modules that facilitates the processing (and/or generation) of these signals, but they're still just dealing with digital I/O.
And, yes, baked-in analog I/O would be nice. For that, we have the upcoming Propeller 2. For the new chip, every pin has an asynchronous "smart" cell that's capable of a number of modes, both digital and analog. Until the Propeller 2 is released, however, we must do what we can with the current Propeller. For that, we either use a digital peripheral (as Peter recommended) or practice the fine craft of analog-to-digital interfacing!
If this is just a learning experience for you, I think you'll get more mileage out of the experience if you go Peter's route. Learning the analog part is certainly valuable, but I suspect it would be much easier and more enjoyable if you already have a good feel for the rest of the chip first.
No no no no, there is no voltage reference and comparator input on the P1 that can trigger precisely and accurately regardless of voltage or temperature etc. The sigma/delta A/D is ok for capacitively coupled analog signals but I wouldn't try to use it for measuring DC with any kind of accuracy or precision. Rough battery volts it may do, millivolt? No way Jose.
BTW, even MCUs with 12-bit A/D will have trouble there too, as I find you lose a couple of bits of precision due to noise etc anyway.
You know what? Wouldn't it be great if they could integrate the temperature sensor, a 16-bit A/D, a voltage reference, and a serial interface, all into one tiny little chip, and sell it for a buck!
Wait a minute....
'Cheap' is a good thing. Good luck!
You might find the followiing thread informative,
troubles-with-sigma-delta-adc
...from 2007, when we all were trying to probe the limits of operation. It may be more informative than you want, from a simple question it evolves into a fairly deep discussion of the math involved. Later on Rayman proposes to measure a thermocouple and demonstrated breadboarded success with a 27% change in reading when moving from ice water to boiling water, about a 4mV change in thermocouple output. Caution, it would tend to drift over time due to drift in the propeller thresholds and components. Another thread that gets into it, with schemes for improving the precision, some by chopping the signal...
same-threshold-voltage-for-all-pins-on-a-given-propeller-chip
The 100k/39k resistors lift the TMP36 output voltage to about 1.42V which is the threshold voltage of a Prop-pin. With that the FB resistor has a chance to do its work.
Andy
Sometimes its just fun to try something thats new to you out, and probe its limits. I did this with the sig/delt atod and was impressed with what was possible - even using it to measure resistors and capacitors for fun.
When it comes to wanting to produce reliable repeatable results with minimum fuss, a nice ready made solution in the form of a chip of some kind, with simple interface, appeals to me. For temperature I have found the DS18B20 a great resource. Three pins in a transistor type package, fractional degree results and on ebay for £1 in UK money and available in probe format for not much more. A whole string of these can use the same three wires- each having unique addresses, accessable with a simple serial protocol.
Worth playing with just for the fun of it- I have two sharing one flex using only two wires- (possible over short distances of 10 metres and limiting the higher temperatures when three wires perform better), to measure outside / inside temperatures 24/7, results plotted on vga screen using Propbasic. At this moment its zero degrees outside and 20 inside.
Dave
Peter Jakacki wanted to know why oh why I was trying to use an analog sensor. I did not post that I was old and didn't have much money to get sympathy or anything else... it was just a statement of fact answer to the why oh why question....
lotta places want to charge you a buck for a chip and 15-20 bucks shipping... I found 5 of these for $15 including shipping... the best deal I saw at the time.
I did not know about the MCP9808, and frankly it sounds like it would probably be a whole 'nother can of worms trying to communicate with that
Hey realolman, I'm just trying to make your job easier or at least give you a choice. You could just use those 1-wire sensor stainless steel probes from ebay, they are only $1.40 with free shipping. I use these ones also and don't worry about trying to communicate with these or the I2C devices as it really is quite simple plus the OBEX has plenty of code for these too. Once you've used I2C you can then realise that there is not much more to it then reading and writing bytes plus simple start and stop condition states. The main thing is to have fun doing it and not paint yourself into a very frustrating corner because you thought you'd do it the "simple" way.