DAQ in C#

Hans-Petter Halvorsen

Introduction

What is Data Acquisition? Data Acquisition (DAQ) is the process of collection data from different sensors into a computer.

A DAQ System consists of 4 parts: Physical input/output signals, sensors DAQ device/hardware Driver software Your software application (Application software).

Tutorials:

Introduction to Data Acqquisition in Visual Studio and C# (PDF)

 

 

 


 

DAQ Devices

Here are some examples of DAQ devices:

To use these DAQ devices from National Instruments, you need to install the NI-DAQmx driver.

Here you find more information about NI-DAQmx.

Both these devices (TC-01 and USB-6008) are programmed in the same manner in C#. See Examples below.

 

Note! The NI-DAQmx driver do not support .NET Core, only the standard .NET Framework.

Note! Make sure to at least select "NI-DAQmx Support for .NET Framework 4.x" and "NI-DAQmx Support for Visual Studio 2019" during the installation of DAQmx.

 

TC-01

TC-01 Thermocouple is a DAQ device from National Instruments used to read and log temperature data. Read more...

Data Acquisition (DAQ) is the process of collection data from different sensors into a computer. A DAQ System consists of 4 parts: Physical input/output signals, sensors DAQ device/hardware Driver software Your software application (Application software).

In order to use the TC-01 Thermocouple, make sure you have installed the DAQmx driver first.

Firmware: If you get error using TC-01, you may need to upgrade the Firmware

 

Video: DAQ in Visual Studio using TC-01 and DAQmx:

PowerPoint used in the Video

This video is also available from my official YouTube Channel: https://www.youtube.com/IndustrialITandAutomation

 

Download Examples

 

USB-6008

USB-6008, or similiar, are DAQ devices from National Instruments.

You can use them preferably together with LabVIEW, but you can also use them together with Visual Studio/C#, MATLAB, Python, etc. USB-6008, USB-6001 (USB-600x), myDAQ, etc. all use the same driver, which is the NI-DAQmx.

More Information about USB-6008

 

Video: Data Acquisition in Visual Studio and C# using USB-6008 as an example:

PowerPoint used in the Video

This video is also available from my official YouTube Channel: https://www.youtube.com/IndustrialITandAutomation

 

 

 


 

Sensors and Actuators

Below you find information and resources about the different sensors and components you are going to use.

The sensors and components are:

 

TMP36

A Temperature sensor like TM36 uses a solid-state technique to determine the temperature. They use the fact as temperature increases, the voltage across a diode increases at a known rate.

TMP36 Overview

 

Video: Using TMP36 in Visual Studio and C# with USB-6008:

This video is also available from my official YouTube Channel: https://www.youtube.com/IndustrialITandAutomation

 

Download Examples

 

 

Thermistor

A thermistor is an electronic component that changes resistance to temperature - so-called Resistance Temperature Detectors (RTD). It is often used as a temperature sensor.

Thermistor Overview

 

Video: Using Thermistor in Visual Studio and C# with USB-6008:

This vdeo is also available from my official YouTube Channel: https://www.youtube.com/IndustrialITandAutomation

 

Download Examples

 

Light Sensor

Light sensor, Photocell (Photo resistor), LDR (light-dependent resistor). A light sensor / photocell is a sensor used to detect light. The resistance decreases with increasing light intensity (stronger light).

Light Sensor Overview

 

Video: Using Light Sensor in Visual Studio and C# with USB-6008:

This video is also available from my official YouTube Channel: https://www.youtube.com/IndustrialITandAutomation

 

Download Examples

 

LED

Light-emitting diodes or LEDs are used in all kind of electronics today.

LED Overview

 

Video: Using LEDs in Visual Studio and C# with USB-6008:

This video is also available from my official YouTube Channel: https://www.youtube.com/IndustrialITandAutomation

 

Download Examples

 

 

 


 

Hardware

The following components are used in the examples and videos above:

Hardware Information Supplier
TC-01 Thermocouple Temperature Sensor National Instruments
USB-6008 DAQ Device from National Instruments. USB cable included National Instruments
Breadboard   Elfa
Wires 10 wires in different colors Elfa
LED Green   Elfa
LED Red   Elfa
TMP36 Temperature Sensor Elfa
Thermistor Temperature Sensor Elfa
Light Sensor Measures the light level inside a room (or outside) Elfa
Resistor 330 Ohm x 2 Resistor for the LEDs Efa
Resistor 10 kOhm Resistor for the Thermistor Elfa
Resistor 33 kOhm Resistor for the Light Sensor Elfa

 

Questions and Answers (Q&A)

In this Forum everybody can ask Questions, answer Questions, give Tips and Tricks, etc. regarding C#. Please use Full Name and Picture.