Bathroom Extractor Fan – DHT11 + REED SWITCH

Chosen idea: BATHROOM EXTRACTOR FAN

Parts –

  • Computer fan
  • Magnetic key card lock for a door
  • REED Switch
  • DHT11 Humidity Sensor
  • 1x Green LED
  • 1x Red LED

The Aim:

A fully functional bathroom extractor fan system with adjustable humidity thresholds (user can adjust for comfort) which could be integrated into facilities which require a key card such as: Gyms, work shower rooms, swimming pools etc.

 

Hypothesis:

we will set out to create a circuit which detects the moisture content in the air – Switches on extractor fan when humidity breaches a certain threshold, with added LED’s integrated into the circuit to indicate where humidity readings are between thresholds.

 

  • A magnet was places near to the REED Switch.
  • The REED switch sensed this and completed the circuit… thus activating the circuit.
  • When the Humidity level reached the Pre-set threshold of 60% the RED LED switched on and stayed on until the humidity level was reading below 60%.
  • When the magnet was moved away from the REED Switch, the circuit cut off.

 

Fritzing Diagram of Circuit:

fritz-2-combo.png

Red = VCC

Green = DATA

Black = GROUND

Pin 12 = DHT11 Humidity Sensor

Pin 2 = REED Switch (Magnet activated)

Pin 13 = RED LED

Pin 7 = GREEN LED

 

20180226_18084120180226_18085820180226_180917

The Code:

4

Break down of code:

img034.jpg

 

Short Video Clip of functioning circuit:

 

 

Advertisements

Electrical component – REED SWITCH

 

 

reed switch module

 

WEEK 1

A reed switch comprises of two ferrous metal strips that are encased in a glass tube filled with inert gasses. Naturally the two strips overlap but are set with a gap between them. This means that the circuit is incomplete. To complete the circuit, a magnet is applied to the switch, this causes the gap to close thus completing the circuit. When the magnet is removed, the strips are no longer attracted meaning they separate and then break the circuit.

fig 1a
Simple layout with reed switch and LED

In the circuit shown above, when a magnet is applied in the proximity of the reed switch, the circuit is complete thus lighting up the LED. when the magnet is removed the circuit breaks, turning off the LED.

code 1
REED SWITCH code

Uses for a DHT11 Humidity sensor + Collaborative project – DHT11 + REED SWITCH

Weather Station project

img_20180226_0005.jpg

Use: Determining the likeliness of rain fall.

4654765

Relationship between Humidity and Rainfall:

Humidity is the amount of water vapour present in the air.

When the air becomes saturated with water vapour and can no longer absorb anymore vapour, the water condenses into clouds.

 

Temperature Limits Humidity

The temperature of a parcel of air puts a limit on how much water vapour (humidity) the parcel of air can hold. The warmer the air, the more water vapour it can hold. By the same token, cold air can hold significantly less water vapour than warm air.

Humidity Responds To Temperature

Humidity is water vapour contained in air. At higher temperatures, air can hold more water vapour than the same amount of air at lower temperatures. For example, if a sealed parcel of air experiences a rise in temperature with no addition of water vapour, the relative humidity of the parcel of air decreases because the warmer air is capable of holding more water.

Relative Humidity Is Based On Temperature

The relationship between temperature and humidity is often expressed by a percentage called relative humidity. Relative humidity is the ratio of water vapour present in air at a given temperature relative to the maximum amount of water vapour the air at that temperature could hold.

 

Temperature is a variable which effects Humidity

Cold = Less water vapour absorbed

Hot = More water vapour absorbed

 

 

Environmental Monitoring projects

img_20180226_00051.jpg

76567

Use: Making sure environmental conditions are maintained when Farming/Growing produce which requires specific conditions to grow.

 

89678

Various sensors can be set up in a controlled farming environment to monitor variables which effect plant growth. The data collected by these sensors can be compared with optimal readings and thus can be used to determine whether any of the variables require optimisation.

 

Variables involved in plant growth:

 

Light – Lighting

Temperature – heating/electric heater/ventilation system

Water/moisture content in soil – water pump

Humidity – ventilation system

 

78567

 

Light – Light Sensitive Diode can be used to monitor the light levels in the plant environment and a group of LEDs located around the plant, can be switched on when the light levels go below a certain point.

Readings fall below optimal levels – Flick switch to increase light or switch on additional lighting.

Readings go over optimal levels – Flick which to decrease or turn off additional lighting.

 

Temperature –Humidity sensor can be used to monitor the temperature levels in the plant environment.

Readings fall below optimal levels – Flick switch to activate heater and increase temperature or switch on additional heating.

Readings go over optimal levels – Flick switch to decrease or turn off additional heating.

 

Moisture –Moisture sensor can be used to monitor the amount of moisture in the soil.

Readings fall below optimal levels – Flick switch to activate water pump which feeds into the soil.

Readings go over optimal levels – Flick switch to decrease or turn off additional watering system.

 

Humidity –Humidity sensor can be used to monitor the amount of water vapour in the plants environment.

Readings fall below optimal levels – Flick switch to activate heater and increase temperature or switch on additional heating + Flick switch to activate water pump which feeds into the soil.

Readings go over optimal levels – Flick switch to decrease or turn off additional heating. + Flick switch to decrease or turn off additional watering system.

7866567

 

finished-terrarium

Bathroom Extractor Fan

IMG_20180226_0006

Detects moisture content in the air – Switches on extractor fan when humidity breaches a certain threshold. Potential for adding LEDs into circuit to indicate where humidity readings are between thresholds.

4657465675

https://create.arduino.cc/projecthub/projects/tags/plantshttps://sciencing.com/temperature-ampamp-humidity-related-7245642.html

