A computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out a method for compensating for ambient light for an arc flash detection system for an electrical equipment, the arc flash detection system including a first optical sensor for detecting an arc flash, the program comprising:
- instructions for initiating a recording mode in which a first output signal of the first optical sensor is recorded, wherein recording the first output signal comprises instructions for storing a first plurality of values, wherein each value of the first plurality of values is representative of a level of ambient light condition in or around the electrical equipment;
- instructions for terminating the recording mode after a recording time period;
- instructions for determining, based on the first plurality of values, a first quantity characterizing ambient light in or around the electrical equipment;
- and
- instructions for configuring the arc flash detection system to compensate for ambient light based on the first quantity.