Skip to content

TinyLily Motor Controller Tutorial

The TinyLily Motor Board allows a single DC brushed motor to be driven for your next TinyLily project! This board is only 10 mm in diameter, including the sewtabs on the board, making this a great product for keeping wearable tech tiny and concealed.

You can even wash this board!

This tutorial will outline two different projects. The first one will be how to use just the motor board without any programming. The second project will outline how you can use the TinyLily Mini Processor to use the TinyLily Motor Controller to operate a motor in a more dynamic way.


Description

When TI came out with the world’s smallest DC motor driver chip, we knew we had to build a board around it. Based around the 2mm x 2mm TI DRV8837 Motor Driver (H-Bridge) IC, this board is incredibly tiny at only 10mm in diameter, yet can drive a 5V 500mA motor!  (Note: Although the DRV8837 is rated at 11V at 1.8Amps, with the small size and small heatsinking, we do not recommend exceeding 5V at 500mA). 

The DRV8837 is extremely easy to use and interface to your favorite processor board (such as a TinyDuino, TinyLily or a standard Arduino), and uses a simple PWM to control motor speed, direction, coasting and braking. The board includes a bypass capacitors and all the I/O of the DRV8837 brought out to sewtabs, as well as heatsinking the chip to a large plane on the bottom side of the board to help with heat dissipation.

The TI DRV8837 has one H-bridge driver consisting of N-channel power MOSFETs to drive a DC motor or one winding of a stepper motor, or other devices like solenoids. An internal charge pump generates needed gate-drive voltages. There are internal shutdown functions for overcurrent protection, short-circuit protection, undervoltage lockout and over temperature. The DRV8837 can supply up to 1.8 A of output current. It operates on a motor power-supply voltage from 1.8 V to 11 V, and a device power-supply voltage of 1.8 V to 7 V. There is also a extremely low power sleep mode with 120nA sleep current.

Pinout Description
Board Label Function Description
VM Motor Voltage Input This supplies the voltage to the motor and can range from 1.8 to 11 Volts.

High Current Connection

GND Ground Connection This is the Ground return and needs to connect to the Ground for both the VM supply and the VCC supply.

High Current Connection

VCC Logic Voltage Input This is the logic voltage input, and needs to be the same voltage as the system driving the motor controller (like the TinyLily Mini or a standard Arduino).

This will be 3 to 5 Volts if connected to an Arduino based systems (like the TinyLily Mini or the TinyDuino), although the full possible voltage range is from 1.8 to 7 Volts

SLP Sleep Input This signal can put the motor controller into a low-power “Sleep Mode”.

A logic-low “0″ will put the motor controller into sleep mode, a logic-high “1″ will put the motor controller into normal operating mode. If sleep mode is not needed, connect SLP to VCC to allow normal operation.

NOTE: This must be connected in order for the motor controller to work.

IN1 Input 1 This signal controls the Output 1 driver. A logic-low “0″ will set Output 1 to low, a logic-high “1″ will set Output 1 to high. If left unconnected, this signal is pulled down to a low-logic “0″ with an internal resistor

For motor speed control, we recommend using this as the motor speed control signal (Using a PWM signal), and IN2 as the motor direction signal.

IN2 Input 2 This signal controls the Output 2 driver. A logic-low “0″ will set Output 2 to low, a logic-high “1″ will set Output 2 to high. If left unconnected, this signal is pulled down to a low-logic “0″ with an internal resistor

For motor speed control, we recommend using this as the direction speed control signal, and IN1 as the motor speed control signal.

O1 Output 1 This is the Output 1 driver and connects to on side of the motor winding

High Current Connection

O2 Output 2 This is the Output2 driver and connects to on side of the motor winding

High Current Connection