https://create.arduino.cc/projecthub/ThothLoki/portable-arduino-temp-humidity-sensor-with-lcd-a750f4?ref=tag&ref_id=temperature&offset=2

https://www.carnivorousplants.co.uk/resources/raspberry-pi-terrarium-controller/

 

This weeks Testing!….

20180219_181713 (2)

Chosen Collaborative Project idea:

Bathroom Extractor Fan

Detects moisture content in the air – Switches on extractor fan when humidity breaches a certain threshold.

 

Reed Switch Module – Mechanical Switch

Humidity Sensor DHT11 – Moisture Sensor

 

Flow Chart for Circuit

Untitled Diagram

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Building the Circuit:

DHT11 Humidity Sensor + REED Switch

fritz 1 combo

Red = VCC

Green = DATA

Black = GROUND

Pin 12 = DHT11 Humidity Sensor

Pin 2 = REED Switch (Magnet activated)

 

20180226_18030020180226_18030320180226_18031320180226_18034120180226_180403

The Code:

5

 

Breakdown of code:

img033

Short video clip:

Tune in next week for more developments..

 

Sensory Component = Humidity Sensor DHT11 Week 2

Testing

This week is all about testing, both the sensor and the code variables.

20180217_173127.jpg

I plugged the Arduino into the computer, checked the code and uploaded the code to the Arduino. I then checked the data feedback that the sensor was sending back to the Arduino program and to my surprise no data was being collected.

I then smelt burning plastic and realised that the plastic casing on my sensor was beginning to melt! I quickly cut off the power to the circuit board and Arduino UNO and began to work out what I had done wrong.

I then quickly realised that I had made a simple mistake… I HAD FED THE 5V LEAD INTO THE SENSORS DATA PIN. This was fairly expected as I was using jumper wires of the same or similar colour so… it was expected. I CANNOT STRESS ENOUGH THAT YOU USE DIFFERENT AND CLEARLY DISTINGUISHABLE WIRES WHEN YOU TEST.

Here’s how I wired my circuit:

15

16

The Carnage…

17-e1519657658927.jpg

20180217_164406-1-e1519657743532.jpg

18

I followed this fritzing diagram found online, however I later found that the author of this fritzing diagram had made a mistake and jumped the 5V to the Data pin on the sensor.

19

20180217_173119.jpg

After the sensor had cooled down I wired up the jump wires correctly and uploaded the code to the Arduino. IT WORKS! I checked the Communications port to view the data being collected by the humidity sensor and it was printing data for both temperature and humidity. In order to truly test the humidity sensor I got a towel and lightly dampened it; I then placed this over the humidity sensors porous cover and watched the data readings come in.

As my researched suggested and as I predicted the temperature dropped because the water was evaporating and the relative humidity climbed at a gradual rate (1 or 2 percent) every few seconds. This showed me that my code worked and that the sensor functioned as it should.

DATA Reading’s:

Before Damp towel was applied to humidity sensor…

20.jpg

After damp towel was applied to humidity sensor…

21.jpg

Short Video Clip

Tune in next week for uses for:

Uses for a DHT11 Humidity sensor

 

Sensory Component = Humidity Sensor DHT11

Hi! I’m Patrick and this group of blogs will be an informative insight into how to use a DHT11 Humidity sensor with an Arduino UNO; hopefully we can make some cool at and funky at the end!

This week I will cover the basic principles of a humidity sensor and its functions

Sensory Component = Humidity Sensor DHT11

dht

How do humidity sensors work?

The DHT11 detects water vapor by measuring the electrical resistance between two electrodes. The humidity sensing component is a moisture holding substrate with electrodes applied to the surface. When water vapor is absorbed by the substrate, ions are released by the substrate which increases the conductivity between the electrodes. The change in resistance between the two electrodes is proportional to the relative humidity. Higher relative humidity decreases the resistance between the electrodes, while lower relative humidity increases the resistance between the electrodes.

The DHT11 measures temperature with a surface mounted NTC temperature sensor (thermistor) built into the unit.

Humidity sensors detect the water vapour in air by measuring the electrical resistance between 2 electrodes.

Water vapour is absorbed by a substrate material in-between the 2 electrodes.

The DHT11 uses just one signal wire to transmit data to the Arduino. Power comes from separate 5V and ground wires. A 10K Ohm pull-up resistor is needed between the signal line and 5V line to make sure the signal level stays high by default.

There are two different versions of the DHT11 you might come across. One type has four pins, and the other type has three pins and is mounted to a small PCB. The PCB mounted version is nice because it includes a surface mounted 10K Ohm pull up resistor for the signal line.

Here are the pin outs for both versions:

 

1

 

 

Here are the ranges and accuracy of the DHT11:

Humidity Range: 20-90% RH

Humidity Accuracy: ±5% RH

Temperature Range: 0-50 °C

Temperature Accuracy: ±2% °C

Operating Voltage: 3V to 5.5V

Formula for Humidity6RH = Relative Humidity

PW = Density of water vapor

PS = Density of water vapor at saturation

Density is displayed as a percentage (%) out of 100

 

Relationships

The more vapor absorbed = the more ions are released by the substrate

High Humidity = Decreasing Resistance

Low Humidity = Increasing Resistance

Temperature is a variable which effects Humidity

Cold = Less water vapour absorbed

Hot = More water vapor absorbed

 

7

 

DHT11 Humidity Sensor Pins and Surface mount parts

8

9

 

 

Enough Theory! Let’s give it a go!

 

10.png

Green Lead = DATA > PIN 7

Yellow lead = GND > GND

White lead = VCC > 5V

11.jpg

12.jpg

The Code

13

Code Breakdown

 

img_20180226_0001.jpg

IMG_20180226_0002

IMG_20180226_0003

IMG_20180226_0004

Tune in next week for part 2 😉

 

http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-an-arduino/