Shop OBEX P1 Docs P2 Docs Learn Events
DAQ — Parallax Forums

DAQ

JRNJRN Posts: 3
edited 2007-05-01 01:30 in BASIC Stamp
I am using A BASIC Stamp HomeWork Board and I have a flexiforce op-amp circuit connected to an 0831CCN A/D converter.· Right now I am using the BASIC Stamp as a simple volt meter but what I want to do is use StampPlot to plot the change in voltage.· Does anyone have any suggestions.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-04-30 18:44
    (suggestion) Read the instructions that come with stampplot and then if it does not work ask a question.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-04-30 18:56
    The download page for StampPlot has 2 tutorials which cover a good range.· I'd recommend those over the help files for starters.

    -Martin


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • JRNJRN Posts: 3
    edited 2007-04-30 19:10
    I got stampplot running the data logger shows that the decible value (Volt) reading is changing, the bianary values is changing and the ASCII code it remaining constant. In the lower left corner I am told that the data being recieved is bad data. What kind of data does this program want.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-04-30 19:18
    Again, those tutorials start off talking about correct data structures. Post your "DEBUG" code and I can take a look at it, but essentially it wants ASCII values separated by commas.
    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • JRNJRN Posts: 3
    edited 2007-04-30 19:53
    I am not getting a checksum error. Here is my DEBUG code.
    '
    [noparse][[/noparse] Title ]
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '
    [noparse][[/noparse] Declarations ]
    adcBits VAR Byte
    v VAR Byte
    r VAR Byte
    v2 VAR Byte
    v3 VAR Byte
    '
    [noparse][[/noparse] Initialization ]
    CS PIN 0
    CLK PIN 1
    DataOutput PIN 2
    DEBUG CLS 'Start display.
    '
    [noparse][[/noparse] Main Routine ]
    DO
    GOSUB ADC_Data
    GOSUB Calc_Volts
    GOSUB Display
    GOSUB Plot
    LOOP
    '
    [noparse][[/noparse] Subroutines ]
    ADC_Data:
    HIGH CS
    LOW CS
    LOW CLK
    PULSOUT CLK, 210
    SHIFTIN DataOutput,CLK,MSBPOST,[noparse][[/noparse]adcBits\8]
    RETURN
    Calc_Volts:
    v = 5 * adcBits / 255
    r = 5 * adcBits // 255 '.. new line
    v2 = 100 * R / 255
    RETURN
    Display:
    DEBUG HOME
    DEBUG "8-bit binary value: ", BIN8 adcBits
    DEBUG CR, CR, "Decimal value: ", DEC3 adcBits
    DEBUG CR, CR, "DVM Reading: "
    DEBUG DEC1 v, ".", DEC2 v2, " Volts"
    RETURN
    Plot:
    DEBUG SDEC v, ".", SDEC v2,CR
    RETURN
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-04-30 20:38
    There's a lot in the DEBUG taht StampPlot will simply toss into the message window, though starting with "8-bit" may cause it to try to process it as a value since it starts with a number.· Also, the last DEBUG needs to end with a CR.
    Display:
    DEBUG HOME
    DEBUG "8-bit binary value: ", BIN8 adcBits
    DEBUG CR, CR, "Decimal value: ", DEC3 adcBits
    DEBUG CR, CR, "DVM Reading: "
    DEBUG DEC1 v, ".", DEC2 v2, " Volts"
    RETURN
    On the plot, it should take this ok, don't see a problem with it.
    Plot:
    DEBUG SDEC v, ".", SDEC v2,CR
    RETURN

    You mention you are not getting a checksum error, as I would expect not since you are not sending binary values such as DEBUG V, but instead you are sending ASCII values using SDEC.· There is no checksum when using ASCII values.

    I would start by taking out the DISPLAY routine, and just sending the plot data.· Once you have that plotting, you can add back in line by line the display code to see if one of those is causing issues.

    I forgot to link earlier, but those tutorials can be found at the bottom of:
    http://www.selmaware.com/stampplot/download.asp

    -Martin
    ·
  • KatyBriKatyBri Posts: 171
    edited 2007-05-01 01:30
    If your familiar with Excel, you can use it as a datalogger by adding in the free add-in available at the Parallax web site:

    http://www.parallax.com/html_pages/downloads/software/software_plxdaq.asp

    You can insert a chart/graph in the Excel worksheet linked to the columns/rows of data to view your data.
Sign In or Register to comment.