Introduction: Transform Basic Bathroom Fan to Advanced
This is my first instructable !!
After i moving with my girlfriend in our new rent house, our new bathroom was equipped of an fan evacuator with a PIR sensor to evacuate humidity, every time we power ON the light of the bathroom, the FAN power on and made a lot of noise !!
I like every time my girlfirend goes to bathroom at night ...
FAN would be power ON if the humidity is higher than 75%
The door is closed (go for a dump)
Please, excuse my poor English.
Step 1: What Inside This Silent Fan ;p
+ No transformator => Problem: i cannot extract safe 5V out of the box.
+ No Relay => my Electronic education is not enough to drive a FAN.
... It is a good work from the manufacturer !
Step 2: Add Switch With Snubber Filter
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)
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.
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.
Step 3: Add 5V Power Supply
Recover old LG Cell Phone charger to used as a power supply (230V => 5V 0.5A)
Step 4: Remaining Space
Take measures of remaining space where the PCB will be placed.
Step 5: Cut Useless Brace
Cut useless brace to win a little bit more spaces.
Step 6: Schematic Μc/Sensor
I chossen the Atmega 328p because I had several at home ^^
AM2302: The hygrometer/temperature sensor (1-wire bus)
Step 7: Led Driver
NPN Transistors working in saturation mode drived by µc.
Step 8: Door Detection
Infrared Proximity Sensor was built with an TCRT5000 and a LM324, the LM324 is aop used as an 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 of how much IR is received.
Step 9: Lets Go to Disign the PCB
I design the PCB with Fritzing and take into acount the space available in the box.
Step 10: Test and Reshape the PCB
I reshape the PCB to avoid useful brace.
Step 11: Let's Go to Solder Components
While i welding components, i realize that i forget to place Quartz ! ... i improvise by welding one Quartz above the µc.
After welding all components, i test with 5V power supply, every time i test a new PCB i hold my breath before power ON power supply ... poiouff, this time, all work fine for first shot.
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"
Step 12: Test FAN Drived by Μc + Try Close Housing
Temporary the LED go out.
Step 13: Mount the Proximity Sensor Near the Door
I do hole on the ceiling for passing the wires.
Step 14: Final Test
After calibrated the poximity sensor (set the potentiometer to detect the door)
I recovered the PIR cap to protect the LED from moisture.
while i take my shower, i remark that the sensor take a long wihle before detect moisture > 75% ... may be i must move the AM2302 near the hole where come the power.
We have a be nice policy.
Please be positive and constructive.