Measure Voltage from PWM output


I’m on progress to make variable voltage using PWM.
I was success to make variable voltage with adjusting duty cycle to mosfet.
The problem is I want to know the voltage via Analogue pin produced by PWM using voltage divider and LC filter (I use voltage divider because the source (VIN) is 8.4 volt.
I’m only success to read the voltage using DMM or oscilloscope by connectiong the + DMM to LOAD + pin and - DMM to - LOAD pin.

Please see the attachment and my question where I should connecting the voltage divider and LC filter to reading the voltage using Arduino analogue pin?
because the Arduino GND is connected to source mosfet, not to drain.

I know is easy to use High side switching using P channel Mosfet, but are available solution with using Low Side N mosfet switching?



Connect to the MOSFET drain. The (average) voltage across the load is 8.4V minus your analog reading.

i.e. When the MOSFET is fully-on, the drain will be at (nearly) ground potential with the full 8.4V across the load.

When the MOSFET is off, 8.4V will appear at the drain with zero volts across the load. (This assumes there is a load to pull-up the drain when the MOSFET is off.)

i was try connecting to Drain mosfet, when mosfet is on the voltage is 0v. And when the mosfet off the voltage measured is 8.4v. Is not correct right?

Because when I try to connect DMM or oscilloscope, the reading os correct (connecting + dmm to + load and - dmm to - load / drain)