0

Controlling a stepper motor using adafruit trinket
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Controlling a stepper motor using adafruit trinket

by dvbaker on Mon Jul 15, 2019 5:01 pm

I'm new to robotics and recently purchased an adafruit trinket with hopes to control a 5v 2 stage 4 wire stepper motor. The project I'm working on calls for a very small controller for the motor which Is why I decided on the trinket. My question is, is it possible to program a set of repeated commands on the trinket for the motor? Thank you to everyone willing to reply!

dvbaker
 
Posts: 4
Joined: Mon Jul 15, 2019 4:51 pm

Re: Controlling a stepper motor using adafruit trinket

by adafruit_support_bill on Mon Jul 15, 2019 5:10 pm

The Trinket can't drive a motor directly. For a stepper motor, you need a dual H-bridge motor driver. To determine the driver requirements we'd first need to know the full electrical specifications for the motor.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Controlling a stepper motor using adafruit trinket

by dvbaker on Mon Jul 15, 2019 5:54 pm

Appreciate the quick response, the motor I ordered is a
NW High Torque 5V Dc 2 Phase 4 Wire Dia 15mm Stepper Motor With Micro Planetary Reducer With Bevel gear
(https://www.amazon.com/gp/product/B01IN ... UTF8&psc=1)

dvbaker
 
Posts: 4
Joined: Mon Jul 15, 2019 4:51 pm

Re: Controlling a stepper motor using adafruit trinket

by adafruit_support_bill on Mon Jul 15, 2019 6:18 pm

OK. That is compatible with several of our motor drivers.

Which version of the Trinket do you have?

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Controlling a stepper motor using adafruit trinket

by dvbaker on Mon Jul 15, 2019 6:23 pm

I have the 5v and 3.3v currently. So will the trinket will be used to set the commands for the motor controller?

dvbaker
 
Posts: 4
Joined: Mon Jul 15, 2019 4:51 pm

Re: Controlling a stepper motor using adafruit trinket

by adafruit_support_bill on Mon Jul 15, 2019 6:35 pm

Those Trinkets have very limited pins. There are 5 GPIO pins, but two serve double-duty for programming via USB, so you really have only 3 that you can use without restrictions.
https://learn.adafruit.com/introducing- ... o-pins-3-8

A plain dual H-bridge like the L293D, TB6612 or the DRV8833 need at least 4 pins for control. You could use them with a Trinket, but you may need to disconnect some of the wires in order to upload programs to the Trinket.
https://www.adafruit.com/product/807
https://www.adafruit.com/product/2448
https://www.adafruit.com/product/3297

One option is to use the motor/stepper wing. This uses a PCA9865 to control 2 of the TB6612 drivers - using just the SDA and SCL pins. It is made to plug directly into a Feather processor, but you can wire it to the Trinket via jumpers.
https://www.adafruit.com/product/2927

Another option would be to use one of the 2-pin step & direction drivers. These use 1 pin for direction control and another for the stepping. www.pololu.com carries a wide selection of step & direction controllers.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Controlling a stepper motor using adafruit trinket

by dvbaker on Thu Jul 18, 2019 5:08 pm

I ordered both the L293D, TB6612, and the featherwing.. I'm still pretty confused if I can do what I need to though. Can I program a set of instructions to the trinket to be relayed to the L293D and then to the stepper motor indefinitely?

dvbaker
 
Posts: 4
Joined: Mon Jul 15, 2019 4:51 pm

Re: Controlling a stepper motor using adafruit trinket

by adafruit_support_bill on Thu Jul 18, 2019 6:21 pm

Those motor drivers are simple H-bridge drivers. They do not have any local intelligence to execute instructions. You need to control their inputs step-by-step from the Trinket. You can use the Arduino Stepper library for that: https://www.arduino.cc/en/reference/stepper

With either of those drivers, you will need 4 pins to control it. As mentioned in my previous response, the Trinket has only 3 pins that can be used without restriction. You may need to disconnect a the 4th pin while uploading programs to it.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.