Transform Basic Bathroom Fan to Advanced

by neo_xnitro in Circuits > Electronics

56748 Views, 339 Favorites, 0 Comments

Transform Basic Bathroom Fan to Advanced

DSC_0217.JPG
DSC_0152.JPG

This is my first instructable !!

After i moving with my girlfriend into our new rent house, our new bathroom is equipped of a fan evacuator with a PIR sensor to evacuate humidity, every time we switched ON the light of the bathroom, the FAN switch ON and made a lot of noise !!

I like every time my girlfirend goes to bathroom at night ...

Requirements:

FAN would be power ON if the humidity is higher than 75%

OR

The door is closed (go for a dump)

What Inside This Silent Fan ?

DSC_0074.JPG

+ No transformator => Problem: i cannot extract safe 5V out of the box.

+ No Relay.

Add Switch With Snubber Filter

DSC_0082.JPG

I choosen to drive the FAN with dual relay with optocoupler input protection, the easy way to drive any thing from a µC

I'm very lucky that this dual relay go inside (i cut a litle bit the eges to fit it perfectly)

snubber filter :

Every time the relayes are cut off, one phenomenon is produced:

> µc reset alone.

The snubber filter (Capacitor in serial with Resistor) is wired in parallel with the FAN.

From Wiki:

Snubbers are frequently used in electrical systems with an inductive load where the sudden interruption of current flow leads to a sharp rise in voltage across the current switching device, in accordance with Faraday's law. This transient can be a source ofelectromagnetic interference (EMI) in other circuits.

Add 5V Power Supply

DSC_0080.JPG

I recovered an old LG Cell Phone charger to use as a power supply (230V => 5V 0.5A)

Remaining Space

DSC_0083.JPG
DSC_0086.JPG
DSC_0087.JPG
DSC_0085.JPG

Take measures of remaining space where the PCB will be placed.

Cut Useless Brace

DSC_0138.JPG

I cutted useless brace to win a little bit more spaces.

Schematic Μc/Sensor

sch_1.png

I chose the Atmega 328p because I had several at home ^^

AM2302: The hygrometer/temperature sensor (1-wire bus)

LED Driver

sch_led.png

NPN Transistors working in saturation mode drived by µc.

Door Detection

sch_door.png
DSC_0061.JPG

Infrared Proximity Sensor was built with an TCRT5000 and a LM324, the LM324 is aop used as a voltage comparator.

When the infrared light (from the IR LED) reflect a surface (bathroom door), the phototransistor leave the current to flow, The input 5 of LM324 is at +IRV and compare the voltage with the input 6 (bridge voltage divider), if the value is higher, the output 7 give 3.5V (5V - 1.5V).

N.B. IRV depend the amount of infrared light coming back to to IR receiver

Lets Go to Disign the PCB

pcb.png
DSC_0131.JPG
DSC_0137.JPG
DSC_0143.JPG

I designed the PCB with Fritzing and took into account the space available in the box.

Test and Reshape the PCB

DSC_0140.JPG
DSC_0142.JPG

I reshape the PCB to avoid useful brace.

Let's Go to Solder Components

DSC_0145.JPG
DSC_0147.JPG

When i soldered the components, I realized that I forgoten to place the Quartz ! ... I improvised by soldered it above the µc.

I test with 5V power supply, I held my breath before I switched it ON ... poiouff, this time, all work fine for first time.

RED light: No communication with hygrometer sensor.

GREEN light: humidity < 75%

BLUE light >= 75%

N.B. All light color are bliking to say me, "i'am alive"

Downloads

Test FAN Drived by Μc + Close the Case

DSC_0162.JPG
DSC_0151.JPG
DSC_0156.JPG
DSC_0167.JPG
DSC_0168.JPG
DSC_0166.JPG

Everything seems fit perfectly

Mount the Proximity Sensor Near the Door

DSC_0209.JPG
DSC_0212.JPG
DSC_0220.JPG

I made a hole on the ceiling for passing the wires.

Final Test

DSC_0217.JPG
DSC_0218.JPG
DSC_0231.JPG

After calibrated the poximity sensor (set the potentiometer to detect the door presence)

While i took my shower, i noticed that the sensor takes a long time before it detect moisture > 75% ... may be i must move the AM2302 near the hole where come the power.

Downloads