How do I read analog voltages on SSC-32?

I’m using the A/D converters on the SSC-32 to read the fractional difference in two poles of a pressure sensor bridge.

But, I don’t know the protocol for reading these voltages.

I’m going to be writing the code in VBE.NET, but if anyone knows how to do it in another language, that’ll be just as helpful.

Does anyone know how to poll for the analog values?

Thanks,

-Nick-

I remember at some point you asking the same thing and finding the answer… :confused:

VA VB VC VD

However many of those you send, that’s how many bytes you’ll get back. Each byte should be evaluated numerically as they represent values from 0-255 which will correlate to 0-5V.

I don’t understand Andy man…

You get a voltage reading by how many ASCii characters you get back?

you can send

VA<cr>

and it will return 1 byte with a value between 0-255 representing the voltage on the A channel

if you send

VA VB<cr>

you’ll get two bytes back one for channel A the second for channel B

OHHHHHH!

Thanks, Andy ^.^

So… I tried it, and I think it works (at least, my testing of it has proven true, so far).

Here’s the code that I wrote:

Feel free to borrow it, anyone.

:smiley:

Imports System Imports System.IO Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Manually set the proper timer settings. Timer1.Enabled = True ' Do the timer sub every second. Timer1.Interval = 1000 ' Manually set the proper serial port settings. ' Stick whatever port number you are connecting to here. SerialPort1.PortName = "COM4" ' Set the baud rate equal to the baud rate of the SSC-32. SerialPort1.BaudRate = 115200 SerialPort1.DataBits = 8 SerialPort1.StopBits = Ports.StopBits.One SerialPort1.Parity = Ports.Parity.None End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim i As Integer ' In PID control, "plant" is the term ' for the object being controlled. Dim PlantValue(2) As Byte ' Open the serial port. SerialPort1.Open() ' Go to the subroutine named "RequestByte". RequestByte() ' Go to the function named "ReadByte" twice. For i = 1 To 2 ' Store the VA and VB value in an array. PlantValue(i) = ReadByte() Next i ' Close the serial port. SerialPort1.Close() ' Remove the below comments to display ' the read data in a text box. ' TextBox1.Text = "" ' For i = 1 To 2 ' TextBox1.Text &= PlantValue(i) & " " ' Next i End Sub Private Sub RequestByte() 'Send VA VB <cr> to the SSC-32 SerialPort1.Write("VA VB " & vbCrLf) End Sub Private Function ReadByte() As Byte ' Store a byte within the varialbe ReadByte, ' and send that variable back to the timer sub. Return SerialPort1.ReadByte End Function End Class

Nick et al

I want to connect an IR sensor (which outputs an analog voltage) to the analog inputs on the SSC-32, inputs ABCD but the manual is not clear on what pins are what

usually when you measure an analog voltage this is with respect to ground, therefore I am assuming that since each of the ABCD inputs has 2 pins, one is connected to ground, and one is conencted to the analog input on the SCC-32 onboard mictocontroller.

Looking at the board ABCD and written horizontally, with two pins vertically above each letter, above these are 2 ‘+’ symbols and 2 ‘-’ symbols, specifically the ‘+’ above A & C, and ‘-’ above B & D.

Can someone identify which pin is the ground pin and which is the input pin for each of ABCD

Thanks

Each - is a direct path to ground.
Each + comes directly from the 5VDC regulator.

A, B, C, and D are the actual input pins for the value that you wish to read.

It does seem odd, though, that they would put in those two + pins instead of just having four - pins.

::shrugs::

OK, now I understand, 2 supplies and 2 connections to ground

since I’m running the sensor from the same supply as the SSC-32 and they share the same ground that means I can just connect directly to the ABCD inputs and bingo, thanks