Mike Hogan
Published © LGPL

RDAX - Remote Data Acquisition

RDAX supports remote access to multiple IO types including high current digital, analog and servo motor control.

IntermediateShowcase (no instructions)8 hours1,044
RDAX - Remote Data Acquisition

Things used in this project

Hardware components

Phidgets SBC3
×1
Phidgets 0/16/16
×1
Phidgets Temp 4
×1
Phidgets Temp/Hum Sensor
×1

Software apps and online services

Visual Studio 2017
Microsoft Visual Studio 2017

Story

Read more

Schematics

RDAX device and connections

RDAX configured for multi-io using Phidgets

External Connector Pinouts

Phidgets Connections

Phidget SBC3 connected to interface modules

PCB layout

Component layout for RDAXC

RDAX pcb layout

PCB placement for RDAX

PCB Connection Illustration

RDAX with Phidget Inc. interface boards and wiring configuration

Logic Diagram

RDAX connection diagram

RDAX GreenHouse Application

Signal Diagram

Greenhouse connection diagram

Sensor and device connection details

Phidgets connection diagram

Connecting SBC3 to interface modules and sensors

Phidget connection diagram

COnnecting Phidgets with interfaces, sensors and devices

Code

Attaching to Phidget interfaces

C#
Source code for attaching multiple Phidgets to unified device parameter table
private InterfaceKit[] ifKit = new InterfaceKit[24];
BindingList<DevList> phidgetDevices = new BindingList<DevList>();

void ifKit_Attach(object sender, AttachEventArgs e)
{

statusMsg("Phidget " + e.Device.SerialNumber.ToString() + " (" + e.Device.ID .ToString() + ") attached");

 if (e.Device.Type.ToString() == "PhidgetInterfaceKit")
 {
  int ifKitIdx = -1;
  int serialNum = 0;
  string deviceiD;
  string name;
  InterfaceKit ifKit = (InterfaceKit)sender;
  serialNum = e.Device.SerialNumber;
  ifKitIdx = findIfKitIdx(serialNum);
  name = e.Device.Name;
    if (ifKitIdx > -1)
    {
      phidgetDevices[ifKitIdx].Attached = true;
      phidgetDevices[ifKitIdx].Name = name;
      phidgetDevices[ifKitIdx].Id = e.Device.ID.ToString();
      wordLen[ifKitIdx] = ifKit.sensors.Count + ifKit.inputs.Count + ifKit .outputs.Count;
      dataGridView1[6, ifKitIdx].Style.BackColor = Color.LightGreen;
     }
     else
     {statusMsg("Index missmatch for " + serialNum.ToString()); }

 }
}

Data Events

C#
Source code for reading different types of sensor data back to unified data table.
 void ifKit_SensorChange(object sender, SensorChangeEventArgs e)
 {
  int channel = 0;
  int kitIdx;
  int serialnumber;
  int portIdx;
  int value;
  portIdx = e.Index;
  value = e.Value;
  InterfaceKit ifKit = (InterfaceKit)sender;
  serialnumber = ifKit.SerialNumber;
  kitIdx = findIfKitIdx(serialnumber);
  kitRawData[kitIdx, channel, portIdx] = value.ToString();

}


void ifTemp_TemperatureChange(object sender, TemperatureChangeEventArgs e)
{
  int channel = 0;
  int kitIdx;
  int serialnumber;
  int portIdx;
  double value;
  portIdx = e.Index;
  value = e.Temperature;
  TemperatureSensor ifTmp = (TemperatureSensor)sender;
  serialnumber = ifTmp.SerialNumber;
  kitIdx = findIfKitIdx(serialnumber);
  kitRawData[kitIdx, channel, portIdx] = value.ToString();

}

Analog Sensor voltage conversion

C#
Convert raw analog sensor voltage (0-5vdc) to data table sensor value based on type
if (phidgetData[devCount].Type == "Hum")
{
  double humX = Convert.ToDouble(kitRawData[i, c, ii]);
  double hum = humX * 0.1906 - 40.2;
  phidgetData[devCount].Convert = SignificantTruncate(hum,6).ToString();
}

if (phidgetData[devCount].Type == "Temp")
{
 double tmpX = Convert.ToDouble(kitRawData[i, c, ii]);
 double tmp = tmpX * 0.22222 - 61.11;
 phidgetData[devCount].Convert = tmp.ToString();

}

Credits

Mike Hogan

Mike Hogan

9 projects • 50 followers
Interested in hardened massive io frameworks

Comments