|
TB6612FNG(O,C,8,ELToshiba
|
x 1 | |
|
227CKS035MIllinois Capacitor
|
x 1 | |
|
741C083510JPCTS Resistor Products
|
x 1 | |
|
Y1624350R000T9RVishay Foil Resistors (Division of Vishay Precision Group)
|
x 1 | |
|
Header Male |
x 1 |
|
arduino IDEArduino
|
TB6612FNG Motor Driver
The TB6612FNG Motor Driver can control up to two DC motors at a constant current of 1.2A (3.2A peak). Two input signals (IN1 and IN2) can be used to control the motor in one of four function modes: CW, CCW, short-brake and stop. The two motor outputs (A and B) can be separately controlled, and the speed of each motor is controlled via a PWM input signal with a frequency up to 100kHz. The STBY pin should be pulled high to take the motor out of standby mode.
Logic supply voltage (VCC) can be in the range of 2.7--5.5VDC, while the motor supply (VM) is limited to a maximum voltage of 15VDC. The output current is rated up to 1.2A per channel (or up to 3.2A for a short, single pulse).
This little board comes with all components installed as shown. Decoupling capacitors are included on both supply lines. All pins of the TB6612FNG are broken out to two 0.1" pitch headers; the pins are arranged such that input pins are on one side and output pins are on the other.
The TB6612 Motor Driver Module uses TB6612FNG as the driver chip which has large current (1.2A continuous current) and two-channel output in a MOSFET-H bridge structure, and can drive two motors. The motor voltage and the working voltage of the module are separated - VCC for the module: 2.7 V to 5.5 V, and VM for the motor: 15V (Max). But the optimum working voltage of the motor is 2.5V-13.5V, and it cannot work when the voltage is lower than 2.5V.
It’s easy to control since you can control the forward and reverse rotation of the two servos by setting the values MA and MB as high or low level, and PWMA and PWMB are to control the rotational speed of the motor; thus, only 4 I/O pins would be occupied. The anti-reverse ports for motor connection and signal input can be plugged firmly and conveniently. With low-voltage detection and thermal shutdown inside the chip to protect the circuit, you don’t need to worry about ruining your project or damaging the main control board.
Features
> Uses the TB6612FNG motor driver chip with a maximum output current of 1.2A.
> Firm and convenient wiring, with anti-reverse port for both motor connection and signal input.
> Simple control: control two motors simultaneously - MA and MB for direction of the motor, and PWMA and PWMB for rotational speed.
> Dual power supply. VCC for the module: 2.7-5.5 V, VM for the motor: 15V (Max).
> Small and lightweight, with 3mm mounting holes, suitable for smart cars.
> Built-in thermal shutdown circuit and low-voltage detection.
> Size: 42 x 32 mm
Experimental Test
I Drive 2 motors with Arduino
Drive 2 motors to speed up and slow down.
Components
-1 x TB6612 Motor Driver
-1 x Arduino Uno
-1 x Motor
-1 x 18650 Battery Holder
-2 x 18650 Li-on Batteries
-Several jump wires
Step 1. Install the library
Open the Arduino software, and select Sketch -> Include Library ->Add .ZIP Library.
Choose the downloaded zip file and open it.SunFounder_TB6612.zip
Step 2. Open the Example
Open File -> Examples –> Sunfounder TB6612 Motor Driver -> motor, then upload this example
Step 3. Wiring
Connect the independent power supply to the module as shown below:
Independent Power SupplyTB6612 Motor DriverVCCVMGNDGND
Connect the Arduino UNO to the module:
Arduino UNOTB6612 Motor Driver5VVCCGNDGND5MA6PWMA9MB10PWMB
Connect the motor to the module:
MotorTB6612 Motor DriverBlack wireA1Red wireA2Black wireB1Red wireB2
Here is how the wiring looks like:
After the example is uploaded, the motor will speed up to rotate and slow down in forward direction, then repeat in the reverse direction.
You can open the Serial Monitor to see the change of the output PWM value - various from small to larger, and then larger to small.
There is a positive correlation between the rotational speed of the motor and the PWM value.
II Control 2 motors with Raspberry pi
Step 1. Wiring
Since the motor will use large amount of power, you need to provide this module with an independent power supply so as to ensure the servo will have adequate supply.
Connect the independent power supply to the module as shown below:
Independent Power SupplyTB6612 Motor DriverVCCVMGNDGND
Connect the Raspberry pi to the module:
Raspberry PiTB6612 Motor Driver3.3VVCCGNDGNDGPIO17MAGPIO27PWMAGPIO18MBGPIO22PWMB
Connect the motor to the module:
MotorTB6612 Motor DriverBlack wireA1Red wireA2Black wireB1Red wireB2
Pins of Raspberry Pi:
Connect the servo to the module:
MotorTB6612 Motor DriverBlack wireA1Red wireA2black wireB1Red wireB2
Step 2. Establish your project:
Log into the Raspberry Pi via ssh, and copy the TB6612 repository from Github:
git clone https://github.com/sunfounder/SunFounder_TB6612.git
After copying, you will have the package of the TB6612 in Python. Import it into the Python program, and you can use it then.
Here is a simple example:
1. Create a new file:
mkdir test_TB6612/
2. Copy the package to the file:
cd test_TB6612
cp –r /home/pi/SunFounder_TB6612 ./
3. Create a code file
touch test_motor.py
Here the file structure of your program is like this:
test_TB6612/
With this structure, you can import the Python file successfully.
Next, let’s see how to control the motors.
Step 3. Code to Drive the motors
nano test_motor.py
Type in the following code:
#!/usr/bin/env python
import time
from SunFounder_TB6612 import TB6612
import RPi.GPIO as GPIO
def main():
import time
print "********************************************"
print "* *"
print "* SunFounder TB6612 *"
print "* *"
print "* Connect MA to BCM17 *"
print "* Connect MB to BCM18 *"
print "* Connect PWMA to BCM27 *"
print "* Connect PWMB to BCM22 *"
print "* *"
print "********************************************"
GPIO.setmode(GPIO.BCM)
GPIO.setup((27, 22), GPIO.OUT)
a = GPIO.PWM(27, 60)
b = GPIO.PWM(22, 60)
a.start(0)
b.start(0)
def a_speed(value):
a.ChangeDutyCycle(value)
def b_speed(value):
b.ChangeDutyCycle(value)
motorA = TB6612.Motor(17)
motorB = TB6612.Motor(18)
motorA.debug = True
motorB.debug = True
motorA.pwm = a_speed
motorB.pwm = b_speed
delay = 0.05
motorA.forward()
for i in range(0, 101):
motorA.speed = i
time.sleep(delay)
for i in range(100, -1, -1):
motorA.speed = i
time.sleep(delay)
motorA.backward()
for i in range(0, 101):
motorA.speed = i
time.sleep(delay)
for i in range(100, -1, -1):
motorA.speed = i
time.sleep(delay)
motorB.forward()
for i in range(0, 101):
motorB.speed = i
time.sleep(delay)
for i in range(100, -1, -1):
motorB.speed = i
time.sleep(delay)
motorB.backward()
for i in range(0, 101):
motorB.speed = i
time.sleep(delay)
for i in range(100, -1, -1):
motorB.speed = i
time.sleep(delay)
def destroy():
motorA.stop()
motorB.stop()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
destroy()
Press Ctrl+X to exit, you will be prompted to save the changes, enter Y (save) or N (not saved), and then press the Enter key to exit.
Enter the command to run the example:
python test_motor.py
We will still see the motor speeding up to rotate and slowing down in forward direction, then repeating in the reverse direction, same as shown previously.
Attachment
Datasheet
SunFounder_TB6612.zip
TB6612FNG Motor Driver
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Sreeram.zeno
- Esp12-F Cluster V1.0 The ESP8266 is a low-cost Wi-Fi microchip, with built-in TCP/IP networking software, and microcontro...
- TB6612FNG Motor Driver The TB6612FNG Motor Driver can control up to two DC motors at a constant current of 1.2A (3.2A peak)...
- Sunny Buddy Solar Charger v1.0 This is the Sunny Buddy, a maximum power point tracking (MPPT) solar charger for single-cell LiPo ba...
- Diy 74HC4051 8 Channel Mux Breakout Pcb The 74HC4051; 74HCT4051 is a single-pole octal-throw analog switch (SP8T) suitable for use in analog...
- Diy RFM97CW Breakout Pcb IntroductionLoRa? (standing for Long Range) is a LPWAN technology, characterized by a long range ass...
- ProMicro-RP2040 Pcb The RP2040 is a 32-bit dual ARM Cortex-M0+ microcontroller integrated circuit by Raspberry Pi Founda...
- Serial Basic CH340G Pcb A USB adapter is a type of protocol converter that is used for converting USB data signals to and fr...
- Mp3 Shield For Arduino Hardware OverviewThe centerpiece of the MP3 Player Shield is a VS1053B Audio Codec IC. The VS1053B i...
- MRK CAN Shield Arduino The CAN-BUS Shield provides your Arduino or Redboard with CAN-BUS capabilities and allows you to hac...
- AVR ISP Programmer AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology ...
- Diy Arduino mega Pcb The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/ou...
- Max3232 Breakout Board MAX3232 IC is extensively used for serial communication in between Microcontroller and a computer fo...
- Line Follower Pcb The Line Follower Array is a long board consisting of eight IR sensors that have been configured to ...
- HMC6343 Accelerometer Module The HMC6343 is a solid-state compass module with tilt compensation from Honeywell. The HMC6343 has t...
- RTK2 GPS Module For Arduino USBThe USB C connector makes it easy to connect the ZED-F9P to u-center for configuration and quick ...
- Arduino Explora Pcb The Arduino Esplora is a microcontroller board derived from the Arduino Leonardo. The Esplora differ...
- Diy Stepper Motor Easy Driver A motor controller is a device or group of devices that can coordinate in a predetermined manner the...
- Diy Arduino Pro Mini The Arduino Pro Mini is a microcontroller board based on the ATmega168 . It has 14 digital input/out...
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
116 0 0 -
DIY Laser Power Meter with Arduino
165 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
156 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
569 0 3