Using the TinyLily Motor Board

by TinyCircuits Staff March 03, 2016

Using the TinyLily Motor Board

Overview:

The TinyLily Motor Board lets a single DC brushed motor be driven from your projects. At only 10mm in diameter, is extremely small and includes sewtabs to allow it to be sewn into clothing.

Note: 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.

WARNING: 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.


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

 


Example One: Simple Motor On/Off Control with a Switch

In this simple example, we use the TinyLily Switch to turn on and off the motor. There is no direction or speed control, and we actually don't need a processor either - all that's needed is the TinyLily Motor Board, a TinyLily Switch, a motor, three AAA batteries(and a battery holder) and wire or conductive thread.

For our battery, we’ll be using three AAA alkaline batteries (which will give us an operating voltage range of 3 – 4.5 Volts). The batteries will supply the voltage to both the motor power supply (VM) and the logic power supply (VCC).

Build the circuit

Step 1: Add a wire (or thread) between the GND sewtab on the TinyLily Motor Board and the Ground connection on the battery holder.
    Step 2: Add a wire (or thread) between the VM sewtab on the TinyLily Motor Board and the positive connection on the battery holder.
      Step 3: Add a wire (or thread) between the VM sewtab on the TinyLily Motor Board and the VCC sewtab on the TinyLily Motor Board. This will connect the VM and VCC power supplies together.
        Step 4: Add a wire (or thread) between the VM sewtab on the TinyLily Motor Board and the SLP sewtab on the TinyLily Motor Board. This will put the motor controller into normal operation mode.
          Step 5: Add a wire (or thread) between the VM sewtab on the TinyLily Motor Board and one side of the TinyLily switch.
            Step 6: Add a wire (or thread) between the IN1 sewtab on the TinyLily Motor Board and the unconnected side of the TinyLily switch.
              Step 7: Add a wire (or thread) between the O1 sewtab on the TinyLily Motor Board and one of the motor terminals.
                Step 8: Add a wire (or thread) between the O2 sewtab on the TinyLily Motor Board and the unconnected motor terminal.
                  Step 9: Put the batteries into the holder.

                  Run the circuit: Now press the button, the motor will turn on in one direction full blast. When you release the button, it should power off.

                   


                  Example Two: Motor Control with Speed and Direction

                  In this example, we use the TinyLily Mini processor board to control the motor direction and speed. All that's needed is the TinyLily Motor Board, a TinyLily Mini Processor, a motor, three AAA batteries(and a battery holder) and wire or conductive thread.

                  For our battery, we’ll be using three AAA alkaline batteries (which will give us an operating voltage range of 3 – 4.5 Volts). The batteries will supply the voltage to both the motor power supply (VM) and the logic power supply (VCC).

                  In this set up, the TinyLily Mini processor will be able to control the motor speed on digital pin #3 by using the Arduino analogWrite() command. This will send a PWM signal to the IN1 signal on the motor controller for the speed control. Direction is controlled by digital pin #2 on the Arduino and is connected to IN2 on the motor controller.

                  Build the circuit

                  Step 1: Add a wire (or thread) between the GND sewtab on the TinyLily Motor Board and the Ground connection on the battery holder.
                    Step 2: Add a wire (or thread) between the VM sewtab on the TinyLily Motor Board and the positive connection on the battery holder.
                      Step 3: Add a wire (or thread) between the VM sewtab on the TinyLily Motor Board and the VCC sewtab on the TinyLily Motor Board. This will connect the VM and VCC power supplies together.
                        Step 4: Add a wire (or thread) between the VCC sewtab on the TinyLily Motor Board and one of the ‘+’connections on TinyLily Mini Processor Board
                          Step 5: Add a wire (or thread) between the GND sewtab on the TinyLily Motor Board and one of the ‘-’ connections on the TinyLily Mini Processor Board
                            Step 6: Add a wire (or thread) between the VM sewtab on the TinyLily Motor Board and the SLP sewtab on the TinyLily Motor Board. This will put the motor controller into normal operation mode.
                              Step 7: Add a wire (or thread) between the IN1 sewtab on the TinyLily Motor Board and the ’3′ sewtab on the TinyLily Mini Processor Board.
                                Step 8: Add a wire (or thread) between the IN2 sewtab on the TinyLily Motor Board and the ’2′ sewtab on the TinyLily Mini Processor Board.
                                  Step 9: Add a wire (or thread) between the O1 sewtab on the TinyLily Motor Board and one of the motor terminals.
                                    Step 10: Add a wire (or thread) between the O2 sewtab on the TinyLily Motor Board and the unconnected motor terminal.

                                      Step 11: Put the batteries into the holder.


                                      Run the circuit: This example shown below will cause the motor to ramp up speed, then ramp down speed, and change direction.

                                       

                                      NOTE: When in the forward direction, the slowest speed is set with an analogWrite value of 0 and a max speed with a value of 255, when in the reverse direction, the slowest speed is set with an analogWrite value of 255 and the max speed with a value of 0.

                                      
                                      int motorDirPin = 2;      // Motor direction connected to digital pin 2
                                      int motorSpeedPin = 3;    // Motor speed connected to analog pin 3
                                      
                                      void setup()
                                      {
                                        pinMode(motorDirPin, OUTPUT);       // sets the pin as output
                                        pinMode(motorSpeedPin, OUTPUT);     // sets the pin as output
                                      
                                        digitalWrite(motorDirPin, LOW);     // sets the default dir to be forward
                                        digitalWrite(motorSpeedPin, LOW);   // sets the default speed to be off
                                      }
                                      
                                      void loop()
                                      {
                                        // Set the motor direction to forward
                                        digitalWrite(motorDirPin, LOW);     
                                      
                                        // Ramp the motor speed up
                                        analogWrite(motorSpeedPin, 0);    // Min speed forward (motor off)
                                        delay(50);  
                                        analogWrite(motorSpeedPin, 63);   
                                        delay(50);  
                                        analogWrite(motorSpeedPin, 127);   
                                        delay(50); 
                                        analogWrite(motorSpeedPin, 191);   
                                        delay(50); 
                                        analogWrite(motorSpeedPin, 255);   // Max speed forward
                                        delay(50); 
                                      
                                        // Ramp the motor speed down
                                        analogWrite(motorSpeedPin, 191);   
                                        delay(50);  
                                        analogWrite(motorSpeedPin, 127);   
                                        delay(50);  
                                        analogWrite(motorSpeedPin, 63);   
                                        delay(50); 
                                        analogWrite(motorSpeedPin, 0);     // Min speed forward (motor off)
                                        delay(50); 
                                      
                                      
                                        // Set the motor direction to reverse
                                        digitalWrite(motorDirPin, LOW);   
                                      
                                        // Ramp the motor speed up
                                        analogWrite(motorSpeedPin, 255);    // Min speed reverse (motor off)
                                        delay(50); 
                                        analogWrite(motorSpeedPin, 191);   
                                        delay(50);  
                                        analogWrite(motorSpeedPin, 127);   
                                        delay(50);  
                                        analogWrite(motorSpeedPin, 63);   
                                        delay(50); 
                                        analogWrite(motorSpeedPin, 0);      // Max speed reverse
                                        delay(50); 
                                      
                                        // Ramp the motor speed down
                                        analogWrite(motorSpeedPin, 63);   
                                        delay(50);  
                                        analogWrite(motorSpeedPin, 127);   
                                        delay(50); 
                                        analogWrite(motorSpeedPin, 191);   
                                        delay(50); 
                                        analogWrite(motorSpeedPin, 255);    // Min speed reverse (motor off)
                                        delay(50); 
                                      }


                                      TinyCircuits Staff
                                      TinyCircuits Staff

                                      Author



                                      Also in Learn

                                      Tiny Arcade Assembly Instructions
                                      Tiny Arcade Assembly Instructions

                                      by TinyCircuits Staff September 18, 2016

                                      Learn how to assemble your Tiny Arcade. You can read the step by step guide, or there's a video tutorial...

                                      View full article →

                                      Tiny Arcade Menu Update
                                      Tiny Arcade Menu Update

                                      by TinyCircuits Staff May 18, 2016

                                      Update your Tiny Arcade software to the latest version from your computer.

                                      View full article →

                                      TinyScreen+ Windows 7/8 Driver Installation
                                      TinyScreen+ Windows 7/8 Driver Installation

                                      by TinyCircuits Staff May 18, 2016

                                      Install the required drivers to use TinyScreen+ with Windows 7 and Windows 8.

                                      View full article →