Reply to topic  [ 1 post ] 
WeMos D1 Mini Motor Drive Shield (HCWEMO0010) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:02 pm
Posts: 631
Post WeMos D1 Mini Motor Drive Shield (HCWEMO0010)
Image





The WeMos I2C Dual Motor Driver Module is designed to be able to drive up to two DC motors from your WeMos mini or mini Pro development boards (See HCWEMO0002). Using PWM the shield is capable of independently controlling the speed and direction of each connected motor with a maximum average of up to 1.2A (3.2A peak). The shield, together with its supplied headers (3 x 10 way supplied unsoldered), allows for it to be easily inserted and removed from the WeMos Mini. Control of the shield is via the WeMos mini's I2C interface which can be configured via solder jumpers to one of 4 I2C addresses (0x30 default). A library and example sketch is provided by WeMos to make controlling the shield from your own sketches as simple as possible.



Image



Features:

I2C Interface
Power Supply Voltage: VM =15V MAX
Output Current: Iout = 1.2A (average) / 3.2A (peak)
Standby control to save power
CW/CCW/short brake/stop motor control modes


Pinout:

VM.........Motor Power Supply +(Max 15Vdc)
GND.......Motor Power Supply -
A1 A2.....Motor A
B1 B2.....Motor B
S...........Standby Control Mode
I2C Mode: Control TB6612's STBY with I2C protocol
IO Mode: Control TB6612's STBY with "S" pin

Shield Reset Mode:
Short: Reset with D1 mini (reset at power on or press D1 mini's reset button)
Open: Reset by "DTR" pin.



Image



Example Arduino Sketch:

Code:
/* This sketch was created by WeMos.cc */

#include "WEMOS_Motor.h"

int pwm;

//Motor shiled I2C Address: 0x30
//PWM frequency: 1000Hz(1kHz)
Motor M1(0x30,_MOTOR_A, 1000);//Motor A
Motor M2(0x30,_MOTOR_B, 1000);//Motor B


void setup()
{
  Serial.begin(250000);
}

void loop()
{
  for (pwm = 0; pwm <= 100; pwm++)
  {
    M1.setmotor( _CW, pwm);
    M2.setmotor(_CW, 100-pwm);
    Serial.printf("A:%d%, B:%d%, DIR:CW\r\n", pwm,100-pwm);
  }
 
  M1.setmotor(_STOP);
  M2.setmotor( _STOP);
  Serial.println("Motor A&B STOP");
  delay(200);
 
  for (pwm = 0; pwm <=100; pwm++)
  {
    M1.setmotor(_CCW, pwm);
    M2.setmotor(_CCW, 100-pwm);
    Serial.printf("A:%d%, B:%d%, DIR:CCW\r\n", pwm,100-pwm);
  }
 
  M1.setmotor(_STOP);
  M2.setmotor( _STOP);
  delay(200);
  Serial.println("Motor A&B STOP");

  M1.setmotor(_SHORT_BRAKE);
  M2.setmotor( _SHORT_BRAKE);
  Serial.println("Motor A&B SHORT BRAKE"); 
  delay(1000);
 
  M1.setmotor(_STANDBY);//Both Motor standby
  M2.setmotor( _STANDBY);
  Serial.println("Motor A&B STANDBY"); 
  delay(1000);
}





Image

Schematic:
Attachment:
HCWEMO0010_Schematic.pdf


Arduino Library:
Attachment:
WEMOS_Motor_Shield_Arduino_Library.zip


The above library can also be downloaded from the following GitHub page: https://github.com/wemos/WEMOS_Motor_Shield_Arduino_Library



Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.


You do not have the required permissions to view the files attached to this post.


Fri Nov 25, 2016 12:10 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD