You can turn off auto-brightness on your iPhone with a few taps, and manually change the phone's brightness in two ways. Here ...
If your iPhone's sensors aren't working correctly, you may need to calibrate them. Here's how to calibrate an iPhone's brightness and motion sensors.