Whilst working on another project I decided try out this little side project. I was looking at the glass sample bottles we use in the lab where I study and thought they would make a nice housing for a tiny light. Something along the lines of a "fairy in a bottle" type thing. I wanted the electronics to be completely sealed inside and hidden in the lid, which led to the problem of how to turn it on and off. I decided to use a tilt switch to add a little more quirky-ness to the light. When the bottle is upside-down the LED is off but when flipped the right way round the LED turns on. This is a fairly simple make and took me about an hour to figure it out and put it together.
You Will Need:
1x resistor (more info on how to choose the right one later)
1x Small Battery (I'm using a 6v key fob battery)
A small piece of protoboard
A glass vile with a lid big enough to fit you components in (Mine is a glass sample bottle used in laboratories)
Soldering iron and solder
Step 1: Make the Circuit
The circuit is very simple but the tricky part comes in trying to make it as small as possible. Let's start with the battery, this will probably be the largest component so it would make sense to base the locations of the other components around it. I glued my battery to the protoboard.
The tilt switch has to be fixed the correct way up, below is a basic diagram of the inside of a tilt switch. you can see, when the legs are up, the ball does not connect them so current does not flow. When the legs are down, gravity steps in and the ball bridges the gap between the two legs. I might be useful to note that the outer leg is just an extension of the case so the case itself can be used as a terminal.
The resistor prevents all 6 volts rushing to your 3.2 volt LED and killing it. Not all LEDs have a voltage drop of 3.2V so be sure to check the pack. If your battery voltage, LED voltage or LED mA usage is different to mine, you can simply work out what resistor you will need using Ohm's law. Resistance = Voltage / Current so in this case we see that the resistance needed = 140 Ohms = (6 Volts - 3.2 Volts) / 0.02 Amps
I didn't have any 140 Ohm resistors so I used a 150 Ohm resistor which works just as well (it's ok to increase the resistance a little but dropping below the calculated value runs the risk of damaging your LED)
One last note on the LED. They only work one way round. LED's only let current flow one way so make sure you put it in the right way round. The longer leg should be closest to the resistor while the shorter leg closest to the negative end of the battery.
there are no strict rules on what your circuit should look like as your bottle cap will most likely be different to mine. Just be sure to plan your circuit and make sure it fits before you make anything permanent. This is very important as it is very difficult to undo glued or soldered mistakes!
Step 2: Glue It In
This is a simple and short step. Now you have made your circuit you'll want to glue it into the cap of your bottle. Before you do, however, place the circuit in the cap and lower the bottle onto it to make sure it all fits. If it doesn't fit you might have to get creative and brutal with a file. This is why it was important to check it fits before you make anything permanent. Now you know it fits, it's time to glue it down. Don't be shy with the glue here, the last thing you want is for your circuit to fall into the bottle. Before the glue dries you can carefully lower the bottle down to make sure you're gluing it in the right place. Leave it to dry for a while (read the instructions on your glue to find out how long).
Step 3: Flip It!
Now that your glue is dry you can screw the cap onto the glass bottle, flip it over and away you go!... Whilst doing this, I thought it would look a lot nice if the glass were frosted. This would give a more mysterious effect and hiding the circuit would not be as hard. If you wanted to do this you could get some glass frosting spray and frost the bottle yourself!