How do I put a fluorescent light on a motion sensor?
I have a couple closets in my basement that I have outfitted with a fluorescent light attached to a motion sensor (this one). The idea was that when you open the closet door, the light comes on automatically (and turns off automatically when you close it).
The first problem I ran into was trying to use a light with an electronic ballast, which didn't work at all. After reading the instructions I found that you have to use a light with a magnetic ballast.
So, i replaced the light with one that has a a magnetic ballast, and now it comes on just fine when the door is opened. After closing the door and waiting a minute or so the light should turn off. But instead of turning off it just begins to flicker very rapidly.
Any one have any ideas about what might be causing that or what I might have done wrong? Or any personal experience with fluorescent lights that will work with a motion sensor?
I thought about just using an incandescent light instead, but seems that code doesn't allow incandescent lights in closets.
Assuming you're talking about motion sensors like this:

Switches like that need power. They can work by trickling current through incandescents if hooked up like a normal single-throw switch (in series with feed going to lights). If the switch has 4 wires (hot, return, switched, and ground) then you can hook them all up and it will power itself using it's own hot + return. In that case, it shouldn't have to trickle power through the light's circuit, and fluorescents should be able to turn off.
When I first installed some fluorescent flood lights with motion sensors on them around my house I found they did not work well, they would not turn off or would not start up. I resolved this by removing the light and placing a small single pole single throw 120 volt relay in the electrical box. I used the red output wire that normally goes to the light to feed the coil of the relay, I then pigtailed the constant hot (black wire) to the light and to the one side of the open contact. The feed wire to the light I then put on the other side of the open contact, doing this completely isolates the sensors from the fluorescent light. This also then changes the amount of the load you can place on the light, because the light fixture no longer feeds the light it only feeds the coil of the relay. I have had no problems with any of the lights or fixtures.
I've only tried putting CFLs on motion sensors, and I have no idea what type of ballast they were. The only ones that work are labeled as 'instant-on', and they seemed to charge a premium for them.
I'd occassionally run into the same problems you had, with the flickering, but even worse is that the life of the bulb was dramatically shortened. I had the motion sensor (same one as you, I think) in my kitchen for less than a year before the bulb failed. In that case, the motion sensor was built into a wall switch, and the switch itself was wired for 3-way. (I never took out the other switch).
I've had better luck outside, with the light on my porch (that one didn't need an 'instant on' bulb, come to think of it), where the motion sensor was built into the fixture itself. That one's pretty tempremental, as it worked for months, then suddenly stopped working ... but I suspect it to be the fixture, not the bulbs, as it behaves the same way with incandescent.
...
My suggestion would be in your case, if the restriction is on incandescent lamps specifically, that you look into LEDs. My roommate got some inexpensive LED lights for cabinets that are battery powered, with a magnetic sensor (a similar concept to this item, but not the same model) -- you attach the magnet to the door, and the lamp to the door frame. When you open the door, the magnet detaches, the circuit closes, and the lamp turns on. It might not cast enough light for what you're looking for, though.
Some motion sensors also have photocells to detect ambient light. If the photocell sees the light output by the fixture (for example by having it reflect off the inside of the closet door) it can cause the rapid flickering you're seeing.
The model of motion detector you have does have this feature and it can be adjusted (instructions [PDF]). Otherwise, you can try blocking the photocell with a piece of electrical tape. If you have the model PR180, the fourth (red) wire is for connecting a three-way switch.
The problem is that the sensor got an inductive output switch which only works with incandescent bulbs. You need to find a sensor that got a relayed output to be able to handle a ballast which is a reactive load by it self. No being too technical, because the ballast generates it self some reactive energy that flows in opposite direction it does not allow the sensor output switch to switch off, though the flickering effect.
Just put a low wattage (5 W) incandescent light as the first light in your series of fluorescent lights. Usually, it is only the first CFL that flickers, so if you connect an incandescent light before that, it will create the circuit needed for your PIR to work, leaving the CFLs in piece.
A friend of mine did the same thing in their closet. However, they did it with a special switch installed in the door frame. When the door is closed, it presses on the switch which turns off the light. When the door is opened, the switch is activated, and the light comes on. Then it is just a normal light fixture, and florescent lights can work fine.
A variation on Steve Armstrong's answer. Years ago, I used X10 controllers to control some CFLs outside my house. As long a one of the lights was a incandescent, it worked fine. I never understood why, but his answer explains it (assuming you understand electricity, switching and such).
So if you wire a small normal light bulb in parallel with your fluorescent strip, it may work.
You'll get the light level you want while still using less juice.
This is very simple.
All you have to get is a PIR sensor (passive infrared sensor).
The following may help you.
Item: Occupancy Sensor.
Sensor Type: Passive Infrared.
Coverage (Square-Ft.): 2100.
Installation Type: Wall Switch.
Viewing Angle (Deg.): 180.
Timer Range (Minutes): 10 to 30.
Time Delay: Manual.
Watts @ 120V: 800 Incandescent, 1200 Fluorescent.
Watts @ 277V: 2700.
Voltage: 120.Description/Special Features, 3 Preset Time Settings.
Includes: Shutter, To Prevent False Tripping.
- Wall Switch Occupancy and Vacancy Sensors
Sensors automatically turn lights on and off as individuals enter and leave, reducing energy costs. Push-button controls set ambient light threshold on wall-mount units; LED indicates status. Automatic sensor time delay adjustment eliminates need for manual adjustment, and helps prevent false offs when time delay is too short for activity level. Simple switching from Auto to Momentary Off mode. Returns to Auto mode 30 min. after the last motion is detected.
Passive Infrared (PIR) Occupancy
- Sensors detect body heat in motion. Must be located where full line-of-sight is possible.
Motion sensor wiring diagram