Basic h-bridge motor driver circuit for audio PWM waves with possible negative voltage

h-bridgepwmtransistors

I need to control a DC motor with the PWM audio waves coming out of the audio jack of a device. The device will send a positive PWM to drive the motor forward and a negative PWM signal for driving it backwards. The PWM signals can have an amplitude of 500mv max (positive or negative). I have a supply voltage of 5v also.

Can anyone please show me how to modify an H-Bridge or a similar circuit to make this work.

Best Answer

Your basic architecture is flawed. The circuit producing the audio output will high pass filter the signal somewhere in the path. Even in "HiFi" audio, 20 Hz can be attenuated 3 dB with gain dropping off arbitrarily below that.

The net result is that there is no DC information in the signal. There is therefore no positive and negavite PWM. The DC average of the signal will be 0. For example, a positive 70% duty cycle PWM will be indistinguishable from a negative PWM of 30% duty cycle.

You might be able to salvage some of this concept by using 50% duty cycle as the 0 level, with high duty cycles (more time spent high than low) meaning forward rotation and low duty cycles meaning backward rotation. Note that you can't use 100% or 0% duty cycle for full forward and full backward since both would look the same after DC is removed. You probably want to limit the PWM to the 5-95% range or thereabouts.

However, all this is a kludge. You mention the device producing this audio is a Android phone, so you have various other digital communication interfaces available. One way or another you want to get digital motor speed from the device, and have the microcontroller driving the H bridge produce the actual pulses. You could even pass digital information over the audio output.