懒人必备法宝---刷牙机
http://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438758992398867.png背景:几周之前,我教小孩子做了一个刷牙机,因为我本身也很喜欢做机器人这类的东西,正好可以借这次课程做一个。我在Reddit上提过,之后很多人留言想要这个教程,所以我就写了这篇教程,现在我们就开始吧!
第一步:材料
1.MeArm的机器手臂2.玩滑板用的头盔,这个很便宜3.Arduino UNO4.SainSmart 的舵机罩5.你喜欢的牙刷
我身边就有这些材料,你要是买的话,估计会花140刀左右。
第二步:组装机械手臂
我先组装了机械手臂,大家按照MeArm的教程来组装就行。我安装的时候省略了步骤2,3,即组装底座的步骤。也省略了步骤18,19,20,没安装机器臂的手爪。
第三步:安装牙刷http://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438758928167683.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759025521566.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759036494161.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759049908817.jpg http://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759054877268.jpg http://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759063653429.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759144514999.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759151970050.jpg
在机器手臂的末端,我没安装手爪,安了牙刷。安牙刷的时候,我反复试验了很多次,才找到一个好方法。(我没用多余的零件,因为我很懒。。)安装牙刷的时候,我用了图一所示的零件,这是机器手臂剩下的套件。我从剩下的套件里挑了一个最大的零件,在牙刷头上钻两个洞,和零件上最上面的两个孔对上,然后用尖头螺丝固定就可以了。用两个螺丝将如图所示的其他两个零件固定到最大的零件上。确保最大的零件是背向牙刷的。然后用剩下的三个螺丝等将它们都固定在机器手臂上。
第四步:改造头盔http://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759186446045.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759194909644.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759201662819.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759214464756.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759227751600.jpg
在头盔的正面钻一个舵机马达大小的洞。我先用钻孔机沿着舵机马达的轮廓钻了一个洞,然后用刀把它弄掉。之后。我在机器手臂剩的套件中找了一个零件,如图所示,在头盔上钻4个洞,正好能和零件上的孔对齐就行。现在安装舵机,安好之后,把零件安上。零件上面两个孔用长螺丝钉和螺栓固定,下面两个孔用短螺丝钉固定。螺丝钉的头要在头盔的里面,要不然它们就会妨碍机器手臂移动了。
第五步:将机器手臂安装到头盔上http://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759259742949.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759274666197.jpg
现在要安装机器手臂,安的时候,要保证机器手臂上的舵机摆臂安在头盔的舵机马达上。一定要保证机器手臂安好了,这样你才可以左右移动舵机马达。用MeArm组件里面的小的黑色螺丝钉固定。
第六步:安装Arduinohttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759306105721.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759315884014.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759332205879.jpg
现在我要把Arduino安到头盔上了。如果你还没安呢,就将舵机罩安装到Arduino UNO上。我拿了一根坏的头绳,放在Arduino和舵机罩之间,然后将头绳从头盔上的两个孔中穿进去。确保Arduino上USB口是朝向头盔的背面的。
第七步:连接舵机马达http://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759354483523.jpghttp://www.ingchuang.com/static/ueditor/php/upload/image/20150805/1438759373297512.jpg
将舵机马达上的线从绑住Arduino的那个孔中拉出来,将它连到舵机罩的引脚7上。然后将机器臂下臂连到引脚6上,上臂连到引脚8上。第八步:编程
下面是我写的程序,你可以根据实际情况(比如你的脸的尺寸)来调整一下代码。// Written by Simone Giertz
#include <Servo.h>
Servo servo;
// base, upper arm, lower arm
static const int servoPin = {7,8,6};
void setup()
{
Serial.begin(9600);
for(int i=0; i<3; i++){
servo.attach(servoPin);
}
// Fold the robot arm at the top of the helmet
servo.write(90); // base
servo.write(30);// upper arm
servo.write(150);// lower arm
}
void loop()
{
// Wait five seconds before we start the toothbrushing
delay(5000);
// Put the arm in brushing position
servo.write(180);
servo.write(90);
servo.write(70);
delay(1000);
// brush back and forth
for(int i = 0; i<10; i++){
servo.write(60);
delay(200);
servo.write(120);
delay(200);
}
// Fold the robot arm back up
servo.write(90);
servo.write(30);
servo.write(150);
}
很有意思,不过会不会把牙龈弄疼,如果控制牙刷使其和人的感觉互联呢? 不同的人需要不同的尺码吧 丄帝De咗臂 发表于 2015-8-6 07:23
不同的人需要不同的尺码吧
你是说头盔吗?:lol luna 发表于 2015-8-6 10:25
你是说头盔吗?
他是说牙刷 hnyzcj 发表于 2015-8-6 13:18
他是说牙刷
脑袋大的也需要不同的尺码选择~ luna 发表于 2015-8-6 13:54
脑袋大的也需要不同的尺码选择~
脑袋大的,脸长的都需要 呵呵,我也担心这个,有识别么?要是不小心刷到鼻子就好痛痛呢~~~ 刷个牙真是折腾,不过看代码好像不是很难的样子 吹口琴的钢铁侠 发表于 2015-8-7 14:29
刷个牙真是折腾,不过看代码好像不是很难的样子
同意同意 厉害了。。。 懒人懒得做这个
页:
[1]