• UID1571
  • 登录2018-07-20
  • 粉丝5
  • 发帖140
  • 科研点数0点
优异服役勋章
耕耘者十字勋章
zt07elecfreaks 发布于2018-01-12 11:07
0/248

ELECFREAKS BLE Motor User Guide

楼层直达

1. Introduction
BLE Motor is a kind of motor driver board compatible with Arduino UNO. It has integrated BLE Bluetooth 4.0 module, MEGA328 main control and L298P motor driver, which can be used to drive one-channel stepping motor or two-channel DC motor. Benefit to the sensor port on BLE Motor, we can plug in all kinds of Octopus brick sensors directly. At the same time, it can support various Shield extension for it has Arduino Shield compatible connector. A BLE Motor equals the combination of “Arduino UNO + BLE module + Sensor Shield + L298P MOTOR Shield”. We have integrated all these modules together to avoid messy cabling and the instability it caused while the size is well-controlled. The integrated BLE 4.0 enables us to connect mobile more easily. It is a convenient development board for robotics and intelligent cars.
2. Hardware
1. Features:
  • Develop Environment: Arduino IDE, fully compatible with Arduino UNO
  • BLE chip: TI CC2540
  • Support Bluetooth HID
  • Support Bluetooth serial port transparent transmission
  • Support program updating by USB
  • Micro-controller: ATMEGA328P
  • Bootloader:Arduino UNO
  • Auto shift input power
  • ICSP download program interface
  • With HC-11 433MHz RF module socket
  • Carry two-channel 2A DC motor connector or one-channel stepping motor connector
  • Input Voltage: DC 6-12V
  • Size: 76.57mm X 69.23mm
  • Weight: 40g
2. Application:
  • Support Android and IOS mobile terminal use. Easy to use just like BLEduino.
  • Built-in 3pin IO motor brick GVS extension port, compatible with ElecFreaks Octopus electric brick series.
  • Can be used as development board for smart cars and mini balance cars.
  • Users can develop mobile controlled robots or robot arms, etc..
3. Pins & Connectors:
Type
Introduction
BluetoothBLE Bluetooth 4.0 Module
Micro USBMicro USB communication port
Logic level switchFooter voltage switch. Can shift between 3.3V and 5V.
RSTReset Button
ICSPBootloader Burning Port/Connector
GPIO0-GPIO13Digital Port/Connector
A0-A7Analog Port/Connector
PWMPWM Pin
SCK MISO MOSISPI Pin
RXD TXDUART Serial Port Pin
SDA SCLIIC Pin
SW1-SW5Undefined Function Key
Power SwitchExternal Power Supply Switch
7-12V GNDOuter Power Supply Port
M1+ M1- M2+ M2-Two-channel DC motor or one-channel stepping motor
RF ConnectorCC1101 433MHz Wireless RF Transceiver Module Connector
LED PWRPower Indicator
LED D13D13 Indicator
LED ST1,ST2Bluetooth Status Indicator
4. Details about Partial Pins & Connectors:
a. Logic level switch:
When switched to 5V end, the footer operate voltage level of BLE MOTOR is 5V, which is the same with GVS red power supply port. Similarly, when we choose 3.3V, both BLE motor footeroperatevoltage and GVS red power supply port voltage is 3.3V. Therefore, we can connect 3.3V sensor directly without any voltage level transformation. It is more convenient to use.
b. GPIO0-GPIO13:
Digital port D0-D13. V in GVS stands for VCC, G for GND, S for signal. GVS is standard sensor port which enables us to connect steering engine and all kinds of sensors easily. At the same time, it can support all of Octopus Bricks products.


c. GPIO14-GPIO20:
Analog pin A0-A6. GVS port can connect steering engine and all kinds of sensors easily. It supports all of Octopus Bricks products.

d. Motor Control Switch Option Footer
Two connection methods in total. Different connections have different motor control methods. After disconnected, it can be used as common IO port.
Note: The silk mark on main board is wrong. And the right mark should be 4-M1, 5-E1, 6-E2, 7-M2.
  • PWM Control Mode. This mode can connect jumper cap directly. D5 and D6 are PWM pins for controlling motor speed; D4 and D7 are used to control the positive and negative rotation of control motor.

