How to read PWM signal from a reversible motor?

I have a 5V motor with two wires going to a microcontroller. I assume it is sending a PWM signal directly to the motor. When the motor is in reverse the polarity switches on the two wires.

I want to read this pwm signal into an arduino so that I have a reading for the strength of the pwm signal and an idea of direction. My idea so far is to connect the wires coming from the controller to two of my arduino interrupt pins and try to digital read in an interrupt loop and determine the pwm signal and direction. I'm thinking this wont work because then there is no common ground, just two digital reads.

However if I give it a ground on the arduino and one interrupt pin that would be the positive end, and the polarity reverses to go backwards, wouldn't I read -5V and blow up my arduino?

Cheers

Bondolol:
I have a 5V motor with two wires going to a microcontroller. I assume it is sending a PWM signal directly to the motor. When the motor is in reverse the polarity switches on the two wires.

I want to read this pwm signal into an arduino so that I have a reading for the strength of the pwm signal and an idea of direction. My idea so far is to connect the wires coming from the controller to two of my arduino interrupt pins and try to digital read in an interrupt loop and determine the pwm signal and direction. I'm thinking this wont work because then there is no common ground, just two digital reads.

However if I give it a ground on the arduino and one interrupt pin that would be the positive end, and the polarity reverses to go backwards, wouldn't I read -5V and blow up my arduino?

Cheers

I have read you post several times and it makes absolutely no sense. Why are you making all the assumptions when you can easily test your device to see what is happening.

IF the Arduino is sending a PWM signal, And I say If with caution, the signal has no strength. it is a signal, voltage is 0 and then 5 and then 0, and so on.

Do a little more study on motors.

Paul

Can you post a picture of the device that the motor wires are connected to?

Motors on the right and left.

Bondolol:
Motors on the right and left.

What of?

Steve

Bondolol:
I have a 5V motor with two wires going to a microcontroller. I assume it is sending a PWM signal directly to the motor. When the motor is in reverse the polarity switches on the two wires.

I want to read this pwm signal into an arduino so that I have a reading for the strength of the pwm signal and an idea of direction.

Am I correct to think that the microcontroller that is connected to the motor is different from the Arduino?

And you would like the Arduino to monitor the power wires going to the motor?

Connecting an Arduino to motor power wires risks damaging the Arduino because motors can produce very high voltage spikes. Also, if the voltage reverses you need to make sure that the Arduino is protected from negative voltages.

If you provide a link to the datasheet or user manual for the device you want to monitor (or a good photo of it if there is no datasheet) someone may be able to suggest a better approach.

For example what is telling the microcontroller how fast (or what direction) the motor is to rotate?

...R

Bondolol:
I have a 5V motor with two wires going to a microcontroller. I assume it is sending a PWM signal directly to the motor. When the motor is in reverse the polarity switches on the two wires.

Sounds more like a DC tachogenerator, which outputs just a voltage.

I want to read this pwm signal into an arduino so that I have a reading for the strength of the pwm signal and an idea of direction. My idea so far is to connect the wires coming from the controller to two of my arduino interrupt pins and try to digital read in an interrupt loop and determine the pwm signal and direction. I'm thinking this wont work because then there is no common ground, just two digital reads.

However if I give it a ground on the arduino and one interrupt pin that would be the positive end, and the polarity reverses to go backwards, wouldn't I read -5V and blow up my arduino?

Cheers

For a tachogenerator you'd need a conditioning circuit to limit and centre the voltage and feed the two wires to two analog pins, read both and take the difference.