Hi,
I am a electronic begginer and I would like to know is there is another solution to this problem:
I have to drive a dc motor with a NPN power transistor through a PWM signal from arduino.
Base is connected to arduino pwm output.
Emitter to ground (the same ground that arduino)
Collector to Negative of dc motor
And positive of dc motor to Vcc 5v
Problem: I need to measure the average voltage between Negative and Positive of DC Motor using a typical 3 wires digital voltmeter from Aliexpress, like the image attached.
Case 1: If I connect negative terminal of this voltmeter to negative common ground, positive to Vcc and yellow wire to positive DC motor I measure always 5v, because positive DC motor is connected to Vcc.
Case 2: If I connect negative terminal of this voltmeter to negative dc motor, positive to Vcc and yellow wire to positive DC motor I can measure the "correct" average supposed voltage but the problem is that this voltmeter needs 5 volts to work properly, under 5v the display blinks and shutoff randomly and until the PWM duty cycle isn't 100% the voltmeter is blinking.
Case 3: If I connect negative terminal of this voltmeter to negative common ground, positive to Vcc and yellow wire to negative DC motor the voltmeter does not blink (always is feeded with 5v) and I can measure a voltage but it's like inverted. When duty cycle increase the speed of the motor increase but this voltage decrease.
I have found this solution: in Case 3 I could attach, after the NPN, one PNP with emitter to Vcc, collector to positive Motor and base to NPN collector output, and negative motor to common ground.
This solution works, I can read the average voltage tapping the yellow wire in positive DC motor terminal, but I would like to know if there is another way to do that without using any PNP transistor and without modify source code.
Thank you.

