temperature and humidity supervision System
first i will begin with the arduino part :
to begin with lets connect the sensor to the arduino like in the picture below
- pin 1 to VCC (red wire)
- pin 2 Data pin with pin 2 inthe arduino (yellow wire )
- pin 3 not used
- pin 4 to GND (black wire )
now the arduino code :
#include <dht.h> // import library
dht DHT;
#define DHT22_PIN 2 // data pin of the DHT22 sensor connected to pin 2
void setup()
{
Serial.begin(9600); // prepare serial communication
}
void loop()
{
int chk = DHT.read22(DHT22_PIN); // read value from the sensor
float hu =DHT.humidity; // get humidity
float te =DHT.temperature; // get temperture
if(Serial.available() > 0) { // if there is data in serial port
if(Serial.read() =='t') { // if the data == 't'
Serial.println(te); // print temperture
}
else if(Serial.read() == 'm') { // if data == 'm'
Serial.println(hu); // print humidity
}
}
}
now to the labview part
i m going to devide it to two sections :
- serial communication
and the same for the humidity after sending the letter 'm' to the arduino it will send back the value of the humidity . and the role of the while loop is just to let enough time to receive the value from the arduino

the basics of serial communication :
the first step is to open the serial port using VISA SERIAL
to write data to the serial port we use this bloc
to read data from serial we use this bloc
so we use the concatinate bloc ,this bloc is used to concatinate strings
the basics of saving data in text file are :

the basics of serial communication :
the first step is to open the serial port using VISA SERIAL
to write data to the serial port we use this bloc

- plotting and saving Data
so we use the concatinate bloc ,this bloc is used to concatinate strings
![]() |
concatinat block |
Well we extremely get a kick out of the chance to visit this site, numerous valuable data we can arrive. environmental chamber price
RépondreSupprimer