Finding a battery compartment for your robot in the middle of the night is a pain. Here's a way to hack a cheap flashlight into a battery holder.
Step 1: Battery Container: FAIL
Tried using just duct taping some batteries together as a quick-n-dirty way to get some volts. But this doesn't work. The connections between the batteries don't hold and there's no way to attach a + and - wire lead to the raw batteries.
So on with another quick-n-dirty battery holder . . .
Step 2: Materials and Tools
(1) Cheap flashlight
(1) Soldering iron
(2) 22g or stronger wires
Step 3: Take Apart Flashlight
The basic idea is to route new wires through the front cover of the flashlight.
You'll want to keep everything except the bulb and lens.
Step 4: Make a Hole for Negative Wire
Drill a good-sized hole through the upper part of the cover (above the ridges). This will be access for the negative wire.
Step 5: Solder Negative Wire
Slip a wire for the negative through the new hole and solder to the large disk part of the header.
These solder cleaners work really well. Check out the before and after of the solder tip.
Step 6: Solder Positive Wire
Thread another wire through the front of the flashlight's head and solder to where the bulb used to be. This will be your positive lead.
Step 7: Use in Robot Projects
Place new battery compartment in a handy location, with the switch easily accessible.