Using Arduino Micro with Motor shield -> motor direction problem

Hi,

I use Arduino Micro and genuine Motor shield board to run a small DC motor.
Micro is supplied via USB and motor shield uses its own external 12V power supply.
Only one DC motor is connected to Motor shield board -> Channel B

If I want to change the direction of the motor rotation I need to change levels of both DIR inputs, DIR A and DIR B, which seems wrong. I expected that each motor output channel only uses its dedicated DIR input - which can be either LOW (eg. FWD) or HIGH (e.g. REV).

Instead, I need to change both at the same time in order that I change rotation of the motor:
DIR A and DIR B -> [HIGH,LOW] or [LOW,HIGH]

Before I write and append more info and details, is anyone familiar with this problem?

Thank you for any answer

1 Like

It sounds like your unnamed "Motor shield board" uses an L298N or L293D. That's how they have always worked. Why do you think it's a problem?

Steve

I apologize, this is the motor shield I am using:

I would expect that since there are two motor channels, each motor uses only one DIR pin.
Otherwise, if two motors are connected and controled, how would I be able to change directions of both motors independently...

nacman:
I apologize, this is the motor shield I am using:
Arduino Motor Shield Rev3 — Arduino Official Store

I would expect that since there are two motor channels, each motor uses only one DIR pin.
Otherwise, if two motors are connected and controled, how would I be able to change directions of both motors independently...

I don't understand the question. There are two direction pins. Each pin is independent of the other. Why are you not able to make one pin high and one pin low?
Paul

Yes, there are two dir pins, each for its dedicated motor channel: DIR A and DIR B
E.g.: If I connect only motor to channel B and I use only DIR B input I cannot control direction of the motor.
So if I set pin DIR B to LOW it does not have any effect. Only if I use DIR B -> HIGH, motor rotates. If I would use DIR B -> LOW it should also rotate motor, just in another direction.

From my understanding of the schematic, only dedicated channel DIR pin is need to control a direction of said channel motor. You should not need two in combination.

nacman:
Yes, there are two dir pins, each for its dedicated motor channel: DIR A and DIR B
E.g.: If I connect only motor to channel B and I use only DIR B input I cannot control direction of the motor.
So if I set pin DIR B to LOW it does not have any effect. Only if I use DIR B -> HIGH, motor rotates. If I would use DIR B -> LOW it should also rotate motor, just in another direction.

From my understanding of the schematic, only dedicated channel DIR pin is need to control a direction of said channel motor. You should not need two in combination.

https://www.arduino.cc/en/uploads/Main/arduino_MotorShield_Rev3-schematic.pdf

The design uses an exclusive OR chip and what you are see happening is the correct conclusion. Apparently the old design was to control two motors driving wheels on two sides of a model vehicle. One motor turning one way the the opposite motor turning the other way.
An old Arduino thread also addresses the problem.
How you you wanting to use the motors?
Paul.

First of all, thank you very much for your answers and your time invested in this topic :slight_smile:

As I recall XNOR gates are used for each channel. Here is a topic that discuses the schematic symbol error for motor sheild: Schematic error in Motor Shield? - Installation & Troubleshooting - Arduino Forum

The IC used on a board is a 4077BT, which is a quad two input exclusive NOR gate IC. Which would prove the XNOR gate theory :slight_smile:

So, as far as I understand the work principle for one channel would be:

Truth table (as per XNOR gate):
DIR_B BRAKE_B DIR_B#
0 0 1
1 0 0
0 1 0
1 1 1

Meaning, since DIR_B and DIR_B# are used as direction control inputs of the B motor channel (inputs IN3 and IN4 of the L298), and if BRAKE_B signal is always low, this means that I should be able to change direction of the motors using only DIRB input of the shield.

I really believe this would make sense. With each channels DIR input you could control the direction of the motor rotation independently and separately....just like you do with the PWMA or PWMB input which control the PWM duty cycle of the each channel.

Let me know what you think...

Isn't the Micro a different footprint from that shield? Are you sure you have everything connected that it needs?

Just a thought because I've never used that shield and it seems really odd that it doesn't just bring out all the L298N connections.

Steve

I am not using shield in a standard fashion, so I am not piggy backing it :slight_smile:
I just made an necessary connections from Micro to shield...

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.