Pin
Function
4
Motor 1 Direction Control
5
Motor 1 Speed Control
6
Motor 2 Speed Control
7
Motor 2 Direction Control
  • PLL Control Mode, i.e. Lock Loop Control Mode. Connect pins according to the picture below.

Pin
Function
4
Motor 1 Start Control
5
Motor 1 Direction Control
6
Motor 2 Direction Control
7
Motor 2 Start Control
Usage:

  • When start control pin output high voltage level, the motor start move; when output low voltage level, it stop move.
  • When PWM signal of direction control pin is median (about 100 or so, different motors have to be tested for it), the motor stops.
  • Bigger PWM signal median deviation of direction control pin, the motor speed will be faster.
  • When PWM signal of direction control pin is bigger than median, the motor rotates positively. Lower than median, it will rotate negatively.

5. Dimension:
3. Software

1. Key Function Introduction:

1. DC Motor Drive Function:

PWM Function for speed control: analogWrite(pin, value)

[cce]


analogWrite(pin, value)
[/cce]
Parameters:

1.pin: the pin to write to.

Under DC motor control, it represents motor speed control pin.
2.value: the duty cycle: between 0 (always off) and 255 (always on).
Under DC control, it represents speed value. 0 is for minimum speed(stop) and 255 for maximum speed.

Returns:none
Direction control uses digital pin operate function: digitalWrite(pin, value)

[cce]


digitalWrite(pin, value)
[/cce]
Parameters

pin: the pin number

Under DC motor control, it represents the motor's corresponding pins in control end.

value: HIGH or LOW,
HIGH is for motor positive rotation, LOW is for motor negative rotation.

Returns:none
The code below can realize motor positive rotation in full speed.

Example:

[cce]
int E1 = 5;     //Define D5 as M1 speed control pin
int M1 = 4;    //Define D4 as M1 direction control pin
void setup()
{
  analogWrite (E1, 255);  // M1 full speed rotation
  digitalWrite(M1, HIGH);  // M1 positive rotation
}
void loop()
 {
}

[/cce]


2.Wireless Communication Function:
Set baud rate:

[cce]Serial.begin(115200);[/cce]
Send data:

[cce]Serial.println(data);[/cce]
4. Guide

1. Installation of operate environment and drive:

Based on Arduino UNO design, the usage of BLE Motor is as simple as Arduino UNO. It supports Arduino IDE programming and burning software. You don't have to install any drives so that it can work properly.
1. Like the following picture showed: Plug into USB, we will see serial port number in computer device manager. (Com number will differentiate according to the practical situation.)
2. Open the sample code we provided and choose Arduino UNO, then we can start programming and software burning.

2. Wiring Diagram:

1. DC Motor connection:


2. Stepping Motor connection:


3Test Method:
1. Search on Google Application Market or APP Store: BLE CENTER, download and install "BLE Center App", then you can connect BLE MOTOR with mobile to realize remote control:

2. Burn the sample code we provided and connect DC motor according to the instruction.
3. Open BLECenter App. When we hear the vocal message of "connected", then we have connected it successfully. Enter Console interface:

4. Use mobile Bluetooth to send "0" to "BLE MOTOR". Motor 1 will rotate positively at first, then negatively, and stop in the end. Next, motor 2 will repeat the movement of motor 1.
5. When test is finished, it will return "0". This shows everything is ok.

6. Press the button, we can see key value "SWX OK" on mobile.
4 Relative Parts:
Things we have to pay attention:
  1. When we shift voltage level switch to 5V, the current of red pins power output can reach 2A, while shifting to 3.3V, the maximum current of red pins power output is 800mA.
  2. Connect Serial port and Bluetooth together, one of them will have no signal. So they cannot use at the same time.
  3. Motors must have outer power supply, or we cannot drive it by USB only.
  4. The input current of Micro USB shall not over 500mA. Once it over 500mA, the fuse will enter into protection status. Then we have to cut off power supply and wait fuse cool down so that we can use it again.
6. Contact Information
If you need more information, please log on: http://www.elecfreaks.com .
您需要登录后才可以回帖
发表回复

杩斿洖椤堕儴