Lightning activated shutter trigger using Thunder click


An extreme heat wave has taken reign over Europe. With day temperatures over 39 degrees Celsius, and nights over 20 degrees, in many cities all-time weather records were shattered. Now, the weather service has no good news: it’s gonna cool down, but violent thunderstorms are expected.

Warning: Use of undefined constant ICL_LANGUAGE_CODE - assumed 'ICL_LANGUAGE_CODE' (this will throw an Error in a future version of PHP) in /home/teodorc8/public_html/wp-content/plugins/insert-php/includes/class.execute.snippet.php(456) : eval()'d code on line 19

Warning: Use of undefined constant ICL_LANGUAGE_CODE - assumed 'ICL_LANGUAGE_CODE' (this will throw an Error in a future version of PHP) in /home/teodorc8/public_html/wp-content/plugins/insert-php/includes/class.execute.snippet.php(456) : eval()'d code on line 22

Time to start working on my next project: a lightning activated shutter trigger. I already have all the needed hardware from previous projects: one Arduino Uno, one Click shield, one Thunder click board and one Relay click board. The thunder click is configured for 5V operation and is set in socket #1, while the relay click is is socket #2 of the click shield.

Arduino lightning trigger project

Arduino lightning trigger project

As for the software, the project is in many ways similar to the AS3935 Lightning detection using Arduino Uno project, so most explanations given there apply on this project too. Also, don’t forget to install the AS3935 Arduino library as a prerequisite.

The major change is in the interrupt service routine: now, when an interrupt is detected, we disable first any other incoming AS3935 interrups. We then read the content of register REG0x03[3:0] to determine if there is lightning. Noise and disturbers are ignored. In case of lightning, we read the distance to the lightning event from register REG0x07[5:0]. If the storm is too close, the code turns on relay #2 and enters an infinite loop. This is set as a reminder for the photographer to take shelter.

If the distance is too great, there is no point to take pictures.

If we are in the good distance range, we issue a 250 ms pulse for the trigger, than we wait for the post_trigger delay.

After all this, we re-enable the AS3935 interrupt. If there were any events during the time we were busy taking pictures, the INT pin will remain high. As the AS3935 is triggered on the raising edge, we need to reset the INT pin to 0. This is done by issuing the AS3935.interruptSource() command.

 The chance to be hit by lightning is normally very low. According to the US National Weather Service the odds of being struck by lightning over your entire live is 1/12000. However, this applies to the average person. Staying in an exposed area, with the camera on a tripod waiting to capture the perfect thunderbolt, it’s like asking for trouble. Take appropriate measures to protect yourself during thunderstorms. Some nature photographers I spoke don’t even think to expose themselves while taking storm pictures. Instead, they prefer the safety of their cars, and they move away when the storm is too close. gives a few good advices on how to make good lightning photos: link1 and link2.

A few final thoughts:

While I designed this project as a lightning trigger, with some minor changes in the code this can work as a lightning alarm too. One can use relay #1 to give an early warning, and relay #2 to issue a second proximity alarm.



Comments are closed.