It's not a sensor. You have an issue with your battery or a ground. Try wiggling the battery cables with the headlights turned on and see if you can make them turn on by wiggling it.