50
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. If you have interest in open source or making something cool, welcome to join us! About This Kit This cute learning kit utilize blocks and circuit driving connecting rod structure to command the robot to display different expressions. You can learn the knowledge of bricks, structure and circuit by applying this kit.

About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

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. If you have interest in open source or making something cool, welcome to join us!

About This Kit This cute learning kit utilize blocks and circuit driving connecting rod structure to command the robot to display different expressions. You can learn the knowledge of bricks, structure and circuit by applying this kit.

Page 2: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

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.

For NON-TECH questions like order and shipment issues, please send an email to [email protected]. You're also welcomed to share your projects on FORUM

Page 3: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

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 ................................ 38

VIII. What’s next .......................................... 40

1. Resources of boards ....................... 40

2. Set gestures ...................................... 40

3. Pins .................................................... 41

IX. Appendix ............................................. 43

FAQ .............................................................. 43

The problem of Bluetooth connection

............................................................... 43

Python code is not support ............... 43

Battery .................................................. 43

Voice sensor environmental thresholds

............................................................... 44

Abnormal of robot actions ................ 45

Contact us ........................................... 46

Page 4: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

Javascript API ............................................. 46

PC use micro:bit ......................................... 46

Page 5: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

1

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.

The micro:bit board is attached with acceleration,

terrestrial magnetism and temperature sensor,

infrared obstacle avoidance and voice sensor are

also attached inside.

Sloth:bit robot have reserved several extensibility

interfaces. Users can DIY hardware if needed and it is

convenient for modifying and extending functions.

Page 6: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

2

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 are all

suitable.

Page 7: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

3

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.)

Page 8: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

4

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.

Page 9: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

5

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.

Page 10: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

6

This is the interface of the micro:bit visual

programming.

Drag the block and combine them together to

compile the program you need.

Page 11: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

7

Page 12: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

8

2.Click Advanced, then click Add Package:

Page 13: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

9

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.

Page 14: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

10

Program with sloth:

Combine these blocks with on start block:

After the program is complete, click Download and

then confirm to download.

Page 15: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

11

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.

Page 16: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

12

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.

Page 17: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

13

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.

Page 18: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

14

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.

If the servo is normal, then unplug servos and take out

battery and micro:bit to continue the assembling of

sloth:bit.

Page 19: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

15

Do as shown in the following picture to assemble the

acrylic parts:

Page 20: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

16

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.

Page 21: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

17

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.

Page 22: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

18

After assembling, it looks as shown in the picture.

Afterwards, insert the hollow rivet into the D2 as shown

below.

Page 23: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

19

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.

Page 24: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

20

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.

Because there are servos in the robot, thus in the

Page 25: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

21

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.

Page 26: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

22

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.

Page 27: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

23

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.

Page 28: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

24

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.

Page 29: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

25

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.

Page 30: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

26

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.

Page 31: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

27

Fix rocker arm by rocker arm screw.

Assemble the bearing with hollow rivet, then

combining with acrylic plates.

Page 32: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

28

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. As assembling before, the foot and the front side of

Page 33: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

29

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.

Page 34: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

30

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.

Page 35: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

31

When all the processes are finishing, you need to

clean the servo lines and fix by ribbon.

Then paste the two feet with mats:

Page 36: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

32

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.

Page 37: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

33

Download adjustment program into micro:bit.

Page 38: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

34

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.

Page 39: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

35

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.

A, B for -/+,

A+B for confirm

Right Leg

Right Foot

Left Leg

Left Foot

Page 40: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

36

Choose the numbers of adjustment. Calibrate the

sloth:bit as straight as possible.

Page 41: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

37

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. Obstacle avoidance is realized by infrared, thus if

the size of the obstacle is too small or surface is

irregular, it may cause the obstacle undetected.

Page 42: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

38

2. Voice example

This is an example program of voice, do as shown in

the picture, then download into micro:bit.

When hearing the voice, there will display the

expression of surprised and do the action of swinging

Page 43: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

39

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.

Page 44: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

40

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

the robot is felling to the ground, you can stop it and

even design the action of standing up again.

2. Set gestures

If these gestures are not enough, you can set new by

combine blocks. The program as shown below is to

define dance action:

Page 45: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

41

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. The

reserved pins interfaces have the functions as shown

below:

Page 46: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

42

Page 47: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

43

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. There still has no Python package in

sloth:bit by this moment.

Battery

There are different types 9V battery, because carbon-

zinc battery can’t supply high current thus not suitable

for robot. If you use this kind of battery may cause the

Page 48: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

44

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.

Page 49: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

45

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. C heck 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.

Page 50: About SunFounder - RobotShopinfrared obstacle avoidance and voice sensor are also attached inside. Sloth:bit robot have reserved several extensibility interfaces. Users can DIY hardware

46

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.io/en/latest/