Strange Earthing problem


I've got an H Bridge. Now, standalone, it works perfectly fine. It works by putting a direction into a NOT gate, then piping that logic into two and gates, and that into the mosfets.

The not gate changes the direction. If it's high, it goes one way, and if it's low, it goes the other. That works, if the only power input is from a single power supply, and ground/high is from that same power supply.

If I connect the ground of the computer (through the arduino usb cable) to the power supply ground, nothing bad happens (yet).

If I plug the not gate input into the arduino 5v, everything works perfectly, even PWM. However, once I plug it into the ground (earthed through the computer), an extremely large circuit draw occurs (think short circuit)

The power supply to the motor is in a seperate power supply running 12 volts.

I've checked - the ground on my circuit and the ground coming out of the USB has a 3.6V difference.

Any ideas? I need to communicate to the arduino to control the PWM duty cycle, so..

I trashed a friends USB scope measuring a differential output from an Arduino powered 1W power amp chip. Forgetting the scope ground was the same as the Arduino GND. Doh!

So you have my sympathies..

Can you draw us a diagram?

You will probably find that by the time you finish drawing it you will have worked it out.

Hm. I'll try to figure it out. For now, once I get back to my oscilloscope, i'll see if I can use a MAX3488 to act as a sort of "electronic barrier" between the two. RS485 uses differential voltages, so it ... should be fine.

I'll see about the diagram.

Are the computer and the 12V supply both connected to the same mains supply?