Microbit Talking Robot

15,311

47

8

Introduction: Microbit Talking Robot

About: I love designing, 3d printing, computing, programming, and engineering.

众所周知,Tinkercad在TinkerCad电路中引入了一个新功能,它是微生物的。我们可以在使与微生物相关的东西中进行虚拟原型,甚至可以进行模拟。我们可以节省大量资金来构建实验,而无需损坏我们的电子元件。此外,我们可以添加一些代码来带来实验。

不幸的是,在阅读Tinkercad的博客, this launch has a drawback. When exporting the code, Tinkercad only transfers it into JavaScript language. You need to change the code by using a third-party like Microsoft Makecode, for it requires a hex file to work directly in Microbit.

最初,我在Tinkercad进行了模拟,建立并探索了这个实验。投票率,我的模拟不像我预期的那样。我的下一步是我准备了使用Microsoft MakeCode的代码,因为我将使用连续伺服而不是Micro Servos,TinkerCad仅在电路中提供了微伺服。

我决定使用微生物作为其大脑制作一个机器人。为了使机器人更令人愉悦和挑战,我使用伺服电机,LED,图像和谈话功能添加了一些动作。

For those who do not work yet with Microbit, please read the overview guide of Microbit in thislink.

For downloading the enclosure, clickCults3D.

I also attached the Microbit HEX Files.

Supplies:

您需要的材料:

tinkercad.

Microbit

Microsoft Makecode and Python Editor

3D打印机

PLA filament (Metal, blue, yellow, red, wood, and green)

Speaker

Alligator clip

电线

跳线电线

电工胶带

热胶

Makita钻

Dremel rotary tool

切割钳子

焊接iron

焊接

2 LEDs

4个AA +支架电池

2 Batteries of AAA + holder

Step 1: Make Simulation in Tinkercad

之前我们做一个原型,它是至关重要的a simulation in Tinkercad. By doing this simulation, we can play around with the electronic circuit, so we become aware and understand whether we make a mistake in our circuit or not. As I mentioned previously, Tinkercad only has micro servos in its library, while I would like to use continuous servos (because I have enough continuous servos in my inventory instead of micro servos). How to solve this problem? Well, I had to use another alternative, which is making the block code in another third party, such as Microsoft Makecode.

至少,TinkerCad在我的模拟中有很多帮助。在这里我截图我的电子电路。实际上,Microbit最多需要3V(两个AAA电池)作为其电源。但要操作两个伺服,它需要额外的四节AA(6V)。否则,伺服系统不会推动。

第2步:伺服

In this project, I used two continuous servos to rotate the hands.

The servo has three lines, which are signal lines (orange-1), electric power line positive (red-2), and negative/ground line (black-3).

  • Signal lines, which are represented as blue and green wires in the circuit diagram above, in servos connected to pin 1 and 2 in Microbit, respectively.
  • The positive line in both servos should connect to the positive pole of the battery, and so the negative line (ground) should connect to the negative pole of the battery.
  • 两个伺服系统都连接到微生物中的地面(GND),也只有一个伺服连接到电池的负极。

Step 3: The LEDs

我为我的机器人使用了两个LED,我用了白色LED。这些LED用于机器人的眼睛。因此,我将第一LED的正腿连接到微磁石中的销1,第二LED在微磁石中的销2中。第一个LED应该是左眼,第二个LED是右眼。LED的两个负腿连接到微生物中的地面(GND)。

第4步:扬声器

Connect the speaker to the Microbit as follows:

·正线连接到Microbit中的引脚0

· Negative wire connects to Pin GND in Microbit

Step 5: The Code

I made the block code inMicrosoft Makecode. The code should be like in the image. Also, I shared my code. Here is thelink.

In this code, if we press button A, it will show some images first and then, turn on the LED for the left eye, and rotate the left hand. It will have the same condition if we press button B, only this time for the right side.

Step 6: Advance Code for Making the Robot Talks and Understand the Code

In making the robot talks, it cannot be done with a coding block. To overcome this problem, we need to convert all the codes into Python. Here is the link for Python Editor foronlineandoffline(you need to download it first).

Before converting, try to convert all codes in Makecode by using the Python language. Turnout, the converting is not compatible with the Python editor. We need to change few codes, so Python can understand the code. Here is the偏好链接for Python codes.

For all the codes in Python, click thislink.

以下是对代码的解释。

To rotate the servo in pin 1 in Microbit and pause 1000 milliseconds (1 second)

pin1.write_analog(180) sleep(1000)

To turn on the LED eye in pin 1 in Microbit and pause 1000 milliseconds (1 second)

pin1.write_digital(0) sleep(1000)

要使机器人谈话,首先导入语音模块。我使用了2种类型的讲命令,这些命令是“speed.ronouse”和“sexpool.say”。

使用“speem.say”时,我们需要在命令作为参数后添加一些单词。

speech.say("Let's play with me.", speed=92, pitch=60, throat=190, mouth=190)

We want the robot to talk " Let's play with me." With speed, pitch, throat, and mouth as we desired. To know more about these parameters, click thispreference guide.

