Introduction
The BBC micro bit is a wonderful programming device for mini-projects. We all know that the contribution of micro:bit to education is nonpareil. Motors also play an important role in projects. With the help of 16 Channel Servo Driver for micro bit now make your projects movable. The servo driver is capable of 16 servo motors at once. The servo driver gives you the freedom to control and run your servo motors.
Only micro:bit is not capable of driving a servo motor as the voltage requirement of the motor is much higher than the output voltage of micro:bit. The servo driver is the best solution to this problem. This expansion board can also be called a PWM board. The motor driver IC used in the board is the PCA9685, the IC can be operated on batteries. The maximum output can be 3A of the IC. The board also has a 5V voltage regulator. For serial communication, I2C is used and all the 12 servo channels support the 12-bit resolution.
The servo driver board for micro:bit can be used to make undefined numbers of Robotics Application.
Features
- Board dimensions: 65mm x 36mm.
- Motor Driver IC: PCA9685.
- Servo Voltage: 5V.
- Power Supply for Board( Battery also): 6V ~ 12V.
- Operating Voltage: 3V.
- USB Power Supply: 5V.
- Serial Interface: I2C.
- Mounting hole size: 3.0mm.
Hardware
Starting from the top the first is the edge connector to connect the micro: bit to the servo driver board. Above the connector, you will have the 14 GPIO pin. For powering up the board you can either use a screw power terminal(6V ~ 12V) or the USB port. To indicate the power status a LED is also there on the board. The A 5V regulator is there and the maximum output power is 3A. The regulator changes the 5V voltage supply of USB to 3.3V supply for micro:bit.
The Servo motor pin can be found at the bottom of the board. All the 16(0~15) servos can run at the same time. The black pins are for GND, the red pins are for VCC (5V) and yellow for the PWM Signals.
NOTE:
- Make sure the motor and power wirings are proper.
- The USB power connection is not for the motors, it is only for micro:bit.
- For running motors of a higher power, you should connect the power supply of higher voltage.
Connections
- Stack the micro:bit edge connector to board headers.
- Set up the power connection and connect to either the screw terminal or USB port.
- Add your servo motors now. Make sure the connections are proper. The black pins must be connected to ground, red to VCC and yellow to signal pins.
- Connect your micro:bit to your system via. USB.
- Write down your code in MakeCode and send it to your micro:bit. Loading will take some time and after it gets finished your will run.
Software
You can get the servo driver manual (pdf) for micro:bit, its schematic and example codes(hex file) from the Github link: https://github.com/sbcshop/pxt-servo-microbit
You can write the codes of micro:bit in Microsoft Makecode
https://makecode.microbit.org/#editor.
It's an online editor for micro:bit block programming.
We need some additional blocks to write the code for the servo motor. To add the block extension click on the Advanced block and go to the Extensions, add this URL in the space given https://github.com/sbcshop/pxt-servo-microbit.git
The following are the blocks that we need in coding.
This block is for controlling the angle( 0~180) of the motor( 0~15).
This block is for controlling the PWM pulse( 500~2500 Hz) of the motor(0 ~15).
Following table shows the relationship between the pulse and the degree of motor: