Project 2: Arduino, DHT11, DC motor and LCD display
Description:
- Read humidity and temperature data from DHT11 sensor
- Display humidity and temperature data on LCD module
- Turn on the fan (DC motor) when the temperature reaches 25C
- Increase the fan speed as the temperature increases up to 40C.
Components Used:
- Arduino UNO R3 - micro-controller
- DHT11 sensor - gathers humidity and temperature data
- 3V-6V motor - spins the fan
- LCD 1602 module - displays the sensor data
- 9V battery - power source for the DC motor
- PN2222 transistor - to turn on and off DC motor
- 1kOhm resistor - prevent large current from flowing into the transistor base
- 5kOhm resistor - pullup resistor for DHT11
- 10uF capacitor - smooths out the noise from the DC motor
- 1N4007 diode - prevent inductive spike from the DC motor
- 10kOhm potentiometer - control the contrast of the LCD module
- Jumper cables
Fan on above 25C (high RH from breathing on the sensor)
Notes:
- 5kOhm pull up resistor on DHT11 Vcc pin and data pin
- RW pin on LCD module to write only by connecting to ground
- Connect the grounds of the 9V battery and Arduino, but do not connect the power source.
- Electrical noise from the motor could corrupt data writing to LCD module. Solution: wrap wires around the motor to shorten the wires. This reduces noise. Adding a capacitor also helps too.
- Inductive spike from the DC motor could kill transistor without a path to direct inductive energy.
- Schottky diode for higher frequency
Code:
https://gitlab.com/hopop55/Project2_Arduino_DHT11_DCmotor_LCDdisplay/blob/master/humidity_lcd2.ino
Resources:
DHT11 datasheet
http://www.micro4you.com/files/sensor/DHT11.pdfLCD module pinout
https://circuitdigest.com/article/16x2-lcd-display-module-pinout-datasheet/Motors and transistors tutorial
Inductive spike from the DC motor
How to deal with electrical noise from the DC motor
https://www.pololu.com/docs/0J15/9
Go here https://steemit.com/@a-a-a to get your post resteemed to over 72,000 followers.