When we use "speech.pronounce", we use Phonemes as the parameter. For more information about phonemes, click thislink.

演说。张力(“Woh5oh3t Ahahr Yuhuh Duhuhihhnx Nnahah3uh5uh8”,Speed = 92,间距= 60,咽喉= 190,口= 190)

In the code above, we make the robot to talk, "What are you doing now?"

Just play around with the speech command as you desired.

保存并下载到十六进制文件中的代码。

Step 7: Enclosure

To make the enclosure for the robot, I made it in Tinkercad.

For download, clickCults3d.

第8步:Microbit案例

We need to build the case for Microbit, so the Microbit could stand in place in the body of the robot. To make it, I used the simple shape of a box with dimension:

Length: 66 mm

Width: 21 mm

Height: 50 mm

用一些盒子孔切箱,如图片所示。为了使其更容易,请使用TinkerCAD电路的微生物功能。

Step 9: Body- Front Part

For the front body, drop a box in the work area. Make a hole in the cylinder on the top with the same measurement as the hole in the head. Make some holes for the speaker,
微钻头,届e servo. Add four placeholders for placing the screws on each corner.

Step 10: Body- Back Part

For the back part of the body, use two boxes, and stack them. The dimension should be the same as the front part of the body and the head. Group them together.

Step 11: Legs

For the legs, use a box and combine it with a wedge. For the dimension, see the images. Group them together.

Step 12: Hands

For making hand, drag and drop two roofs into the work area. Cut each roof with a box hole. Group them together. Duplicate the hands, so you have two hands now.

Step 13: Head

用一个盒子的头部。为头部的后部制作一些孔。为螺丝制作占位符。

第14步:嘴巴

For the mouth, use a sphere and resize it as shown in the image.

Step 15: Tail

Make the same shape as a mouth for the tail, only it is wider.

Step 16: Prototype and Test

在进行电子项目时,在组装电子电路之前使原型是至关重要的。通过构建原型,我们可以测试我们的代码和电路是否正确。测试非常成功。所有电气部件都在顺利工作。

Step 17: Printing

Save each of the parts of the 3D Model into .stl files. Using Cura slicer, slice the .stl files and print them with the color of PLA filament as you desired. The printing settings are layer height 0.2 mm, infill 20%, using brim, and no support, except the Microbit case.

Step 18: After Printing

Remove the support in the Microbit case after printing.

Step 19: Drilling After Printing

Make holes for the eyes to the head casing. I use a Makita drill to make the holes. Drill two holes in the head and measure the holes for LED about a diameter of 5 mm. Also, drill five holes for bolting the body and drill two more holes for bolting the hands.

Step 20: Tidying the Speaker

我用来自旧麦克风套装的扬声器。因为它,扬声器的边缘并不整洁。使用Dremel旋转工具切割过量的扬声器和文件。

Step 21: Assemble the Printing Parts

Glue the mouth to the front body. Glue the tail to the back part of the body. Assemble the legs to the body and finally, glue the head to the body.

Step 22: Build the Electrical Circuit

  • 把微生物放在案件中。
  • Insert alligator clips to pin 0 (red), 1 (yellow), 2 (white), and Gnd (black).
  • 如图所示,将伺服系统放在每侧,并将它们粘贴到身体上。
  • 用电线焊接LED。红线连接到LED和黑线的正腿连接到负腿。将LED插入头部并用电动胶带固定它们。
  • Connect all the alligator clip wires like in the previous prototype.

Step 23: Construct the Robot

  • Upload the hex file to the Microbit.
  • Put the Microbit and speaker inside the enclosure. Connect the Microbit with the batteries. Tidy up all the wires and secure them with electrical tape.
  • 用螺丝关闭外壳。(我们需要5个小螺丝)。
  • Attach the hands with servos.

Step 24: Final Result and Test the Robot

Here is the final result of the Microbit Talking Robot.

当我们按下按钮A时,它将首先显示一些心灵和微笑的图像,然后打开右眼的LED,并旋转右手。如果我们按下按钮B,它将具有相同的条件,只为左侧的此时间。

Note: I installed Microbit upside down due to the tight enclosure, so the result would be the opposite of my previous code.

For more project ideas, visit our website:
DIY 4 Pro,3D打印Center, andLearning and Assignments

阻止代码竞赛

First Prize in the
阻止代码竞赛

1人制作这个项目!

Recommendations

  • Pi日速度挑战

    Pi日速度挑战
  • Trash to Treasure Contest

    Trash to Treasure Contest
  • 雕刻和雕刻挑战

    雕刻和雕刻挑战

8 Comments

1
欧姆实验室

17 days ago

Good but so many steps!
My advice is to make less steps for more views............but great project!mate

0
7857625957

4 weeks ago

hi im new

0
gladysaco.26910

27天前回复

嗨,我也是新的

0
Mulia Wi

6周前回复

谢谢

0
BrittLiv

8 weeks ago onStep 24

Aww, it is really cute! I love it!

0
Mulia Wi

Reply 8 weeks ago

Thanks for your kind comment, Britt.