Notices
Results 1 to 9 of 9

Thread: Computer data input

  1. #1 Computer data input 
    Forum Professor
    Join Date
    Apr 2007
    Location
    In the circuitous haze of my mind
    Posts
    1,028
    How can I take a changing voltage from a device's output and link it into a computer for observation? The best I could do so far is to directly link the signal into my computers sound card and observe the signal through the audio program Sonar as if it is an audio signal. Unfortunately that method is less than ideal, so I'm trying to find a better way. A DMM computer link up will not work either since I need a very high sampling rate. Thanks.


    Of all the wonders in the universe, none is likely more fascinating and complicated than human nature.

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."

    "Great spirits have always found violent opposition from mediocrities. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence"

    -Einstein

    http://boinc.berkeley.edu/download.php

    Use your computing strength for science!
    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Sophomore
    Join Date
    Mar 2009
    Posts
    139
    There are a bunch of different ways.

    If you're handy you can make a quick A/D converter board with an RS232/FTDI USB interface, and have a simple serial program read the data.

    You could buy a computer oscilloscope if the frequency is low enough.

    You could find out the highest voltage input allowed by your sound card, how many bits per sample, and get a rough estimate by recording the audio and interpolating the voltage from approximates.

    What is the range of the voltages expected, how many samples do you need, etc?


    --
    -M

    "Those that would give up essential liberty to obtain a little temporary
    safety deserve neither liberty nor safety."

    -Benjamin Franklin, An Historical Review of Pennsilvanya, 1759
    Reply With Quote  
     

  4. #3  
    Forum Isotope (In)Sanity's Avatar
    Join Date
    Oct 2004
    Location
    Mesa AZ
    Posts
    2,699
    Sound cards will not accept a DC voltage, only a changing AC voltage. The max voltage would not apply as it's very easy to divide the voltage down with a couple resistors, But again only if it's AC.

    A/D converters are so cheap these days. I for one am a big fan of the PIC micro controllers. You can get several that have USB interfaces built in as well as multi channel A/D conversion. Then again a bit above the scope of the person asking, otherwise they wouldn't be asking.

    If you need a very high sample rate then perhaps your need a Flash A/D converter. You can get to many millions of samples per second. I have a few sitting in my parts bin. They are not very expensive.
    Pleased to meet you. Hope you guess my name
    Reply With Quote  
     

  5. #4  
    Suspended
    Join Date
    Jan 2008
    Posts
    439
    The three important things here are..

    1) The sample frequency

    2) The sample resolution

    3) Sample accuracy.

    These factors will determine the type of ADC required ie flash, successive approximation, dual slope integration etc.
    Reply With Quote  
     

  6. #5  
    Forum Professor
    Join Date
    Apr 2007
    Location
    In the circuitous haze of my mind
    Posts
    1,028
    I looked at computer oscilloscopes, but they are very expensive and I would like to have a program actively read the data, assign names to the values, and use them according to my program to calculate what I need.

    For now I am expecting no more than 1V at a minimum of 10Hz. Although once I get the basics down I will move up to a minimum of a 100Khz sampling rate.

    I thought about making an A/D converter, although I am not entirely sure how to...

    How can I get started using PIC? I looked it up a while ago but was concerned about not being able to doing anything useful due to my lack of a real education in electrical and computer engineering. I only know the basics along with some Python coding experience.

    What is the difference between frequency and resolution? In terms of accuracy, it needs to be very accurate. I need output values with a high dynamic range and a high level of consistency.

    I'm not sure how to explain what I am trying to do, but my current goal is to acquire anywhere between 100 and a few thousand numerical values from the analog wave; the analog device I am using to record the data is very very precise, so the A/D converter needs to maintain the exact value output from it. I then need a way to use a coding language to record and call upon the data for use in my program. Eventually however I will need inexplicable sampling rates, which leads me to another question: Does such a thing as an analog buffer exist? Something that can slowly output an extremely short signal so that a A/D converter can output enough readings from it.
    Of all the wonders in the universe, none is likely more fascinating and complicated than human nature.

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."

    "Great spirits have always found violent opposition from mediocrities. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence"

    -Einstein

    http://boinc.berkeley.edu/download.php

    Use your computing strength for science!
    Reply With Quote  
     

  7. #6  
    Suspended
    Join Date
    Jan 2008
    Posts
    439
    Frequency aqnd resolution..

    Frequency is the number of samples taken in one second, if you have a 10 hz wave and sample it at 3 points it will not look too much like a sine wave (just plot sine 0,120,240,360,480 etc on a sheet of paper and you will get the idea.

    the more points you plot the higher the frequency so now draw another plot at 10 degree intervals and you will see we begin to get the classic sine shape.

    Resolution, sine as you know will give a value of -1.0 to + 1.0 with an infinite number of places after the point, this number of places is effectively the resolution, ie to what degree of accuracy you can resolve the exact amplitude of the waveform.

    If your signal is +/- 2.5 volts peak to peak (ie 5 volts all told) and you have an 8 bit convertor it is simply 5/ 2^8 volts or 5/256 approx 0.02 volts thus all all readings will have an amplitude accuracy of +/- 0.02 volts.

    There is as you can see a relationship here, it would be no good sampling a 10 hz wave 100,000 times a second with an 8 bit convertor as it round most of the readings into huge blocks of identical numbers.

    If you wish to measure a 10 volt pk to peak sine wave to an accuracy of 0.001 volts (1 millivolt) then you effectively need to resolve 10,000 points. since the accuracy is always +/- 1 point (ie a span of 2 you now double that to 20K points.
    The next power of two above 20,000 is 32768 (ie 2 ^16) thus you would need a 16 bit A-D

    Next you look far an A-d that will sample 20,000 points in 1 cycle, thus if you are sampling a 1Khz wave you will be looking for an A-D with a sampling frequency of 20MHz.

    If however your waveform is regular you may use fourier analysis which is essentially simpler hardware but tons of software, I have never actually used this method myself but have used systems shich employ it, you may wish to google fourier analysis as an alternative to a straight A-D sampling.

    I finished my design career around the time PICS came out, although I have read of them and have a good grasp of them I have not used them others will have to fill you in google PICS they are simply a tiny compututer with an interface (serial link I think or maybe now USB) with a number of prograamable input pins you write a program and the pic follows your instructions... at which point his knowledge fades into uncertainty....


    Absorb that first then re-read INsanity's last post and print both of these out then we'll move on to the next point.
    Reply With Quote  
     

  8. #7  
    Forum Sophomore
    Join Date
    Mar 2009
    Posts
    139
    To add to Megabrain's post, you also need to know a lot more than you're providing us about your analog signal.

    Some things you should look up/read up on are the Nyquist-Shannon sampling theorem, aliasing, A/D conversion, and microprocessing units/hardware.

    Basically, the short version of the Nyquist-Shannon theorem is that you need to have a sampling rate of more than 2x the highest frequency signal you'll be trying to record. So if you're looking to record a 10 kHz signal, you'll want a 20,001 Hz or higher sampling rate. This is the minimum you can do to avoid aliasing. Normally, you'll want to give yourself wiggle room, and sample with maybe a 25 kHz rate in this example.

    There are a bunch of ways to do this, but if you're looking for simple hardware, I would suggest the PICs with the built in A/D converters. This way you can buy a development board and not need to modify it much. If you're "circuit handy" and will not have much trouble with designing/building your own circuit, and you need more resolution than the PIC has, there are plenty of A/D Converters that are readily available.

    Personally, I hate the PIC, but there are some PICs that will do what you want. I believe the 18F series has an on board ADC, and I know the PIC32MX series controllers contain more than 1- 10 bit ADC built in. Also, while looking around for a project a while ago, I came across this board, it might be of help:

    http://www.ise.pw.edu.pl/~wzab/picadc/picadc.html
    --
    -M

    "Those that would give up essential liberty to obtain a little temporary
    safety deserve neither liberty nor safety."

    -Benjamin Franklin, An Historical Review of Pennsilvanya, 1759
    Reply With Quote  
     

  9. #8  
    Forum Isotope (In)Sanity's Avatar
    Join Date
    Oct 2004
    Location
    Mesa AZ
    Posts
    2,699
    Personally, I hate the PIC, but there are some PICs that will do what you want. I believe the 18F series has an on board ADC, and I know the PIC32MX series controllers contain more than 1- 10 bit ADC built in. Also, while looking around for a project a while ago, I came across this board, it might be of help:
    Most PIC micro's have ADC built in. From the 12F series on up. I've been doing a lot of work with the 18F1320 lately. It only has a 10 bit resolution, but that is more then enough for most things. There are several models that have USB support built in to the chip. You could always go with an Atmel micro as well, either do what they are intended to. I only prefer the PIC's as I already have all the tools needed to work with them.
    Pleased to meet you. Hope you guess my name
    Reply With Quote  
     

  10. #9  
    Forum Professor
    Join Date
    Apr 2007
    Location
    In the circuitous haze of my mind
    Posts
    1,028
    I have had a few setbacks with my project (sensor blowing up), so I will not be able to work on the ADC/PIC device immediately. I will get back to this when I can. Thanks for the help so far.
    Of all the wonders in the universe, none is likely more fascinating and complicated than human nature.

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."

    "Great spirits have always found violent opposition from mediocrities. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence"

    -Einstein

    http://boinc.berkeley.edu/download.php

    Use your computing strength for science!
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •