ARDUINO LIGHTNING AND THUNDER SIMULATOR

Images

All Components

This is the full setup. I just use the USB power from an old phone USB charger to power the Arduino setup and the strobe light has its own power cord that needs to be plugged in as well since I only use the Arduino to trigger the strobe instead of powering it. The output of the MP3 player goes to a small guitar amplifier and its stereo headphone jack is converted into a mono phono jack for the amplifier input. The amplifier needs to be plugged into the wall too.

Strobe triggering circuit connections

The top board is the one connecting the Arduino digital output to the high power transistor that supplies power to the relay inside the strobe light assembly. Using a relay and keeping it inside the strobe light assembly keeps the high voltage safely away from our low voltage Arduino circuitry.

Shield and MP3 Player

This shows the MP3 player that is underneath the triggering board. It sits on top of the Arduino Uno that is running the software.

Amplifier input

The MP3 player has an out jack for a set of earbuds but the guitar amplifier needs a single (mono) inout that is the "phono jack" size instead. I used some adapter cables I had lying around to do the conversion.

Strobe light 1

In order to use the strobe light for its normal purpose I chose to install a switch to toggle between modes. In one position the strobe works "normally", being controlled by the knob for the interval. The other position allows our Arduino's trigger circuit to close the relay when we want the light on.

Strobe light 2

This just shows the back of the strobe light with the power cord, the on/off switch and the interval knob. All of these are how the strobe light comes out of the box - I did not modify them at all.

Strobe light 3

This is the inside of the strobe light that shows the DPDT switch I used to switch the transistor in and out (and the relay contacts out and in, respectively). Note the original strobe light transistor mounted on the switch terminals. This was removed from the circuit board and replaced with wires. It also shows the small 3 volt RW-SH-103D relay I used that is driven by the Arduino via the Darlington transistor on the "trigger shield".

PERFORMING MODIFICATIONS LIKE THIS IS DANGEROUS. DO NOT ATTEMPT.

Strobe light 4

Internal closeup of the circuit board where the small transistor was originally located but now has wiring going to the switch instead.

PERFORMING MODIFICATIONS LIKE THIS IS DANGEROUS. DO NOT ATTEMPT.

Strobe light 5

A closeup of the original transistor that was mounted on the circuit board but is now mounted on the switch terminals.

PERFORMING MODIFICATIONS LIKE THIS IS DANGEROUS. DO NOT ATTEMPT.

Overview

This project has two components, one for the thunder (sound) and the other for lightning. The important part is that they are both synchronized together - the light has to flash the same time that the thunderclap starts.

I had a very hard time finding an inexpensive way to do this by just purchasing an off-the-shelf thunder/lightning strobe light. To get something that looks even close you have to spend several hundred dollars. I just wanted something cheap for a Halloween prop so I went about thinking this project up.

Getting the strobe light to be triggered by the Arduino was the hardest part. Off-the-shelf "lightning strobe lights" are just strobe lights that flash in an interval set by turning a knob to get the desired flash rate. In nature, lightning is much more random so the off-the-shelf stuff didn't really work for me.

I was able to figure out the strobe light circuitry enough so that I could use a relay to close a circuit which would flash the light as long as the circuit was closed. I originally wanted to take the necessary circuitry out of the strobe light and put it in the project but found this way to be much better. I could reuse the strobe light for its original purpose and I could keep the modified strobe light wiring safe to use.

After I figured that out, I needed the Arduino to quickly power up a relay that had enough current capability for the strobe circuitry. There is an abundance of large relays that require 110 volts AC that would have done the trick but I wanted the coil to be controlled by the Arduino, so I found one that only required 5V DC (3 volts actually, Goodsky RW-SH-103D). I didn't have much luck getting the relay to work by driving it directly with the Arduino digital outputs so I wound up using circuitry I used in the darts project - a high-power Darlington "driver" transistor (TIP120) that would trigger with low current and voltage but supply a larger current and voltage.

Parts/Components Used
SparkFun MP3 Player Shield

This is the shield I used but wish I used the one from Adafruit instead. I chose this one because of the price but it turned out the driver software didn't work. At all. All of the demos I found online did not work and the driver software was all several years old. I wound up using the Adafruit drivers for the Adafruit board and then modifying it slightly because the pins were different. I got it to work but wasted a lot of time in doing so.

You also need to buy header pins (and solder them in) so it can plug into the Arduino.

SparkFun MP3 Player Shield
OSEPP Proto Shield

This is the prototyping shield I used because it was readily available (from frys.com) and was still under $10. Unlike the Adafruit shield this one comes preassembled so there is no soldering involved, not even for the header pins.

Protyping Shield
Thunder and Lightning Strobe

This is the original strobe light I purchased in anticipation of just using it because it had sound too. What a joke! This is a real turd. When I received it and tried it out I wanted my money back and tried to get it but the supplier REFUSED! So I figured I had nothing to lose by taking it apart and modifying it.

Strobe light 6
Arduino Sketch

This sketch has code used for the Adafruit VS1053 library. A lot of that code was left intact but commented out because I needed to modify it to work with the SparkFun shield. It does have some logging that you can see happen when the Arduino Serial Monitor is showing so that may be helpful when trying to troubleshoot.

On startup the light is flashed and a thunder sound is played so you can see right away if it is working. After the initial startup light/sound it takes a while for the next event to happen - sometimes it seems like it takes forever. The actual time is randomized so just be patient, it will work again if it worked on startup.

There are three MP3 files it plays in random order. The file is not matched with the number of flashes (they are randomized, remember), just the timing of the file being played and the light flashing is synchronized.

When it has been determined that it is time for "lightning to strike" again it flashes the light and then starts playing the file (asynchronously). I think originally I started playing the sound first then flashing the lights, hence the async part. This way gives me the flexibility to change the order if I want to. But in this order it is possible to not have to bother with the async way, just initiate the playback and then when it stops program execution will continue.

Mp3_ThunderAndLightning.ino (Zip file)
Trigger Circuit Diagram

All of the MP3 files I used are "open source", no purchases were necessary and no royalties need to be paid for usage. The project cycles through these three sound files.

Trigger Circuit Diagram
Thunder MP3 Files

All of the MP3 files I used are "open source", no purchases were necessary and no royalties need to be paid for usage. The project cycles through these three sound files.

thundersounds.zip
Adafruit VS1053 Library

I wound up using the software drivers from the Adafruit MP3 board instead of the SparkFun one because I could not get the SparkFun drivers to work. Here is the version of the AdaFruit software I used.

Adafruit_VS1053_Library.zip