Hand tools and fabrication machines
This little lamp looks like LEGO, and will keep you safe in the night. It turns on when you flip it onto its side. I used a cheap solar flashlight from a hardware store, but you can use this technique on pretty much any cheapo light.
I used glow-in-the-dark filament, so it's easy to find at night. If you make this, be sure to share your results!Modifying the Flashlight
First, I took the light out of its little enclosure. Removing the solar panel was the toughest part, and I scratched my thumb on some sharp plastic. Ow.
I removed the non-essential DC motor that takes power from the crank; we won't be needing it.
Then, I soldered the tilt switch to both contacts on the original slide switch. It was a bit fiddly. Each leg of the tilt switch goes to one of the original switch's contacts. Make sure the original switch is OFF. (Otherwise, it'll keep discharging and never store power. Laaaaaame.)
I drowned the whole thing in hot glue to keep the tiny wires from breaking off during assembly.Assembly
Finally, I hot-glued the solar panel in place on top, glued the batteries underneath that, and glued the LEDs to the bottom. For seating the solar panel, I actually used the battery pack as a little handle to position it; then, I dripped hot glue down into the enclosure and smooshed it around with the tip of a screwdriver.
I glued the tilt switch to the side, on a 45º angle, so that you can turn the lamp on by simply rotating the lamp 90º. It will turn completely off if it's sitting straight up-and-down.Future plans
I originally had the solar panel on the side of the lamp, because my OnShape enclosure design can be made different sizes: just change the "Square" variable, and everything stays pretty much proportional. I moved the panel to the top for aesthetic reasons.
I'm moving the panel back to the side, mainly because it works at smaller sizes: the lamp is this big only because it can be used to prop open the window.
Also, since the lamp has to be turned on a particular side, the side placement would be helpful in remembering which face to place on top.
P.S. – there's also a cute little rocking house version of the enclosure! Be careful it doesn't tip over, though. :)