signal conditioning 0 to (-40) volt to 0-5 volt, arduino
You can use an opamp to perform the translation if you like.

But there's an easier way : using 2 resistors you can both attenuate and level shift at the same time. I have chosen values that give a 10:1 attenuation and an 0.5V unused range at each end of the scale - scaling to the correct values is simple in software.







simulate this circuit &ndash; Schematic created using CircuitLab