PDA

View Full Version : DAQ



JRN
05-01-2007, 02:27 AM
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.

Franklin
05-01-2007, 02:44 AM
(suggestion) Read the instructions that come with stampplot and then if it does not work ask a question.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

Martin Hebel
05-01-2007, 02:56 AM
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 (http://www.selmaware.com/)
Southern Illinois University Carbondale, Electronic Systems Technologies (http://www.siu.edu/~isat/est)

JRN
05-01-2007, 03:10 AM
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 Hebel
05-01-2007, 03:18 AM
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 (http://www.selmaware.com/)
Southern Illinois University Carbondale, Electronic Systems Technologies (http://www.siu.edu/~isat/est)

JRN
05-01-2007, 03:53 AM
I am not getting a checksum error. Here is my DEBUG code.
' -----[ Title ]-----------------------------------------------------------
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
adcBits VAR Byte
v VAR Byte
r VAR Byte
v2 VAR Byte
v3 VAR Byte
' -----[ Initialization ]--------------------------------------------------
CS PIN 0
CLK PIN 1
DataOutput PIN 2
DEBUG CLS 'Start display.
' -----[ Main Routine ]----------------------------------------------------
DO
GOSUB ADC_Data
GOSUB Calc_Volts
GOSUB Display
GOSUB Plot
LOOP
' -----[ Subroutines ]-----------------------------------------------------
ADC_Data:
HIGH CS
LOW CS
LOW CLK
PULSOUT CLK, 210
SHIFTIN DataOutput,CLK,MSBPOST,[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 Hebel
05-01-2007, 04:38 AM
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

KatyBri
05-01-2007, 09:30 AM
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.