Thunder & lightning is an eye catching effect on any model railroad. I’ve done several videos on same effects, but never with the ATtiny 85 chip.

Since it has 5 IO pins available, that’s ideal for this project. I do not show an Input to trigger the procedure but pin 7 which is designated as pin 2 in the sketch is available for this purpose.

 

My original project with thunder & lightning had an instantaneous flash & sound triggered by the sound. Later I changed it to a delayed sound as in real life. Light travels extremely faster than sound. We always would count the seconds between the flash and the sound to determine how far away the lightning was .Approximately 5 seconds would be 1 mile away.

ATtiny85 Lightning

Sample Thunder  Sounds  

Extended Pin Designation