How to Stop Dell Latitude E5540 Automatic Brightness adjustment
There are two potential solutions to this, depending on what is actually causing the problem.
The first solution is to disable the ambient light sensor (ALS) in case your system has one, this can be done in the control panel, but it's faster to just type "sensor" in the start menu's search bar and it should bring up the corresponding control panel in the results; then just uncheck the "Light sensor" and apply.
The second solution is to disable Intel's bullshit power-saving function (annoying and utterly useless) : right-click on your desktop and click on "Graphic properties", this will bring up Intel driver's control panel. In the Power tab, click "Power features" (or similar), then on the left select "On battery" and finally uncheck the only option that's listed, something along the lines of "Screen power saving technology".
The screenshots are in French but the item's locations are the same so you shouldn't have too much trouble finding your way.