First I tried a small H-Bridge with 2.5 A to supply the DC motors with energy. But this type of motor driver was too small at that point the robot tried to turn on spot the motor driver burned out. Then I bought an upgrade for my Big Rob and now I am able to drive around and to turn on the spot without burning the motor driver. I searched for a motor driver with more than 10 A on each motor out. I found a motor driver with a total of 43 A and it could be controlled by a Raspberry Pi. I decided to buy two BTS7960B motor drivers because they are able to supply a total of 43 A which is more than enough for my four dc gear motors.
The picture below shows the two motor drivers and the Raspberry Pi wired and placed on a cardboard inside my Big Rob.
To make is easy for you to find the motor driver BTS7960B I used for my robot I added an Amazon online shop link.
Connecting the BTS7960B motor driver
You need six female-to-female jumper cables to connect the motor driver with the Raspberry Pi. Two cables are needed to supply the logic of the motor driver with 3.3V (VCC and GND). Two wires are needed to activate each H-Bridge with a high signal generated by the Raspberry Pi to set the spinning direction of the DC motor (R_EN / L_EN). The last two female-to-female jumper cables are needed feed the motor driver with a PWM signal to control the speed of DC motors (RPWM/LPWM).
The picture below shows the wiring of the motor driver.
BTS7960B Python program
I had to re-write my Python program I already developed to control some L298N H-Bridges to control the BTS7960B motor driver. That’s make it very easy for the Python control program to import the new BTS7960B Python program as an module and to control the motor driver without changing anything in the control program.
I uploaded the Python program with some inline documentation which describes which GPIO pins are used. This is important for wiring the motor driver.
download: Big Rob motor controller program L298NHBigrob.py
Build your own robot car with the Raspberry Pi!
Step by step to your own robot carThis book guides you in two parts through the project phases with the aim of building an individual, autonomously driving robot car. In the first part of the book you will learn the basics of robotics and the interaction of hardware, electricity and software. You build the chassis and wire the individual components - details can be found in the appropriate, richly illustrated chapters. An introduction to software installation and programming with Scratch and Python completes the first part. You do not need any previous knowledge in robotics and programming. In the second part of the book, you will familiarize yourself with the sensors required for autonomous driving. With the acquired knowledge you can individualize and further develop your robot car as you wish. The knowledge you acquire in this book will enable you to implement your own projects with the Raspberry Pi.
This book offers you that:
- Simply get into robotics with the Rasperberry Pi without prior knowledge
- Numerous illustrations, tables, circuit diagrams
- Information boxes with useful tips also for other Raspberry Pi projects
- Project code with syntax highlighting
- Two car projects: remote-controlled robot car via WLAN and self-driving car
- Hardware tips and recommendations for suitable accessories - Extensive project material as download: Raspbian image, parts list, chassis artwork and code
- Special features: Easy and robust cabling, use of high-precision time-of-flight laser distance measurement sensors, introduction to servo motors and suitable servo controllers, control via gamepad, use of an OLED display
Ingmar Stapel studied computer engineering and is currently working internationally as IT project manager and enterprise technical architect; in addition, he has been intensively involved with Raspberry Pi and robotics for years. He likes to share this knowledge with interested people from the tinkering scene at meet-ups on robotics. On his private blogs he also writes about many current technology trends.
BTS7960B Python program for PCA9685 servo controller
To control the BigRob robot I installed two BTS7960B motor drivers. Those motor drivers need four PWM signals to set the speed of the dc motors. The Raspberry Pi is very bad in generating a precise PWM signal. This is a problem of his architecture and could not be solved easy. The latest program version for my BigRob uses a PCA9685 servo controller to generate a precise PWM signal. Only the PWM pins which where connected to the Raspberry Pi are now hooked up to the servo controller. The pins for enabling the BTS7960B motor driver are still connected to the Raspberry Pi.
The latest version of the program is available on GitHub: Motor-Driver-BTS7960B-and-PCA9685
Summary
The wiring of the BTS7960B was strait forward and with all my experience in building robots very easy. The re-use of my already developed Python programs saved me a lot of time and after a few minutes I was able to driver around with the Big Rob and the new motor drivers. It is very cool to have a strong robot with a lot of torque to drive around.
Article list - Big Rob:
Big Rob – Raspberry Pi robotBig Rob – Raspberry Pi robot power train
Big Rob – Raspberry Pi robot motor driver BTS7960B and Python program
Big Rob – Raspberry Pi robot outdoor camera
Big Rob – Raspberry Pi robot with differential GPS
Big Rob – Raspberry Pi robot with nice teeth
Big Rob – Raspberry Pi robot Peak Power Pack power supply
Big Rob – Raspberry Pi robot videos
Thank you for this wonderful post.
I have couple of questions and will appreciate your answers and clarifications.
1. Woul dyou please share the schematic diagram of connections between raspberry pi and BTS7960B motor driver.
3. The picture of BIG ROB does not show how you have powered the motors, did you use 5V GPIO pin of raspberry to power the motors or used external battery.
2. In your python code you use ‘PCA9685_pwm = Adafruit_PCA9685.PCA9685()’ but in picture posted above there is no connection shown between raspberry pi and PCA9685 or motor driver and PCA8685, could you please share connection diagram for those as well.
Thank you and truly appreciate your help.
Sundeep