DHT (Digital Humidity & Temperature)

DHT (Digital Humidity & Temp) supports the interface of a digital humidity and temperature sensor.

Add Input Device

Item

Description

DHT

Returns a list consisting of the current temperature, humidity, type of sensor, and last cached read status.


TI-Nspire CX II: from ti_hub import *

 

The function to create the object is pasted from the menu.

var = dht("port")

Command:

var = dht("port")

Command Syntax:

var = dht("port")

Range:

Describe:

The available functions for the objects are displayed by adding a period “.” after the variable name for the sensor object.

Result:

Type or
Addressable Component:

Control

 

var.temp_measurement()

Command:

var.temp_measurement()

Command
Syntax:

var.temp_measurement()

Python
Code
Sample:

TI Nspire CX II:

from ti_hub import *

d1 = dht("IN 1")

t = d1.temp_measurement()

print("Temp is: ", t)

 

CE products:

from dht import *

d1 = dht("IN 1", "DHT11")

t = d1.temp_measurement()

print("Temp is: ", t)

Range:

Describe:

Function to return the temperature value in degrees Celsius.

Result:

NA

Type or
Addressable
Component:

Control

 

var.humidity_measurement()

Command:

var.humidity_measurement()

Command
Syntax:

var.humidity_measurement()

Range:

 

Describe:

Function to return the relative humidity value.

Result:

Type or
Addressable
Component:

Control

 

var.t_h_measurements()

Command:

var.t_h_measurements()

Command
Syntax:

var.t_h_measurements()

Range:

 

Describe:

Function to return the temperature value in degrees Celsius and the relative humidity value. Returns two floating point values.

Result:

Type or
Addressable
Component:

Control

 


CE products: from dht import *

 

 

 

var=dht("port","opt")

Command:

var=dht("port","opt")

Command
Syntax:

var=dht("port","opt")

Range:

Describe:

This function creates an object named by the variable “var” for the DHT sensor.

“port” – the port to which the DHT sensor is attached

“opt” – option that allows the use of two different types of DHT sensors – DHT11 (default) and DHT22

Result:

Type or
Addressable
Component:

Control

 

var.temp_measurement()

Command:

var.temp_measurement()

Command Syntax:

var.temp_measurement()

Python
Code
Sample:

TI Nspire CX II:

from ti_hub import *

d1 = dht("IN 1")

t = d1.temp_measurement()

print("Temp is: ", t)

 

CE products:

from dht import *

d1 = dht("IN 1", "DHT11")

t = d1.temp_measurement()

print("Temp is: ", t)

Range:

Describe:

Function to return the temperature value in degrees Celsius.

Result:

NA

Type or
Addressable
Component:

Control

 

var.humidity_measurement()

Command:

var.humidity_measurement()

Command
Syntax:

var.humidity_measurement()

Range:

 

Describe:

Function to return the relative humidity value.

Result:

Type or
Addressable
Component:

Control

 

var.t_h_measurements()

Command:

var.t_h_measurements()

Command
Syntax:

var.t_h_measurements()

Range:

 

Describe:

Function to return the temperature value in degrees Celsius and the relative humidity value. Returns two floating point values.

Result:

Type or
Addressable
Component:

Control