Arduino& Labview With 2 DS18B20





Introduction: Arduino& Labview With 2 DS18B20

Hi! This instructable is for those who want to make an interface with PC and arduino. I chose the popular DS18B20, because there is no clear information about how to do it, more questions than solutions and some VI´s without explanation. I will assume that you are familiar with labview enviroment at basic level.If not, there is a lot of info about this software and how to begin (even a free trial, i think).

Labview also has a tool for arduino :LINX, but do not has support for this sensors.

We will use 2 DS18B20 ,that will give you an idea of how to connect more sensors or send data from your Arduino. This is not the "ultimate" code,so you can modify according to your needs.

You need to watch the video to know how to make the Labview interface. Also, I included the VI ready and the Arduino code.



LabVIEW with VISA (2013)

Arduino IDE (1.6.9)


Arduino UNO

2 DS18B20

4.7 K resistor

Breadboard, wires

Step 2: Arduino Side

This is the easiest part. We will read the temperature and send a "string" with a header that will be "filtered" on the labview side.

I am using the inox version of DS18B20 and normal power mode with 4.7 K resistor. Data connected to pin 2.

Red =+5V

Black =Gnd

Blue= Data

-Make sure you have the libraries needed (below).



-Arduino pin for data (2)

#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.

DallasTemperature sensors(&oneWire);

-Setting serial communication at 9600 (baud rate)

void setup(void) {


// Start up the library



void loop(void) {

-Reading temperatures

sensors.requestTemperatures(); // Send the command to get temperatures

Getting and converting the values to DEC.

If you want °F : sensors.getTempFByIndex()

String sensor1 = String(sensors.getTempCByIndex(0),DEC);

String sensor2 = String(sensors.getTempCByIndex(1),DEC);

We make strings with the headers"A" and "B"

String temp1 = String("A" + sensor1);

String temp2 = String("B" + sensor2);

Print over serial port




Upload the code to Arduino board. Once you have the code running, grab one sensor to raise the temp and identify sensor "A" and "B".

Step 3: Labview Side

For this step you need to watch the video. I tried to make a step by step guide to be clear and show the operation by stages. Anyway, i will upload the VI ready.

The COM port it is the same that on your Arduino IDE.

As you can see, We send two data strings concatenated with an"A" and "B". When enter to the while loop ,there is a delay to control the sample readings. After the read function. the strings goes to the Match pattern, to "filter" each data string. Then, converted to numbers (double) and connected to the thermometers.

You can add more functions like graphics, waves ,etc.

3 People Made This Project!


  • Planter Challenge

    Planter Challenge
  • Clocks Contest

    Clocks Contest
  • Woodworking Contest

    Woodworking Contest

We have a be nice policy.
Please be positive and constructive.




Hi, I've connected 8 sensors with this method

Thanks for the reply Nicolas. I managed to connect 3 Max6675 breakouts and thermocouples and created a sketch and it worked. The problem came trying to create a VI it wouldn't work. I asked in all the forums with no answers. I will try your method when parts arrive.

Thanks again

OK, you can test the VI just sending strings, send 3 strings concatenated with an A, B and C, and add another structure to capture and show the C, actually ,you don't need a sensor to test it. Watch the video to learn how. Regards

I did try strings but didn't work think it's because max6675 are not onewire compatible. This my sketch

ardu#include "max6675.h"

int ktcSO = 8;

int ktcCS = 9;

int ktcCS2 = 11;

int ktcCS3 = 12;

int ktcCLK = 10;

MAX6675 ktc(ktcCLK, ktcCS, ktcSO);

MAX6675 ktc2(ktcCLK, ktcCS2, ktcSO);

MAX6675 ktc3(ktcCLK, ktcCS3, ktcSO);

void setup() {


// give the MAX a little time to settle



void loop() {

// basic readout test

Serial.print("First = ");


Serial.print("Second = ");


Serial.print("Third = ");




You dont get it my friend, you can send any value, its not just for onewire devices.

Your value is ktc.readCelsius() (1,2,3)


String sensor1 = String (ktc.readCelsius(),DEC);


String temp1 =String("A"+sensor1);

Print over serial port:


the same for the other sensors...

Just write a number instead "ktc.readCelsius()"to test it, like this:

String sensor1=String( 15.56,DEC);

Thats the way i tested this VI when was created, even before connect any sensor.

Thanks Nicolas for your help I got it work, brilliant!

Hi . I tried with this code but unfortunately it doesn't work with me . It still 0 in the labview i don't know what the problem

3 replies

Thanks so much Nicolas it worked, been trying to achieve this for weeks! You are star!

This is not my project, maybe you are on the wrong tutorial

Thanks for the comment!

hi, your arduino side file gives me this error:

" call of overloaded 'string(float&)' is ambiguous "

I'm going crazy, why?
sorry my english

Nicolas, thank you very much! Great project, all works perfectly!

1 reply

Thanks!, I'm glad to help you!

Great project! Thanks for sharing!