2017-5-12 20:00:37 [显示全部楼层]
6938浏览
查看: 6938|回复: 8

[进阶] 创客礼物 | 这条魔法项链告诉你,气温也是有色彩的

[复制链接]
母亲节又要到了
孝顺的你还在为送什么礼物而感到发愁吗

有位酷爱文艺与科技的创客妈咪
就给自己制作了一条项链

然而与普通手工艺品不同的是
它不仅能做配饰与各种衣服百搭
还能实时感知气温并变幻出不同的颜色

当气温较为凉爽时(20℃-25℃),呈现翡翠绿;
当气温相对较热时(高于25℃),呈现珊瑚红;
当气温相对较冷时(低于25℃),呈现宝石蓝;

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图1

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图2

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图3

梦幻的颜色配合复古的吊坠
美的不像真的!

怎么做到的?
▼▼▼

教程专区

材料清单(*部分硬件来自Lilypad Kit)
Arduino控制器、温度传感器、RGB LED、鳄鱼夹,剥线钳、装饰项链,毛毡,针线、剪刀、热熔胶枪等

制作过程
1.电路搭建;可先用鳄鱼夹搭建整个电路进行测试,具体连接方式如下图所示:
创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图4

2.上传代码
[mw_shl_code=applescript,true]  /*
* This program shows different light colors according to the current ambient temperature:
* It gives a green color to indicate the cool weather (68 to 78 degrees Fahrenheit).
* A red color is shown when the weather is relatively hot (above 78 degrees Fahrenheit)
* and a blue one to represent the cold weather (below 68 Fahrenheit).
*
* Written by Tahani Almanie
*/

int tempSenPin = A2; // Temperature sensor connected to analog pin A2
int tempReading;    // This variable for the sensor reading
float voltage;      // This variable for the voltage value of the sensor
float tempC;         // This variable for the Centigrade temperature
float tempF;         // This variable for the Fahrenheit temperature

int redPin = 9;     // R on RGB LED connected to digital pin 9
int greenPin = 11;  // G on RGB LED connected to digital pin 11
int bluePin = 10;   // B on RGB LED connected to digital pin 10

void setup()
{
    Serial.begin(9600);  //Start the serial connection to view the sensor readings
}

void loop()
{
   //getting the reading from the temperature sensor
   tempReading = analogRead(tempSenPin);

   // converting that reading to voltage
   voltage = tempReading * 4.15 / 1024.0;
   // print out the voltage
   Serial.print(voltage); Serial.println(" volts");
   
   // converting that voltage to Centigrade temperature
   tempC = (voltage - 0.5) * 100 ;
   // print out the Centigrade temperature                                             
   Serial.print(tempC); Serial.println(" degrees C");
   
   // converting Centigrade to Fahrenheit
   tempF = (tempC * 9.0 / 5.0) + 32.0;
   // print out the Fahrenheit temperature
   Serial.print(tempF); Serial.println(" degrees F");

   //waiting 1 second
   delay(1000);

   lightColor();
}

void lightColor()   
{
         if (tempF >= 78 )              //hot ambient gives a red light
            generateColor(255,0,0);      

         else if (tempF>=68 && tempF<78)//nice ambient gives a green light
            generateColor(0,255,0);        

         else                           //cold ambient gives a blue light
            generateColor(0,0,255);            
}  

void generateColor(int red, int green, int blue)
{  
         analogWrite(redPin, 255-red);   
         analogWrite(greenPin, 255-green);  
         analogWrite(bluePin, 255-blue);   
}[/mw_shl_code]
3.项链制作
准备所有材料和工具。
创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图5

将导线螺旋编织并穿过项链。
创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图8

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图9

电源固定在主控器的背面,连接控制器和温度传感器各端口的导线。

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图11

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图12

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图13

剪几个大小合适的圆片,用针线将其缝成口袋,然后把控制器、温度传感器裹起来。

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图6

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图7

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图14

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图15

把导线另一侧的RGB LED模块放入吊坠内部。

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图10

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图16

也可以在吊坠内部用圆片遮挡,这样LED光线显得不那么刺眼。

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图17

把吊坠合上,作品完工。

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图18

创客礼物 | 这条魔法项链告诉你,气温也是有色彩的图19



怎么样,你心动了吗?
如此又唯美又有科技含量的项链
制作工艺也不复杂
赶紧给母上大人也制作一条吧






本帖被以下淘专辑推荐:

  • · |主题: 32, 订阅: 1

dsweiliang  初级技神

发表于 2017-5-13 08:26:11

后面那坨藏在哪里好?
回复

使用道具 举报

zbl  中级技匠
 楼主|

发表于 2017-5-15 14:05:23

dsweiliang 发表于 2017-5-13 08:26
后面那坨藏在哪里好?

在衣服后面缝个口袋吧;P
回复

使用道具 举报

安卓机器人  中级技神

发表于 2017-5-16 16:32:19

什么样的导线适合??
回复

使用道具 举报

zbl  中级技匠
 楼主|

发表于 2017-5-16 17:24:06

安卓机器人 发表于 2017-5-16 16:32
什么样的导线适合??

其实没有特别要求,感觉只要编织的好看就行了
回复

使用道具 举报

安卓机器人  中级技神

发表于 2017-5-16 19:00:58

渐变色,呼吸灯等都符合生物美,看着让人宁静。
可缝制水洗或按扣随取随安 灵活。
回复

使用道具 举报

zbl  中级技匠
 楼主|

发表于 2017-5-17 10:12:29

安卓机器人 发表于 2017-5-16 19:00
渐变色,呼吸灯等都符合生物美,看着让人宁静。
可缝制水洗或按扣随取随安 灵活。 ...

很好的建议!
回复

使用道具 举报

lollypopyoung  学徒

发表于 2017-7-6 10:17:24

目前有一个Adafruit 1222,串口比较少,想利用起来。求具体的电路搭建方法~~~谢谢~
回复

使用道具 举报

willwii3373  见习技师

发表于 2017-11-9 20:07:26

厉害了 成品 好漂亮啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail