Explosion-proof battery compartment