Measuring a +/- 5V analog signal with the Prop?
CHAD.G
Posts: 11
Hi everyone,
First time poster here and new to the propeller world. I have a research project in which I would like to measure a +/- 5VDC analog signal (adjustable to +/- 10V). This analog voltage is a result of an amplified voltage reading from a strain gage. The strain gage signal is being sampled at 1276 samples/sec on a 14 bit resolution system.
Bottom line, I want to take this +/- 5VDC analog signal which is the result of 1276 samples/sec of a strain gage, and send this to my PC for data logging. Can my Propeller do this?!?
Some HELP would be extremely appreciated!!! Thanks!
First time poster here and new to the propeller world. I have a research project in which I would like to measure a +/- 5VDC analog signal (adjustable to +/- 10V). This analog voltage is a result of an amplified voltage reading from a strain gage. The strain gage signal is being sampled at 1276 samples/sec on a 14 bit resolution system.
Bottom line, I want to take this +/- 5VDC analog signal which is the result of 1276 samples/sec of a strain gage, and send this to my PC for data logging. Can my Propeller do this?!?
Some HELP would be extremely appreciated!!! Thanks!
Comments
www.parallax.com/tabid/393/Default.aspx
There are ways of storing data on SD cards, too, which can be plugged into your PC after a test has been run, that way you don't tie up your PC for simple data acquisition. For example, see the following;
www.rayslogic.com/propeller/Programming/SD_Card/SD_Card.htm
Other Propeller-based data loggers are also possible.
I presume you already have an analog-to-digital converter of some kind to handle your +/-5 volt signal, true? If not, there are various ADC capabilities available on the Object Exchange (aka OBEX):
obex.parallax.com/objects/category/9/
obex.parallax.com/objects/search/?q=adc
Maybe one of the forum gurus can point you to the ideal ADC.
Hope that helps,
Mark
The prop certainly can do it, have a look at this ADC from the parallax store which is in a convenient DIP package:-
www.parallax.com/Store/Components/AllComponents/tabid/762/CategoryID/26/List/0/catpageindex/9/Level/a/ProductID/239/Default.aspx?SortField=ProductName,ProductName
If you need some more resolution, I'm getting some drivers together for MAX1033 (14 bit, 4ch, 115ksps, $10ish) and/or MAX1301 (16 bit, 4ch, 115ksps). Both operate from single 5 volt rail but have input ranges +/- 12v, +/- 6v, +/- 3v as well as some unipolar ranges too
cheers
tubular
Thanks a ton for the quick input you've already provided! Perhaps to help get me started on the surface of things, am I right in thinking that I will need at least a 14 bit ADC or greater since that is the resolution of the signal I'm trying to capture? Secondly, am I also right in thinking that as long as I can sample (with the propeller) at the same sample rate or higher than the signal I'm trying to capture, then I will ensure I don't "lose" data in the process?
Here's an applet to help pick resistor values:
http://www.pulsedpower.net/Applets/Electronics/SigmaDeltaADC/SigmaDelta.html
Here's example code:
http://www.rayslogic.com/propeller/Programming/ADC.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Apps:· http://www.rayslogic.com/propeller/Programming/Programming.htm
My Prop Info: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
I think there's something called Nyquist sampling rates or criteria that help decide the best rates for doing that. I'm not sure how to use it, though. I'm sure the forum gurus know all about it.
I'm foggy on a few things with regards to this trial I did. First, how much of that slow speed is attributed to the ADC0831 being slow and how much is attributed to the BS2 limitations?
The real bottom line question I have is: Can I expect to achieve much (much!) faster sampling with the Propeller? e.g. if I connected the ADC0831 to the Prop, would sampling be a lot faster, or is the ADC0831 a big limiting factor?
For my research, I actually plan on using at least a 12-bit ADC and I understand that will require even further processing time, but I'm trying to understand the basics with what I have for now.
Thanks again for helping!
There are some ADCs out there that could exceed my driver's capabilities, even at 14-bits. But actually getting precise information at 14-bits of resolution is quite difficult, especially at the speeds you are talking about. Without a bit of engineering, 14-bit precision is lost in the wiring anyway. 12-bits is even a bit dicey without careful layout, but consistent reading should not be a problem.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
For example, a CD player for audio signal 20Hz to 20KHz uses a sampling rate of 40KHz (2 * fIN max)·and an input filter that rolls off sharply at frequencies above 20KHz (low pass filter). If you dont filter out the freqs above 20KHz and sample ie a 41KHz (or 39KHz)·signal at a 40KHz sample rate, you will see a 1KHz signal, clearly not what you intended to see.
Think of the sample rate as a square wave (40KHz)·superimposed over the input as a sine wave (41KHz). On that superimposistion the ADC does a conversion on each rising edge of the sample rate pulse. Put a dot on each rising edge where it crosses the input wave and you will see an output of 1KHz looking at the dots. The important part is the filter to make sure the unwanted (<2*fIN) don't get into the ADC, and sample at least 2* the max f your looking at.
The Nyquist rate is the very bare minimum for a DSP (Digital Signal Processor) before you run into problems.
I hope that makes sense.
rpdb