Recommend Projects

Xadow - Motor Driver copy

8 months ago 51
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments


Introduction Xadow Motor can be used to control DC Motors. Its heart is a low-saturation two-channel bidirectional motor drive chip LB1836M, controlled by ATmega168 which handles the I2C communication with Xadow Main Board. Xadow Motor features a changeable I2C address. And it needs a separate low power to drive motors. Specification Motor Driver: LB1836M Battery Voltage: 2.5V ~ 9V Output Current per channel(Max): 300mA Communication Mode: I2C I2C Address is changeable Dimensions: 25.43mm x 20.35mm Product View enter image description hereenter image description here Xadow Motor Black View.png ①: LB1836 IC, a low-saturation two-channel bidirectional motor driver. ②: Motors Power Supply Connection. ③,④: DC Motors Connection. ⑤,⑥: used to set the IIC address. A0 and A1 are shipped connected to H. You can change them to "L" by a little modification on the board. Find details in the Reference. ⑦: SPI Interface, used to upload firmware for Atmega168. ⑧: Microcontroller Atmega168. ⑨: used to select power supply for Atmega168 IC. In default mode, DVCC is connected to VOUT which means the power comes from Motor power supply. When DVCC is connected to 3.3V, Xadow Main Board supplies power for Atmega168. Demonstration

Xadow Motor can drive two DC motors simultaneously. Based on our available library, it is more easily to make motors run. Now let's get started. Note: the library is not available for controlling stepper motor. Hardware Installation: 1) Connect DC Motors to J5,J6 interface. You can use the solder iron for soldering to make sure the connection are fixed. We configure a 3.7V lithium battery for you. So you cannot drive high - power motors using the battery. 2) Connect battery to Battery Interface of Xadow Motor. Without battery, Motors would not rotate. 3) Connect Xadow Motor to Xadow Main Board. Do not forget to install Xadow Driver. Note: when connect Xadow 3-Axis Accelerometer to Xadow Main Board, you should concern about the connection direction. The connection method is that the unfilled corner of one xadow module need to connect to the right angle of another module(see four corners of each xadow module). Upload Code: 4) Download Xadow Motor Library and install it to Arduino Library. 5) Open the code directly by the path:File -> Example ->xadow_motor->motorCtrl. /* there are four motor state you can use: -MSTOP -> stop -MFOR -> go forward -MREV -> go reverse -MHOLD -> hold the recent state *NOTE: there are four addresses you can choose, it's up to the hardware, for more information, refer to -MOTORADDRESS0 0x40 // A0 LOW, A1 LOW -MOTORADDRESS1 0x41 // A0 HIGH, A1 LOW -MOTORADDRESS2 0x42 // A0 LOW, A1 HIGH -MOTORADDRESS3 0x43 // A0 HIGH, A1 HIGH use this function: setMotorRun(unsigned char sMotorA, unsigned char sMotorB); you can contrl the both motor. /

#include <Wire.h>

#include "XadowMotor.h"
void setup()
void loop()
    Serial.print("bat vol :");
    xadowMotor.setMotorRun(MFOR, MFOR);
    xadowMotor.setMotorRun(MSTOP, MSTOP);
    xadowMotor.setMotorRun(MREV, MREV);

In this code, the function xadowMotor.begin(MOTORADDRESS3) is used to set Xadow Motor I2C Address. You need to change the parameter"MOTORADDRESS3" when you change the connection of A0 pin and A1 pin. Find details in the Reference. 6) Upload the Code. Remeber to select Seeeduino Xadow from the Tools | Board menu of the Arduino environment, and select the correct serial port Xadow Main Board is using. Now you can see your motors will run forward or backward at regular intervals. By opening the serial monitor, you can observe your battery voltage. Reference The Xadow Motor has four I2C address which is decided by A0 pin and A1 pin. A0 and A1 are connected to H inside the board as default. But you can change it. For example, use a solder iron to break the connection between H and A0, then solder up ADR0 and L, so you make the value of A0 as L. You can find the relationship of hardware I2C address and the values of A0 and A1 in the following table. I2C Address A0 and A1 inputs state the corresponding parameter in code A1 A0 0x40 L L MOTORADDRESS0 0x41 L H MOTORADDRESS1 0x42 H L MOTORADDRESS2 0x43 H H MOTORADDRESS3


xadow-motor driver v1.0 copy

xadow-motor driver v1.0 copy


ID Name Designator Quantity
1 12p FPC bottom contact J2,J1 2
2 100nF C3,C5,C7,C1,C2,C4 6
3 050028001 8MHz X1 1
4 16V_22uF C10 1
5 1uF C8,C11 2
6 HEADER-2P J6,J5 2
8 10uF thin C9 1
9 ATMEGA168PV-10MU U1 1
10 10k R1 1
12 PAD-MARK P1,P2,P3,P4,P5,P6,P7,P8 8
13 LB1836M U2 1
14 341023001 JST-SMD-2P-1.0-90D BAT 1
15 10M_1% R7 1
16 2M_1% R8 1
17 330R-1.7A L2,L1 2
18 DNP DVCC,A0,A1 3
19 RED D1 1
20 1K R2 1
21 10pF C6 1
22 DNP J4 1
23 XC6206P332MR-G U3 1
24 DNP R3 1




The owner does not allow comments in this project now

Comments (0)

如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.