Model Train-related Notes Blog -- these are personal notes and musings on the subject of model train control, automation, electronics, or whatever I find interesting. I also have more posts in a blog dedicated to the maintenance of the Randall Museum Model Railroad.
2021-07-03 - Motion Sensor LED Light for the Train Back Room
Category TrainToday we’re modifying this cheap “Motion Sensor LED closet/night light”: https://amzn.to/3qqVBqS
So here’s the situation: the back room at Randall where we have the workbench presents some challenges. The switch to turn the room light is in one corner of the room, and we enter the opposite side of the room. And in between we have the Bridgeport yard, the Napa yard, and the workbench. Thus when we enter the room we need to carefully navigate around all these things mostly in the dark till we can turn on the light. Not ideal. Most of us use our phones as a flashlight to avoid tripping into something. Can we do better?
Well sure. That little USB-powered LED light is just fine for the task. The motion sensor only turns it on when it is dark and it detects someone moving around. Since the light has a battery, it can still work fine before we turn on all the circuits including the back room light.
I have it connected to an outlet that is powered off the layout in the other room. That way it charges when the layout is turned on.
These lights are designed to be placed in closets, without any power. They come with a magnet that can be taped to the back of the light, making it easy to remove for charging it elsewhere and then put it back in the closet. That sounds a bit cumbersome, and my idea is that this light is going to be permanently powered by a USB charger using one of the layout circuits. So the charging only happens when we have the layout turned on, which is good.
When setting the light in “AUTO” (motion sensor) mode, it works fine when unplugged, it detects motion and turns on for about 20 seconds. There’s also an ambient light detector so that the light only turns on in the dark. Perfect for our case.
However, much to my surprise, when the light is powered by the USB charger, the “AUTO” motion sensor mode does nothing. It does not turn on the light. This is oddly not documented anywhere.
Maybe the light’s circuitry can be modified? Let’s open it. This is trivial as it has no clips, only 6 screws in the back. The circuitry is rather simple:
There’s also a video from BigClive.com here where he takes one of these appart and explains the circuitry:
So really nothing here looks like the motion detector mode should be deactivated when the light is powered by the USB cable for charging.
Then I realized the explanation is much more mundane than this. The light has two ferociously bright blue and red LEDs used when charging. The red LED lights up when the light is charging, and the blue one lights up when the light is charged. The design of the light’s plastic enclosure is odd in that regard as the two status LEDs are under the opaque part of the plastic. I’m guessing they made the LEDs extra bright to be able to shine through the plastic and be visible even in daylight. At night, these two status LEDs are enough to illuminate a room and serve as night lights all by themselves!
And then from the open view above, I realize there’s nothing between these ferociously bright LEDs and the ambient light sensor. Which means when the device is charging, it’s likely detecting “ambient light on” from its own status lights and thus disabling the motion detection circuitry.
Instead of trying to hack the circuitry, I went for the easiest route: tone down the charging LEDs with a piece of tape.
I wanted to keep the ambient light sensor intact as I don’t want the light to go on all the time when the room light is turned on.
With that change, the status LEDs are faintly visible in the dark, and what’s important is that they do not trigger the ambient light sensor. They are definitely not visible during daylight or when the room light is on. First attempt was not enough so I had to add a second layer of tape. It’s easily reversible and non destructive too!