The sensor box is especially developed to house an optical sensor or a thermistor. Both are vital parts of overfill prevention systems used when bottom loading compartments. The sensor box facilitates mounting of the sensor on the manhole cover and protects it at the same time from environmental forces such as wind or rain or direct sunlight. The box is tight to the compartment (IP68) preventing water from mixing with the fuel.