Toilet Light

Got a hardware problem? ask for help

Toilet Light

Postby enohand » February 21st, 2013, 10:54 am

ok, so in my house we have a little problem.

sometimes ant night people enter the bath room, & start peeing with the lights off & get a little splash here & there on the floor/edge of the toilet.

The solution i have decided to come up with is, a led light, connected to a PIR that will turn on when it detects motion & light the bowl. (yes i know that they sell these things...but i want to build it)

I want to build something similar to this unit below
http://www.dhgate.com/h8010-infrared-pi ... #s1-1-null

.

So in terms of HW, i have a arduino mega & a micro (but hate to use either on the final project) I have a few 120v receptacles that have a PIR sensor on them, & would like to use 1 of those PIR's (after it is cut off/dis joined from the outlet it is on, or if i can make a PIR with a set of IR Leds). A hand ful of LEDs, thou 1 may be sufficient, & for power i plan to use a lion battery from a disposable e-cig.

so now i need some assistance from you guys as to what i should use as the main "chip" would a 385 work? anyone able to provide any guidance as to how to start the arduino sketch?

and also would the PIR sensor that i want to use work? any way to find out the pin outs on it?
enohand
 
Posts: 10
Joined: March 8th, 2011, 9:38 pm

Re: Toilet Light

Postby st2000 » February 24th, 2013, 7:34 am

Like the title.

1. I usually side on safety. To the point where people may go the other way. Regardless, there's water involved so I would go with batteries.
2. I'm betting most wash-room sensors are not motion detectors (I think that's what you might have in that 120V outlet switch). I'm betting they are proximity sensors like this one:
https://www.sparkfun.com/products/242
This way the light will stay on while you remain motionless (doing your business). These things are not looking for "changes". They shine an IR led at you and look for the reflection. With one of these you can even tell how far away someone is. The detector above has a range of 10cm to 80cm. If 80cm is not long enough, Sharp makes ones that "look" farther away.
3. As for a battery, I would use one of those rechargeable USB power packs. Some are as small as a large pack of gum. They have a charger circuit and usually a "fuel gauge" already build in. Best of all, they are already to power 5V devices such as an Arduino.

So, do what every good programmer does. Find a couple of existing sketches that come close. Then merge them into what you want. In this case, you probably want to use a sketch that detects the variable voltage (which is proportional to the detected distance) so you can see how to read a varying voltage. Then you want to "set a threshold" that will turn on an external driver (yes, hardware is involved as you are trying to use Bright White LED that might take as much as 20mA each) to turn on LEDs.

BTW, almost any processor is overkill for this project. So take advantage of it. Add some delay before turning it off to allow for hand washing time. Get fancy and use PWM (there are plenty of sketch examples) to fade the lights on and off. Add a light detector so the batteries are not wasted during day light hours. Add high efficiency (dimmer) LEDs you can leave on as a night light when the sun goes down. Conserve power by only waking up the processor once every 5 seconds to check on the proximity detector. Conserve power by turning off the power to the proximity sensor when not in use (4 out of every 5 seconds).

-good luck
st2000
 
Posts: 1138
Joined: February 3rd, 2011, 6:10 pm


Return to Help me! Hardware

Who is online

Users browsing this forum: No registered users and 3 guests

cron