Preface About SunFounder SunFounder is a technology company focused on Raspberry Pi and Arduino open source community development. Committed to the promotion of open source culture, we strive to bring the fun of electronics making to people all around the world and enable everyone to be a maker. Our products include learning kits, development boards, robots, sensor modules and development tools. In addition to high quality products, SunFounder also offers video tutorials to help you make your own project.
In this book, we will show you how to build the robot via description, illustrations of physical components in hardware respects. You may visit our website www.sunfounder.com to download the related code and view the user manual on LEARN -> Get Tutorials and watch related videos under VIDEO. Free Support If you have any TECHNICAL questions, add a topic under FORUM section on our website and we'll reply as soon as possible.
Contents I. Introduction ...................................................1 II. What you need .............................................2 III. Getting start with micro:bit ...................3 IV. Use makecode & sloth:bit block .........5 V. Assemble the robot ............................ 12 VI. Calibrate .............................................. 32 VII. Project .................................................. 37 1. Obstacle Avoidance example ..... 37 2. Voice example ...........................
Javascript API ............................................. 46 PC use micro:bit .........................................
I. Introduction Sloth:bit is a programmable biped robot that use 9V battery and controlled by BBC micro:bit to drive four servos on driver circuits. It’s easy programmable and convenient for application. With BBC micro:bit, sloth:bit robot can be applied by micro:bit app in Microsoft. The robot can be controlled on pad or cellphone by visual programming software; also, when downloading program, you can connect Bluetooth without cables. Different types of sensors are equipped with sloth:bit.
II. What you need Battery: Pay attention to the battery type. The first three types are accessible and the last one is unsuitable. Because the last one is carbon-zinc battery, it can just apply in low current. Pad: Ipad or mobile devices of Andriod suitable.
Application: This app can be searched at the App store or Google Android market. III. Getting start with micro:bit 1.Search and install micro:bit application at the iPad store. 2.Power on the micro:bit and the power light of the board will be lighten up.(If the robot is not assembled, micro USB wire cable can be used to supply power.
3.Then open the Bluetooth on iPad and startup the app that installed just now, the interface after opening up is as shown below; 4 . Follow the instruction of the software guide to connect micro:bit with iPad.
IV. Use makecode & sloth:bit block 1. After connecting successfully, tap Home at the upper left side to go back. 2. Click the second category Create Code.
This is the interface of the micro:bit visual programming. Drag the block and combine them together to compile the program you need.
7
2.Click Advanced, then click Add Package: 8
Search sloth, you can see the package we provide. Click on the package to add it to the project. After the package is added, you’ll see the sloth on the left side.
Program with sloth: Combine these blocks with on start block: After the program is complete, click Download and then confirm to download.
Before downloading the program, you need to press A and B at the same time, then press the Reset at the back side until there display Paring at the matrix, and release A and B to command the board to pair Bluetooth.
Click flash on the app to flash the program: Wait until it is complete: V. Assemble the robot Before assembling, it is recommended to check whether the servo is normal. If there exist any problems, you are welcomed to contact with us to change. Do as the previous chapter to download and burn the test program into micro:bit.
Afterwards, insert micro:bit into the long slot of the driver PCB. Note the direction, if insert in reverse direction, the micro:bit will not power on.
Assemble the battery. Prior to inserting battery, please ensure the battery type is not carbon-zinc type. When assembling, note the pin header in case of scratching your hands. Take out the servos from package: Then connect servos with drive board. Insert the yellow line of servo into the yellow pin and red into red, brown into brown. Power on to check whether all the servos can rotate normally.
Do as shown in the following picture to assemble the acrylic parts: 15
Take out all the acrylic parts and take off the protective paper carefully. Note the edge of these parts in case of incised wound. Because these acrylic plates are cutting, there may exist sharp edges cut your finger, so be careful. Now assemble the rocker arms of servos. Take out two Acrylic B and Rocker arm B,assemble them with M1.2*4 screw. Take out two Acrylic C1 and Rocker arm A, assemble them with M1.2*4 screw.
Now we will assemble the robot from down to up. First is the two feet. The parts used here are E, D1 and D2. Fix part E and D1 by M3*10 cap screw and M3 nut. It looks as shown below after assembling. Fix part E and D2 by M3*10 cap screw and M3 nut.
After assembling, it looks as shown in the picture. Afterwards, insert the hollow rivet into the D2 as shown below.
Insert servo into the feet parts as shown below. When assembling, note the servos direction, the servo cable direction is at the same side with the edge of feet. Fix servos by M2*8 screw and M2 nut. When the left foot assembled already, it looks as shown in the following picture.
Congratulation! You have assembled the left foot successfully. Now, you can assemble the right foot mirrored. Put the two feet together, it should looks as shown in the picture below. If you find there are two left feet or two right, the reason should be that part E is on the reverse side, you need to flip it to the other side. Then assemble body part of the robot, that is electric circuit and combining between body and feet.
following assembly, power on to calibrate is smoother. Please follow the processes as shown below. Assemble two servos into two parts A, note the servo assembling direction. The side of long hole of part A is the front side, the direction of servo cable face to the side of the arrows. Fix servos, then assemble them by M2*8 screw and M2 nut.
Then insert the support copper post into the acrylic board and assembled by M3 copper standoff and M3 nut. Assemble the drive circuit board as shown in the picture. When assembling, note the direction of the drive board. The IR should be toward the front side of part A.
Then fix the circuit board by four M3*6 screws. Insert the micro:bit into the slot of circuit board. Note the direction of micro:bit control board. The LED matrix side should be toward the front.
Install the battery now. When installing the battery, be careful of the pin in case of scraping your finger. Combine the four servo cables with the interfaces of servo and drive board. The orange lines in the picture below are the way recommended to twine.
Download a stand still program into micro:bit. Power on it, if combining the servo well, it will stop at the angle of 90. When installing rocker arms, the servo need to be stop at the angle, so, keep the robot power on is necessary. Next, assemble the part between leg and foot as shown below and assemble by M3*8 screw and M3 nut.
Combine the leg and foot part with leg servo. Assemble the rocker arm with servo. Assemble the rocker arm in the angle as shown below. There may exist a little deviation between servo and rocker arm when assembling finishes.
Fix rocker arm by rocker arm screw. Assemble the bearing with hollow rivet, then combining with acrylic plates.
This is what looks after assembling. Combine the assemble parts together. When assembling, it’s better to distinguish left and right foot clearly, also the front and back side of the foot. One of the rocker arm need to face the front side of part A.
part A should be in 90 degree. After the rocker arm and servo gear are combined, power off the robot. Now rotate the feet, there will appear the screw hole of rocker arm. Fasten the rocker arm screw and fix the leg.
Assemble the other foot at the same way. Note: when assembling the rocker arm gear, power it on and keep the servo gear at the angle of 90. After assembling, power the robot on and the picture below is what is looks if stand still. If your robot stands not straight, maybe you need to repeat the processes of assembling rocker arms.
When all the processes are finishing, you need to clean the servo lines and fix by ribbon.
VI. Calibrate After assembling the sloth:bit, now download program to sloth:bit thus to command the robot do various actions. Maybe the robot is a little strange, the reason should be that there exist some deviations in the gears. You can calibrate by adjustment. The left one is the precise installation one and the right need to be adjusted.
Download adjustment program into micro:bit.
There will display Cali on the LED. After the display, it will come into calibrate mode. When the LED is blinking, it means to choose the servo that is to be adjusted. A, B is to change between servo, and A+B is to ensure the choice.
Right Leg Left Leg Right Foot Left Foot After choosing one servo, press A and B at the same time to ensure it, then it will come into adjustment mode. A, B are the values of – and +; A and B is to ensure the choice, then blink to display the corresponding servo and the adjustment value. Remember these values and fill them into the set offset blocks.
Choose the numbers of adjustment. Calibrate the sloth:bit as straight as possible.
VII. Project 1. Obstacle Avoidance example This is an example program of obstacle avoidance, program according to the picture, then download it into micro:bit. When the sloth:bit goes forward and detect obstacles in front, then the robot turn left for two times; after turning, if no obstacles in front, the robot will goes forward, and if there has obstacles, the robot will turn left.
2. Voice example This is an example program of voice, do as shown in the picture, then download into micro:bit.
for one time; when there has no voice, the robot will not move and display the expression of sleeping. If the surrounding is too noisy, you can enlarge the value of 550 in the on heard over block.
VIII. What’s next 1. Resources of boards Micro:bit board has many sensors. For more detailed introduction, please refer to official website of micro:bit: http://microbit.org/guide/features/ Light sensor,Temperature sensor,Accelerometer, Compass,Radio,Bluetooth These sensors are helpful to make the sloth:bit smarter and complete more interesting programs. For example, you will see the robot is in the state of felling to the ground by means of acceleration sensor.
When setting gestures, the most important is to set the values of array on the left, one array for one action. Here dance is designed as three actions, then define a function to combine the three actions together in order and time interval. 3. Pins Sloth:bit PCB board has several reserved interfaces. It can be extended for more functions and DIY hardware by soldering attached pins inside.
42
IX. Appendix FAQ The problem of Bluetooth connection After using software mu of programming software python in micro:bit, it may false the function of Bluetooth download program. What you need to do is to program on makecode, then download hex file to send to the disc of micro:bit by USB, thus the Bluetooth transmission can be used again. Do not support python code Micro:bit visual programming program compile is encouraged to be used, surely, you can also use Javascript.
servo shake if the robot is doing actions. Voice sensor environmental thresholds Voice sensor is to return different voltage by means of receiving sounds on cellphone. If the surrounding is too noisy, you need to increase the threshold value of sensors. Print out the received voice value by serial write and then set the threshold value higher than surrounding noise according to returned receive values. When using the serial port, connect micro:bit with computer by USB.
Abnormal of robot actions If the robot can’t be startup, please check: 1. Whether the power is on, it must be on. 2. Whether the battery is full. Check by multimeter, if less than 7.5V, it means the battery is low. 3. Whether the micro:bit board is plugged in reverse side, the LED should toward IR transmitting valve. 4. Whether the micro:bit board had downloaded program. If not, download the program again.
Contact us Javascript API PC use micro:bit By makecode to visual programming : http://microbit.org/guide/quick/ Program by mu to micropython : https://codewith.mu/ Micropython language help : https://microbit- micropython.readthedocs.