最机智 发表于 2016-9-9 17:43:11

8266+arduino助力表白,带着你的七彩祥云去找她吧!(附上.....

七彩祥云我没有,可是七彩灯我可以做出来!可以用app控制颜色,完全DIY,完全开源。你喜欢吗?
http://static.oschina.net/uploads/space/2016/0909/155547_tCcu_290008***本作品希望通过将一个普通的小夜灯用很低的成本改造成手机来控制的无线wifi小彩灯。
作品所使用的BOM清单

[*]欧普小夜灯1个
[*]AC220转DC5V 电源模块 1个
[*]ESP8266   1片
[*]arduino pro mini 1片
[*]8位 WS2812 5050 RGB LED1个
[*]3.3V稳压板                           1块
[*]|贴片电阻、电容飞线若干
制作过程
1、从手头找了一个普通的小夜灯.
http://static.oschina.net/uploads/img/201609/09163749_mygk.jpg         http://static.oschina.net/uploads/img/201609/09163749_NEi3.jpg


http://static.oschina.net/uploads/img/201609/09163749_x2wQ.jpg       http://static.oschina.net/uploads/img/201609/09163751_JlWr.jpg



2、小心的打开外壳,里面是很简单的阻容降压电路,顶部有一个电源开关。阻容降压电路能够提供的电流很小,我们需要将其中的电路板全部取出来,只留下开关和线。

3、下一步需要将我们的电源模块以及esp8266的最小系统(详见下图)放进这个小盒子里面,里面有一些固定用的槽需要用刀修理修理,以便电源模块能顺利的放进去。
    http://static.oschina.net/uploads/img/201609/09163752_fw4P.png

http://static.oschina.net/uploads/img/201609/09163754_zuhP.jpg

4、该电源模块高度正合适放进小夜灯里面,而且封装好了,不会产生漏电现象。输入220V ,输出5V, ESP8266 需要3.3V电压供电,据说5v也可以,为了保险起见还是加入3,3V稳压板。全部塞进去,一定要做好220V电的绝缘。

   
为了不破坏原有小夜灯外形,我们需要将原电源开关改造一下:

[*]    220V电源直接进入电源模块,开关通过一个下拉电阻接入到ESP8200的GPIO口2,设置为输入模式,当开关闭合时超过3秒时小夜灯亮起绿色灯,进入airlink模式;快速开关小夜灯开关,小夜灯亮起红色灯,进入AP模式。
[*]    ws2812 8位 WS2812 5050 RGB LED   是内置驱动的彩色led灯板,只需要一个io口既可以驱动 很多灯头。焊接好电源,将灯板上的IN链接到 ESP8266的一个GPIO口8上。
[*]http://static.oschina.net/uploads/img/201609/09163754_HuvI.jpg


http://static.oschina.net/uploads/img/201609/09163756_tAsN.jpg      


http://static.oschina.net/uploads/img/201609/09163757_b6PT.jpg

http://static.oschina.net/uploads/img/201609/09164121_auWT.jpg

http://static.oschina.net/uploads/img/201609/09164318_vRUb.jpg

http://static.oschina.net/uploads/img/201609/09164439_1g5E.jpg

5、盖上盖子,完全看不出里面发生了什么变化,下面就是ESP8266固件程序,以及上位机APP程序的编写了。
http://static.oschina.net/uploads/img/201609/09164439_9xTZ.jpg



http://static.oschina.net/uploads/img/201609/09164443_HPPa.jpghttp://static.oschina.net/uploads/img/201609/09164443_oYJo.png

数据点定义
http://static.oschina.net/uploads/img/201609/09164443_kR9Y.jpghttp://static.oschina.net/uploads/img/201609/09164444_wyYZ.jpg

arduino库文件:
程序文件:
作者:来自山东威海的晕船海盗
转载自机智云论坛

页: [1]
查看完整版本: 8266+arduino助力表白,带着你的七彩祥云去找她吧!(附上.....

Baidu
map