Test DHT22 Sensors with Arduino and MATLAB

This project shows how to use MATLAB and Arduino to acquire and fix data from a bundle of DHT22 sensors, live plot, and export the results.

Sep 5, 2018

15271 views

10 respects

Components and supplies

1

Capacitor 10 µF

1

Jumper wires (generic)

1

Pushbutton switch 12mm

1

Resistor 1k ohm

5

Resistor 10k ohm

1

Breadboard (generic)

1

Arduino UNO

5

DHT22 Temperature Sensor

Apps and platforms

1

Arduino IDE

1

MATLAB

Project description

Code

humCorr.m

matlab

MATLAB function used to correct the humidity readings from the value of one sensor. Not called if lines 66-68 of the main script DHT22_5sensor.m are commented. Ignore or edit this function according to your needs.

DHT22_5sensor.ino

arduino

Arduino sketch to read sensors data and pass them to the computer by the serial port.

humCorr.m

matlab

MATLAB function used to correct the humidity readings from the value of one sensor. Not called if lines 66-68 of the main script DHT22_5sensor.m are commented. Ignore or edit this function according to your needs.

DHT22_5sensor.ino

arduino

Arduino sketch to read sensors data and pass them to the computer by the serial port.

DHT22_5sensor.m

matlab

MATLAB code to read serial data from the Arduino. Please check your port number on line 18. First acquisition should be without correction. For the first time leave lines 66 to 68 commented. I have used an external tool to verify temperature and humidity readings and it appeared that sensor number 5 read both correctly in several condition. I have written the humCorr.m function to fix the other sensors readings from the value of sensor number 5. If interested in correction, manipulate humCorr.m function and/or lines 66-68 according to your needs.

Downloadable files

Connections

Breadboard view

Connections

Connections

Breadboard view

Connections

Comments

Only logged in users can leave comments

dancili

0 Followers

0 Projects

10

0