How to connect an n20 motor with encoder to tb6612fng and that to a Teensy 4.1
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Iaminvisible
- Posts: 3
- Joined: Thu Mar 16, 2023 9:03 pm
How to connect an n20 motor with encoder to tb6612fng and that to a Teensy 4.1
I bought a motor with an encoder recently and want to connect it to a tb6612fng motor driver and then the driver to the teensy. I am also wondering if I need to use the pwn pins as I don't need to control speed for my project. I can't find a diagram or tutorial online for it. Can someone please show me how to get it up and running?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: How to connect an n20 motor with encoder to tb6612fng and that to a Teensy 4.1
Please post specs for the motor you are using.
Assuming it is a brushed DC motor, it should have 2 wires for powering the motor. You can connect those to the
"MotorA" outputs of the TB6612. Do check the motor specs to verify that it is compatible with the TB6612.
Motor power goes to the VMotor and GND pins.
INA1 and INA2 pins will control the motor. Set one of them HIGH to turn in one direction. Set the other one HIGH to reverse. If you do not need speed control, you can use any GPIO pin on the Teensy.
The encoder wires would need to connect directly to the Teensy. PJRC has an encoder library for the Teensy with documentation here. here: https://www.pjrc.com/teensy/td_libs_Encoder.html
Assuming it is a brushed DC motor, it should have 2 wires for powering the motor. You can connect those to the
"MotorA" outputs of the TB6612. Do check the motor specs to verify that it is compatible with the TB6612.
Motor power goes to the VMotor and GND pins.
INA1 and INA2 pins will control the motor. Set one of them HIGH to turn in one direction. Set the other one HIGH to reverse. If you do not need speed control, you can use any GPIO pin on the Teensy.
The encoder wires would need to connect directly to the Teensy. PJRC has an encoder library for the Teensy with documentation here. here: https://www.pjrc.com/teensy/td_libs_Encoder.html
Please be positive and constructive with your questions and comments.