Technical Details
  • Washable
  • Eight Sewtabs – 1.2mm in diameter, easy to use with standard conductive thread and needles
  • Robust Gold Finish – makes soldering easy and is non-corrosive

    TI DRV8837 H-bridge Motor Driver Specs

    • Low MOSFET On-Resistance: HS + LS 280mOhm
    • 1.8A Max Drive Current
    • 1.8V to 11V Motor Operating Supply Voltage Range
    • Seperate Motor and Logic Power Supply Pins
    • PWM (IN/IN) Interface
    • Dedicated Sleep Pin

    Pins Used

    • VM - Motor Voltage Input:  This supplies the voltage to the motor and can range from 1.8 to 11 Volts (high current connection)
    • GND - Ground: This is the Ground return and needs to connect to the Ground for both the VM supply and the VCC supply (high current connection)
    • VCC - Logic Voltage Input: This is the logic voltage input, and needs to be the same voltage as the system driving the motor controller (like the TinyLily Mini or a standard Arduino).  This will be 3 to 5 Volts if connected to an Arduino based systems (like the TinyLily Mini or the TinyDuino), although the full possible voltage range is from 1.8 to 7 Volts.
    • SLP - Sleep Input: This signal can put the motor controller into a low-power “Sleep Mode”.  A logic-low “0″ will put the motor controller into sleep mode, a logic-high “1″ will put the motor controller into normal operating mode. If sleep mode is not needed, connect SLP to VCC to allow normal operation. NOTE: This must be connected in order for the motor controller to work
    • IN1 - Input 1: This signal controls the Output 1 driver. A logic-low “0″ will set Output 1 to low, a logic-high “1″ will set Output 1 to high. If left unconnected, this signal is pulled down to a low-logic “0″ with an internal resistor.
    • IN2 - Input 2: This signal controls the Output 2 driver. A logic-low “0″ will set Output 2 to low, a logic-high “1″ will set Output 2 to high. If left unconnected, this signal is pulled down to a low-logic “0″ with an internal resistor.
    • O1 - Output 1: This is the Output 1 driver and connects to on2 side of the motor winding (high current connection.
    • O2 - Output 2: This is the Output 2 driver and connects to on2 side of the motor winding (high current connection.
    Dimensions
      • Dimensions: 10mm diameter (0.394 inches)
      • Max Height: 1.41mm (0.056 inches)
      • Ultra-thin 0.61mm (0.024 inches) PCB
      • Weight: .13 grams (0.0046 ounces)

      Notes

      • Even though the motor driver can support 11V at 1.8Amps, we do not recommend using more than a 5V motor at 500mA due to the small size.  
      • Be sure that your power supply is sufficient to operate these motors as well as your logic – batteries are the best. If you are running both the motors and the logic off of one power supply, we recommend avoid using a switching power supply as the transients caused can potentially damage items connected to the logic side.
      • Although conductive thread can be used for all the connections, for the motor and power connections it is highly recommended to use normal copper wire soldered into these connections due to the power levels involved. If conductive thread is used for these connections, keep these thread lengths as short as possible.

      Materials

      Hardware

      For both projects you will need:

      Additional materials for Project 1:

      Additional materials for Project 2:

      Software


      Project 1: No Programming

      This project will use a switch to turn the motors on at full blast. To build this project, you need to make the connections shown below.

      For more information on the different Pin functionality on this board, please refer to the Pinout Description drop-down table above under Description.

      Project 1 Diagram

      • TinyLily Motor Controller VCC -- VM -- SLP -- One sew tab of TinyLily Switch -- Positive terminal of power source
      • TinyLily Motor Controller GND -- Negative terminal of power source
      • TinyLily Motor Controller IN1 -- Other sew tab of TinyLily Switch
      • TinyLily Motor Controller O1 -- One terminal of motor
      • TinyLily Motor Controller O2 -- Other terminal of motor (polarity should not matter in this scenario)

      After these connections are made, pressing the switch should turn the motor on.

      CAUTION: Make sure the power needs of your motor are met by the power source you have selected. (If you do not supply the minimum necessary voltage to a motor, it will not work!)


      Project 2: Programming with TinyLily Mini Processor

      Project 1 outlines how to supply all available voltage to the motors in order to put the motor at max speed. This Project will use the TinyLily Mini Processor to control the motors at specific speeds and directions.

      Make the intial connections for the project using the following diagram:

      Project 2 Diagram

      • TinyLily Motor Controller VCC -- VM -- SLP -- Positive terminal of power source -- Positive terminal of TinyLily Mini Processor
      • TinyLily Motor Controller GND -- Negative terminal of power source -- Negative terminal of TinyLily Mini Processor
      • TinyLily Motor Controller IN1 -- TinyLily Mini Processor Pin 3
      • TinyLily Motor Controller IN2 -- TinyLily Mini Processor Pin 2
      • TinyLily Motor Controller O1 -- One terminal of motor
      • TinyLily Motor Controller O2 -- Other terminal of motor (polarity should not matter in this scenario)

      You only need to make the Power (+) and Ground (-) connections to one set of terminals on the TinyLily Mini Processor

      You do not have to use the exact pins (2 and 3) that we used. You can use pins 0-3, just be sure that any changes made in the hardware connections are reflected in the Arduino sketch.


      Upload Program

      Speaking of the Arduino Sketch, make sure you have the Arduino IDE downloaded. If you do not, make sure to review the TinyLily Mini Processor Getting Started Tutorial before continuing.

      Download the .zip file included under Materials\Software for the Arduino sketch and open it in the IDE. Make the proper Tools selections based on the TinyLily:

      • Board: "Arduino Pro or Pro Mini"
      • Processor: "ATmega328p (3.3V, 8MHz)"
      • Port: "COM##" - this is the port connected to the TinyLily via the MicroUSB cable

      Then upload the program to the board.

      If all the hardware connections are correct, the motor should begin moving in the forward direction ramping the speed up, and then down. The motor will then ramp the speed up, and down in the reverse direction.


      What's next?

      Find a motor you love, and feature it in your next wearable project!

      You can finally build one of those hats.


      Downloads


      Contact Us

      If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

      Thanks for making with us!