Flash light that can't be switched on unless battery is above minimum charge?

A tutorial would be brilliant so I can understand the process, thank you.