Motion-sensing USB light controller (customizable)
thingiverse
This design adapts an off-the-shelf 3×AA battery powered motion sensing light to USB outut. The design is made to work with parts from an unbranded light with model number BO1101-WHG-04LF1-D (or -E, available from a particular orange big-box hardware store, amongst other places) but should be easily-adaptable to other models. (A photo of the donor device is the last in the list above and is also shown later in this document.)IMPORTANT NOTESince the Download all files link isn't working correctly Motion-sensing_USB_light_controller.zip can be downloaded instead. It contains all of the files, documentation, and images.General notesWhen it comes to donor devices, the size of PIR sensor is the main concern; the one from the aforementioned donor device has a body (not lens) diameter of 10.35 mm (the lens is slightly wider).The case screws are scavenged from the donor device. I found that the screw heads are prone to stripping so applying minimal torque and the use of a flat-head screwdriver is recommended. When initially screwing the lid in place go slow and back off frequently to avoid damaging both the case and the screw heads.The battery holder should be cut out of the donor device. The four circuit board guides/retainers should be kept intact. The edges should be sanded smooth. By default the overall size of the main body should be 47 × 58 × 16 mm; these dimensions can be customized in the script.The guides that hold the circuit board in place need to be trimmed so that the tops of the retainers are flush with the top of the circuit board.Once rewired, the circuit board is affixed to the battery holder with a bit of hot glue at the edges. The battery holder is press-fit into the case.The device needs a USB-A jack. This can be scavenged or bought new; these parts are pretty generic so pretty much anything should work fine. In addition you'll need about 50 cm of thin, flexible hookup wire.OpenSCAD parametersThere are two sets of presets included, one having the ambient light sensor on the top and one having it on the front. Transparent versions of the presets are also included.The main tweakable parameters are in the Parameters section.If adjusting the corner radii you may need to offset the screw positions using the Screw X (Sox) and Screw Y (Soy) parameters in the Lid section. The parameters for screw sizing are also in this section.The options under Display control how the preview is presented. They have no effect on the final output. The model looks best in preview mode when Render objects in previews (render_previews) is selected; this can cause slow rendering on older systems so you may wish to disable it.The parameters under USB jack should work fine for most parts. Two parameters that may need tweaking are:Offset from right edge (Uo)This controls how deeply recessed the jack is. The value must be no smaller than the wall thickness. If need be this value can be reduced to moved the jack closer to the edge.Body depth (Udb)This is the full depth of the jack from front to back.If using a different donor device you may need to adjust some parameters in the Battery holder section:Width (Bw)Depth (Bd)Height (main portion) (Bh)Extension height (board guides, etc.) (Be)The first three parameters set the size of the main body of the battery holder while the last sets the gap between the back of the battery holder and the top of the case.Additionally, under Sensors one can shift the positions for the PIR motion sensor and the ambient light sensor left or right. The latter sensor can be placed on the top, on the front next to the PIR sensor, or omitted.CircuitryA few changes need to be done: 1) Move the PIR motion sensor to a wired connection, 2) Replace the LED with a USB jack, 3) replace the battery wires with longer ones, and optionally 4) Move the ambient light sensor to a wired connection. Space is a bit tight inside the case so the more flexible the wire the better. I chose 0.25 mm² (24 AWG) tinned stranded wire.PIR motion sensorCarefully desolder the sensor from the board. I recommend applying a large amount of leaded solder to the connections, heat them simultaneously so that the sensor can drop free, then clean up the pads with some desoldering braid. I suspect that this part is rather heat-sensitive so the desoldering should be done as quickly as possible. The sensor can now be reconnected using wires. The three wires I used were each 6 cm in length. Note that the wires will likely need to be fed through the case hole before soldering. With care though the connections to the sensor can be made with the sensor fitted to the case.OutputDisconnect the wires from the light and connect them to the USB jack. Looking at the USB jack from the outside with the four interior metal contact facing up the ground (negative) pin is on the left and the 5V (positive) pin is on the right. Wire USB- on the board to ground on the jack and USB+ to 5V on the jack. USB-A jacks are fairly generic so pretty much any one can be used. I chose to replace the stock wires with new ones each 6 cm in length. I recommend soldering the wires to the jack before installing it in the case.Battery wiresThe design rotates the circuit board 180° so the existing battery wires (at least the positive one) need to be changed. I chose to use a 5 cm one (positive) and a 3 cm one (negative).Ambient light sensor (optional)This sensor can be moved to a wired connection. If you choose to do so make sure you note which pin is which since the sensor is polarized. If you're unsure about the polarity look at it from the side; the taller metal piece inside with a large head is the positive side: .---. | / | / || .+ || || - (ground)Optional circuit modificationsThe device that I modified uses a BISS0001 controller chip. The timer-related and ambient light modifications are specific to this chip. The output current modification should work on any donor device. See the schematic, below, and the BISS0001 datasheet for details.On timeThe length of time that the output is on after being triggered is set by C1 and R2. The on time (in seconds) is roughly 24576 × R2 × C1. The default is about 30 seconds. To change it to, e.g., 1 minute change R2 to 240kΩ. On the device that I modified, 220kΩ gave almost exactly 60 seconds. See end of this document for photos showing this modification.Retrigger inhibitThe device will ignore motion for a short while immediately after the output turns off. This is set via C2 and R3 with the timeout (in seconds) being 24 × R3 × C2. The default is about 4 seconds. Replacing R3 with a 0Ω link should disable the retrigger inhibit function (this has not been tested).Output currentLights designed to be powered via USB include series resistors which means that their power supply does not need to include one. The unmodified donor device, in contrast, drives an LED directly so needs to do current limiting itself; this is done using a 12Ω current-limiting resistor (R15). To increase the available current one may wish to replace this resistor with a 0Ω link. Here's a comparison of current draw for a fairy light string and a desk lamp: | 3.6V¹, 12Ω | 3.6V¹, 0Ω | 5V² (0Ω) --------+------------+-----------+---------String³ | 33mA | 50mA | 108mALamp⁴ | 67mA | 200mA | 433mA¹ 3.6V is for 3×AA NiMH² 5V is for a standard USB power supply³ 2.4Vf, 24Ω series resistor in string⁴ 2.4Vf, 6Ω series resistor in lampAmbient light sensorThe BISS0001 chip has an enable input (VC); the device will only be triggerable if this input is high (>0.2×Vcc). This input is connected to the middle of a resistive divider with a 330kΩ resistor (R10) to Vcc and a phototransistor (Q1) to ground. To require the ambient light to be darker before the the device can be triggered then set R10 to a higher value (perhaps 560kΩ or 1MΩ). Don't set the value too high though since this might inhibit retriggering. To make the device always be triggerable one can simply remove Q1 from the circuit.Circuit board with traces labeledThe PCB of the donor device is shown above. The magenta line the positive battery rail which is typically 4.5V (for alkaline cells) or 3.6V for NiMH. The red trace is the Vcc (positive supply) line for most of the circuit. Black lines and squares indicate ground; these are all connected directly to the negative battery terminal (B-). All other traces are in orange.SchematicPart donor deviceThe device shown above (as well as in the rest of the photos) is the BO1101-WHG-04LF1-D; I'm not sure how the BO1101-WHG-04LF1-E differs (if at all; the specifications are the same). I suspect the only difference is the packaging.Mofifying the 'on' timeThe pads marked in magenta are directly connected.Original R2 removed and pads cleaned.New resistor soldered in place. A 1206 (metric) part was used because that was what I had on hand (the original size was 0603). Its larger size meant it was easiest to solder it directly to the IC pin.
With this file you will be able to print Motion-sensing USB light controller (customizable) with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Motion-sensing USB light controller (customizable).