1
\$\begingroup\$

The board has two PWM inputs, see:

enter image description here

Do I have to use four pins to control two motors? Thanks

\$\endgroup\$

4 Answers 4

1
\$\begingroup\$

This board is to control ONE motor, it seems to have two BTS7960 half-bridges forming full bridge. Each of half-bridges must be controlled accordingly, using four pins. How? There is a Google for this, see this instructables for example. Here is the standard application circuit for the typical board, from BTS7960 datasheet:

enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ Thanks, I Known that one board one motor, I just wonder if it is a must to use 4 PWM pins to control two boards? any solution to use less pins? or how can use one Arduino to control a two motors toy car? not enough PWM pins. \$\endgroup\$
    – oldbin
    Commented Apr 4, 2019 at 17:39
  • \$\begingroup\$ @oldbin, technically you need only one PWM pin to control the bridge if you make some external switch between left arm and right. Maximum 2 PWM. The other signals are regular GPIO to change directions, braking, etc. The IS pins are sensor outputs, so you don't need any other PWMs. \$\endgroup\$ Commented Apr 4, 2019 at 17:50
  • \$\begingroup\$ @ Ale..chenski, thank you. I tested the board, it can only run with RPWM+L_EN(HIGH)+R_EN(HIGH) forward, and LPWM+L_EN(HIGH)+R_EN(HIGH) backward. maybe I did some thing wrong? \$\endgroup\$
    – oldbin
    Commented Apr 4, 2019 at 17:56
  • \$\begingroup\$ @oldbin, so you are using two PWM pins, per motor/per board. I believe that RPWM and LPWM never work at the same time. If so, you can use a logic-level IC - tiny decoder like SN74LVC1G19 to split one PWM output to LPWM and RPWM, but you will need another GPIO to select the signal path. \$\endgroup\$ Commented Apr 4, 2019 at 18:21
  • \$\begingroup\$ @oldbin, the other answer for control assume that when PWM is not active, its state is "LOW". When making the demultiplexor, you need to ensure the "LOW" state on inactive channel. Maybe 1G18 will work better for you. \$\endgroup\$ Commented Apr 4, 2019 at 18:36
2
\$\begingroup\$

DIR signals, should go to R_PWM & L_PMW. AND PWM should go to both L_EN, R_EN. You can check it, it works )

\$\endgroup\$
0
\$\begingroup\$

The board controls a single motor.

Pins 1 & 2 - Power for the motor

Pins 3 & 4 - Direct connections to the motor

A - Ground for the 5 V controller

B - 5 V for the controller

C & D - Overcurrent indicators

E & F - Reverse and Forward enables (can tie both to B, if desired)

G & H - PWM controls

To drive motor in reverse, put a pulse train (up to 25 kHz) on pin E.

To drive motor forward, put a pulse train up (up to 25 kHz) on pin F.

\$\endgroup\$
0
\$\begingroup\$

You can only control one motor with this board.

enter image description here

You connect your motor in the M+ and M+ connectors (The letters are written in the bottom layer of the board near the correspondent green connectors)

The battery is connected in the B+ and B- connectors (The letters are also present in the botton layer of the board).

The RPWM pin is used to rotate the motor in one direction using a PWM signal

The LPWM pin is used to rotate the motor in the opposite direction of the RPWM pin also with a PWM signal.

The R_REN When is at 5V (HIGH) is used to activate the RPWM pin.

The L_REN When is at 5V (HIGH) is used to activate the LPWM pin.

The maximum voltage for the RPWM,LPWM R_EN and L_EN pins is 5V.

With a 12V motor you only need the 4 pins listed above to control a motor with this board.

You don't need to connect the VCC pin to 5V when You use a 12V battery in B+ and B-. For battery values below 12V i'm not sure.

The GND pin is wired to B-.

The R_IS and L_IS are used for current sensing. No need to use them in simple projects.

You can control this board with an Arduino and may good idea to isolate the control pins of the Arduino with Optocouplers.

\$\endgroup\$
6
  • \$\begingroup\$ Thanks, the testing shown that, either PWM pin works only when the both R_EN and L_EN pins put HIGH, is this normal? \$\endgroup\$
    – oldbin
    Commented Apr 4, 2019 at 12:20
  • \$\begingroup\$ Yes its normal. \$\endgroup\$
    – AmssmA
    Commented Apr 4, 2019 at 12:58
  • \$\begingroup\$ That means the direction is controlled by R_PWM /L_PWM, not by R_EN / L_EN? \$\endgroup\$
    – oldbin
    Commented Apr 4, 2019 at 14:02
  • \$\begingroup\$ Please read the my answer above. \$\endgroup\$
    – AmssmA
    Commented Apr 4, 2019 at 16:00
  • \$\begingroup\$ Thank you AmeemA, I have read your answer, the thing made me confused is my test shown that R_REN & L_REN both need be 'HIGH' to run the motor even only one direction say R_PWM. \$\endgroup\$
    – oldbin
    Commented Apr 4, 2019 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.