A glass globe that simulates a thunderstorm when you shake it. It's a bit kludgey but it works. It'll play thunder and lightning at random intervals for about 90 seconds, depending on how much you shake it.
Step 1: Materials
- a snow globe kit
- an Adafruit Flora
- an AudioFX board
- an amplifier
- a 2" speaker
- 10 white LEDs
- a AAA battery pack with on/off switch
- a vibration sensor (SW-520D or similar)
- a 100 ohm resistor
- 22AWG hookup wire (various colors)
- glue (e.g. E6000)
- duct tape
- a wine cork (or a 2"L x 3/4"dia dowel)
- a white plastic shopping bag
- black cotton batting (or white cotton balls and some black paint)
Step 2: Programming
Load T00RAND00.ogg, T00RAND02.ogg, T00RAND03.ogg (from audio.zip) onto the AudioFX board. Remove any sample files that might be on there.
Program the Flora with thunder-globe.ino.
NOTE: The audio files each have 1/2 second of silence at the beginning to simulate the delay between a lightning strike and the sound of thunder. If you'd rather have the light and sound occur simultaneously, edit the files to remove the silence.
Step 3: Wiring the Audio
Wire up the amp and AudioFX board as follows:
- Left amp output to speaker
- L and Gnd from AudioFX to L+ and L- on amp
- Attach red wires to VDD on amp and Vin on audio fx
- Attach black wires to Gnd on AudioFX and GND on amp
- Attach a blue wire to 0 on AudioFX
- Attach an orange wire to Act on AudioFX
- Solder the header strip in place on the amp and jumper the 18 position.
Step 4: Wiring the Flora
- black wires from battery pack, AudioFX, and amp to GND on Flora
- red wires from battery pack, AudioFX, and amp to VBATT on Flora
- orange wire from AudioFX to SDA on Flora
- blue wire from AudioFX to D12 on Flora vibration
- sensor between SCL and GND on Flora (make sure it's upright)
At this point, if you turn on the power and shake the Flora, you should get thunder.
Step 5: Base Assembly
- Glue the cork to the battery cover, roughly centered.
- Glue the Flora to the cork.
- Zip-tie the amp and AudioFX to the cork.
- Glue the battery pack onto the base plate, making sure to align the switch with one of the holes.
- Strap the speaker to the base plate using a piece of wire.
Step 6: Wiring the LEDs
- Solder the 100 ohm resistor to GND on the Flora, laying it across the board.
- Put a piece of duct tape in the board to prevent shorting.
- Solder the short lead of each LED to the free end of the resistor.
- Solder the long leads of 2 of the LEDs to each of the following: TX, RX, D10, D9, D6.
- Bend the LEDs so that they face various directions, distributing the light.
At this point, if you turn on the power and shake the base, you should get thunder and lightning.
Step 7: Clouds
- Get a white plastic shopping bag, the thinner the better.
- Stick bits of black cotton batting to it. Try to get decent coverage without making it completely opaque.
- Push the bag into the globe, taping the perimeter to the neck.
- Wrap the neck with duct tape to hold it in place. If you use two layers, it should be enough that the globe with fit snuggly in the base.
- Get a sheet of white cotton batting.
- Stick cotton balls on it.
- Spray a light dusting of black paint on it.
- Push the sheet into the globe, taping the perimeter to the neck.
Step 8: Final Assembly
- Screw the base plate onto the base.
- Insert the globe into the base.
Step 9: Refinements
- The code is a bit buggy; could use a little work.
- Could use a few more thunder samples.
- The cloud might be a bit too opaque. Maybe use lighter materials.
- The speaker's a bit muffled. Maybe a smaller speaker, pointed straight down would help.