# Voltage divider with MOSFETS

I designed an voltage divider and I have a problem (misunderstanding) when turning ON one of the transistors

For Q2, I realise that the GND is in the others drain pin transistors (Q4, Q5).

Other problem is the input voltage can be up to 48V, and i want to measure it with an microcontroller, so when all the transistors are off the voltage at the ADC pin will be 48V.

Add a zener diode from AIN0 to ground, with its anode connected to ground. Select the zener voltage so that it is less than the maximum allowable voltage at AIN0. The zener will clamp the input voltage when none of your transistors is conducting and prevent damage to the microcontroller.