From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

General question controlling with a DHT22

Hi community!

 

Like many others here im quite new to Labview as well as Arduino. First I will write something about my project:

 

I have an Arduino Uno + Labview11 + a DHT22 temperature (T) and humidity (RH) sensor which is used to measure the temperatur of an airstream. In the end I would like to controll a heater and switch which will ensure a constant temperature and humidity in the air.

Right now I finished a working VI and Sketch to make the measurements of T and RH. First I tried it with LINX but there seem to be some problems getting a DHT22 running so it is now running via sketch+lib.

 

My question is very basic and please correct me if Im somewhere wrong in my explanation:

 

I want to set a limit value for RH in LV. When the real RH is higher, I need an output signal to set a switch. When the wanted RH is reached, the signal is switched of.

If I unterstand right, I have to set a digital output in labview and connect it with on of the output on my Arudino. Can I use the stuff from this small tutorial for it? https://www.arduino.cc/en/Reference/DigitalWrite

I would include the input into my Sketch which you can see below and set the outputs in LV and try to connect them?

 

 

#include <DHT.h>

#define DHTPIN 2 //PIN DONDE CONECTAR LA SEÑAL DEL SENSOR

#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);
 
void setup() {
  Serial.begin(9600);
  dht.begin();

}

void loop() {
  
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  float tf = dht.readTemperature(true);

  Serial.print("H");
  Serial.print(h);
  Serial.print("\t");
  Serial.print("T");
  Serial.print(t);
  Serial.print("\t");
  Serial.print("F");
  Serial.println(tf);
  delay(2000);

}

VI.JPG

0 Kudos
Message 1 of 1
(3,019 Views)