• sales

    +86-0755-88291180

Motor Driver for micro:bit User Guide

Introduction

This is a motor driver module designed for the BBC micro:bit. Can drive 2 DC motots and 3 steering gears

Features

  • micro:bit edge connector, directly pluggable
  • Onboard connectors for two DC motors and three steering gears
  • 5V regulator, supports 6V~12V input (VIN terminal). Output current up to 3A
  • Onboard connectors for DC motor and standard steering gear.
  • Comes with developing resources and munual

Specification

  • Power input range:6V~12V
  • Gear voltage: 5V
  • Logic voltage: 3.3V
  • Driver: TB6612FNG
  • Dimension: 65mm x 36mm
  • Holes size: 3.0mm

Pinouts

PINDescription
VccPower (6~12V)
GNDGround
A1positive pole of motor A
A2negative pole of motor A
B1positive pole of motor B
B2negative pole of motor B
P0control pin P0 of steering gear
P1control pin P1 of steering gear
P2control pin P2 of steering gear

Programming Guide

Micor:bit has variety of programming methods like mbed, micropython, typescript and other programming methods, as well as code online websites which are abundant.

The official recommendation are two programming methods: typescript and micropython. Typescript is the graphical programming language.


Typescript

Typescript is a kind of graphical programming, its website is that: https://makecode.microbit.org/#

  • Open a browser and input the next URL


  • Add Packeage

You can clone the package of Motor Driver HAT for micro;bit from github. Click More..->Add Package, then copy the URL to the Edittext. https://github.com/waveshare/pxt-Motor


Control Motor Rotation

Control two motors at the same time, and set their rotating direction and speed


Stop motor when button A is pressed


Control Servo

Control servo to rotate in certain angle.


Other blocks

There are also some block in Avandced->More which can be used to control servo


Python

You can get more information about python programming of micro:bit on this web page: https://microbit-micropython.readthedocs.io/en/latest/index.html

We provide python codes for this moudle, you can download and have a try.

Upzip the demo code you download and open the file motor.py which is under python directory with software mu.

Initiailing


Control Motor


Stop


Cotnrol Servo


Control servo to rotate in certian angle


Temp=angle/2+25 is duty ratio, its range is 0~1023.

Example:


Motor1 moves forward, Motor2 moves backward, servo1 rotate 50 degree, servo2 rotate 150 degree.

TAG: UGV Beast PT AI 4G 5G OpenCV Robot Car MediaPipe For Raspberry Pi4B/5 Raspberry Pi 5 Raspberry Pi 5 PCIe X1006 Raspberry Pi 5 PCIe To 2.5 SATA And M.2 KEY-B 2280 SSD/HDD Double-SATA (NOT BOOT From SATA/SSD Raspberry Pi AV to LVDS UART Serial TTL To RS232 B Built-In Protection Circuits Rail-mount NVIDIA Jetson Orin Nano/NX PoE Mini Expansion Board Power over Ethernet RJ45 802.3af compliant TTL UART To CAN Mini Raspberry Pi 13.3 inch FHD AMOLED 1080P Capacitive TouchScreen Display Type-C/HDMI For Computer PC ESP32 S3 Development Board 2.8 inch Round LCD Display 480x480 QMI8658 Sensor / MIC / SD /MP3 Audio /Battery Port LVGL/HMI For Arduino Writing-Image User Guide Industrial Hybrid relay module RS485 Modbus RTU rail with isolation protection ESP32 S3 Development Board 3.5 inch LCD Capacitive Touch Screen 3.5inch Display 320×480 N16R8 3.4inch Round LCD HDMI Capacitive Touchscreen Display 800x800 For Raspberry Pi/Jetson Nano/mini PC Raspberry Pi Pico 2 RP2350 ETH CH9120 TCP/UDP Ethernet Network For Arduino USB IR Infrared Thermal Imaging Camera C 45°/88° 160x120 For Phone/PC High Temp Warning/Take Photo /Recording video Raspberry Pi Game ESP32 C6 Development Board 1.47 inch LCD Touch Screen 1.47inch Display 172×320SD AXS5106L JD9853 Black