Trending Technology Machine Learning, Artificial Intelligent, Block Chain, IoT, DevOps, Data Science

Recent Post

Codecademy Code Foundations

Search This Blog

INTEGRATION OF SENSOR AND ACTUATORS WITH ARDUINO in IoT

Sensors
  • Basic electronic Device
  • Convert a physical quantity/ measurements into electrical signals
  • Can be analog or digital
Types of Sensors

Some commonly used sensors :
  • Temperature
  • Humidity
  • Compass
  • Light
  • Sound
  • Accelerometer
Sensor Interface with Arduino

Digital Humidity and Temperature Sensor (DHT)


PIN 1,2,3,4 (from left to right)
  • PIN 1-3.3V-5V Power supply
  • PIN 2- Data
  • PIN 3-Null
  • PIN 4- Ground

DHT Sensor Library
  • Arduino supports a special library for the DHT11 and DHT22 sensors
  • Provides function to read the temperature and humidity values from the data pin
           dht.readHumidity()
           dht.readTemperature()



Connection
  • Connect pin 1 of the DHT to the 3.3 V supply pin in the board
  • Data pin (pin 2) can be connected to any digital pin, here 12
  • Connect pin 4 to the ground (GND) pin of the board


Sketch: DHT_Sensor

Install the DHT Sensor Library
  • Go to sketch -> Include Library -> Manage Library



  • Search for DHT Sensor
  • Select the "DHT sensor library" and install it





  • Connect the board to the PC
  • Set the port and board type
  • Verify and upload the code


OutPut

The readings are printed at a delay of 2 seconds as specified by the delay() function






No comments:

Post a Comment

Popular Articles