I am trying to build a 0-42v Voltage measuring circuit that outputs to a 5v Micro! Failing badly
Based on the limited description you have given, there is no reason why this shouldn't work:







simulate this circuit &ndash; Schematic created using CircuitLab

A few things going on here:


The voltage divider tones the voltage down to the appropriate level, dividing by about ~8.4 V/V 
The zener diode clamps the voltage at 5.1V if your 42V somehow ends up being higher
The capacitor provides anti-aliasing / minor noise filtering for whatever ADC you are reading this into.


Enjoy :)