Noduino OpenLight CN
(→Notes) |
(→BP5926B+BP2876D) |
||
(未显示1个用户的54个中间版本) | |||
第1行: | 第1行: | ||
+ | == Notes == | ||
+ | '''Roadmap 2021''' | ||
+ | * 2021/01: 影视级高品质照明尝试 | ||
+ | * 2021/02: 球泡高品质升级,尝试一体铝基板,ESP8285 主控,0805 (1/8W) 限流 | ||
+ | * 2021/03: 球泡多个绑定,mesh | ||
+ | * 2021/04: 球泡一体铝基板,ESP32 主控 | ||
+ | |||
+ | <br> | ||
== 概述 == | == 概述 == | ||
第6行: | 第14行: | ||
OpenLight 球泡灯: | OpenLight 球泡灯: | ||
− | [[文件: | + | [[文件:Openlight-bulb-1024.jpg | 760px]] |
− | + | ||
− | + | ||
OpenLight 独立控制器: | OpenLight 独立控制器: | ||
− | [[文件:OpenLight- | + | [[文件:OpenLight-ceiling-1-1280.jpg | 760px]] |
− | [[文件:Openlight-ctrl-demo.jpg | | + | |
+ | [[文件:OpenLight-ceiling-4-1280.jpg | 760px]] | ||
+ | |||
+ | [[文件:Openlight-ctrl-demo.jpg | 760px]] | ||
第99行: | 第108行: | ||
var http_req = require('/usr/local/lib/node_modules/request'); | var http_req = require('/usr/local/lib/node_modules/request'); | ||
http_req.post( | http_req.post( | ||
− | 'http:// | + | 'http://api.noduino.org/user/token', |
− | { json: {user_id: opt.username | + | { json: {user_id: opt.username} }, |
function (error, response, body) { | function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | if (!error && response.statusCode == 200) { | ||
第108行: | 第117行: | ||
var MQTTClient = require('MQTTClient').Client; | var MQTTClient = require('MQTTClient').Client; | ||
− | var client = new MQTTClient(' | + | var client = new MQTTClient('mqtt.noduino.org', 1883, opt); |
client.connect(function () { | client.connect(function () { | ||
console.log("connect ok!"); | console.log("connect ok!"); | ||
第151行: | 第160行: | ||
var http_req = require('/usr/local/lib/node_modules/request'); | var http_req = require('/usr/local/lib/node_modules/request'); | ||
http_req.post( | http_req.post( | ||
− | 'http:// | + | 'http://api.noduino.org/user/token', |
{ json: {user_id: opt.username, app_id:"mj2030064278", app_key:"0077d4829f52b1b2d668f8a82c5f5ded"} }, | { json: {user_id: opt.username, app_id:"mj2030064278", app_key:"0077d4829f52b1b2d668f8a82c5f5ded"} }, | ||
function (error, response, body) { | function (error, response, body) { | ||
第160行: | 第169行: | ||
var MQTTClient = require('MQTTClient').Client; | var MQTTClient = require('MQTTClient').Client; | ||
− | var client = new MQTTClient(' | + | var client = new MQTTClient('mqtt.noduino.org', 1883, opt); |
client.connect(function () { | client.connect(function () { | ||
console.log("connect ok!"); | console.log("connect ok!"); | ||
第204行: | 第213行: | ||
var http_req = require('/usr/local/lib/node_modules/request'); | var http_req = require('/usr/local/lib/node_modules/request'); | ||
http_req.post( | http_req.post( | ||
− | 'http:// | + | 'http://api.noduino.org/user/token', |
{ json: {user_id: opt.username, app_id:"mj2030064278", app_key:"0077d4829f52b1b2d668f8a82c5f5ded"} }, | { json: {user_id: opt.username, app_id:"mj2030064278", app_key:"0077d4829f52b1b2d668f8a82c5f5ded"} }, | ||
function (error, response, body) { | function (error, response, body) { | ||
第213行: | 第222行: | ||
var MQTTClient = require('MQTTClient').Client; | var MQTTClient = require('MQTTClient').Client; | ||
− | var client = new MQTTClient(' | + | var client = new MQTTClient('mqtt.noduino.org', 1883, opt); |
client.connect(function () { | client.connect(function () { | ||
console.log("connect ok!"); | console.log("connect ok!"); | ||
第351行: | 第360行: | ||
<source lang=bash> | <source lang=bash> | ||
− | $ git clone --recursive git://github.com/ | + | $ git clone --recursive git://github.com/noduino/noduino-sdk.git noduino-sdk |
</source> | </source> | ||
第447行: | 第456行: | ||
== 硬件原理 == | == 硬件原理 == | ||
− | === LED | + | === Cree LED === |
− | + | '''XLamp XHP70.2:''' | |
+ | * 7 x 7 mm | ||
+ | * 6V, 12V | ||
+ | * 4800, 2400 mA | ||
+ | * 29 W | ||
+ | * 125 ° | ||
+ | * 3408 Lum @4000K 70CRI | ||
− | * | + | * [https://www.cree.com/led-components/media/documents/ds-XHP702.pdf XHP70.2 Datasheet] |
− | * | + | * [https://www.cree.com/led-components/media/documents/ds-XHP702.pdf XHP70 Datasheet] |
− | * | + | * https://www.cree.com/led-components/products/xhp-family-leds/xhp-leds |
− | + | ||
+ | <br> | ||
+ | |||
+ | === LED 灯珠 === | ||
LED 灯珠 (5730) 单颗特性为: | LED 灯珠 (5730) 单颗特性为: | ||
第467行: | 第484行: | ||
LED 灯珠其实就是一个二极管,只要有一个正向导通电压 (VF) 就能发光,一般为 2 - 3.5V,低于此电压灯珠不能发光,高于此电压,灯珠会烧坏。 | LED 灯珠其实就是一个二极管,只要有一个正向导通电压 (VF) 就能发光,一般为 2 - 3.5V,低于此电压灯珠不能发光,高于此电压,灯珠会烧坏。 | ||
− | + | ||
+ | '''LED 伏安特性:''' | ||
+ | |||
+ | [[文件:LED-V-I.jpg]] | ||
+ | |||
+ | * 高于开启电压,LED 发光, 开启电压对不同 LED 其值不同,GaAs 为 1V,红色 GaAsP 为 1.2V,GaP 为 1.8V,GaN 为 2.5V | ||
+ | * 随着电压升高,电流指数级增大。。。 | ||
+ | * 温度越高,开启电压越低,上述伏安曲线图,整体向左平移。。。 | ||
+ | |||
+ | |||
+ | '''>>''' 控制灯珠亮度的,是电流大小,因此调光灯实际调得是电流的大小。电流超过额定电流,会加速灯珠老化,缩短灯珠寿命: | ||
+ | |||
+ | |||
+ | '''OpenLight 16W 3200K 白光吸顶盘实测:''' | ||
+ | |||
+ | * RGBW = 255, 四路电压 11.50V; 11.5V/4 = 2.875V | ||
+ | * RGBW = 186, 四路电压 11.08V | ||
+ | * RGBW = 125, 四路电压 10.50V | ||
+ | * RGBW = 051, 四路电压 09.86V | ||
+ | * RGBW = 005, 四路电压 09.43V; 9.43V/4 = 2.35V | ||
<br><br> | <br><br> | ||
+ | |||
+ | === 高显 LED 灯珠 === | ||
+ | |||
+ | * 蓝光 LED + YAG 荧光粉的二基色白光 LED 的显色指数一直徘徊在60—80之间,其主要原因是在YAG光谱中,缺少红光部分的光谱,使获得的白光LED的一般显色指数偏低。 | ||
+ | |||
+ | 提高传统蓝光 LED + YAG 荧光粉的二基色白光 LED 显色指数的方法是增加其白光光谱中的红光辐射成分,比如加入一个红光 LED,通过调整电流来调整白光和红光的亮度,然后测量显色指数等色度学参数,获得白光和红光的配比。这种方式的缺点是耗时繁琐。 | ||
+ | |||
+ | <br><br> | ||
+ | |||
+ | === FP7102 === | ||
+ | |||
+ | * 输入电压:3.6V ~ 28V | ||
+ | * 输出电压:2V ~ 25V | ||
+ | * 输出电流:2A | ||
+ | * 最大 50W = 25V x 2A,生猛! | ||
+ | * 效率:93% | ||
+ | * 工作频率:320KHZ | ||
+ | * 内置MOS为低内阻 PMOS | ||
+ | * 4mA 超低工作电流 | ||
+ | * 内置:过温,过流,软起动保护 | ||
+ | |||
+ | |||
+ | [[文件:FP7102.png | 700px]] | ||
+ | |||
+ | |||
+ | [http://www.feeling-tech.com.tw/km-master/ezcatfiles/cust/img/img/24/fp7102v02-lf.pdf FP7102 datasheet] | ||
+ | |||
+ | |||
+ | * R2 为限流电阻,Imax = 0.25V / R2 | ||
+ | * 芯片最大输出 2A,因此 R2 一定要大于 0.13Ω = 0.25V/ 2A | ||
+ | * 比如 12 颗 0.5W 5730 白光 LED,极限 0.15A x12 = 1.8A, R2 = 0.25V/1.8A = 0.139Ω | ||
+ | * FP7102 的输出电压随所接之 LED 拓扑而变化,最多支持 28V/3V = 9 颗串 | ||
+ | |||
+ | <br> | ||
+ | |||
+ | === BP5926B+BP2876D === | ||
+ | |||
+ | [[文件:BP2876-BP5926.png]] | ||
+ | |||
+ | [http://www.elecfans.com/d/1016966.html BP5926B+BP2876D 调光调色系统方案分析] | ||
+ | |||
+ | [https://www.big-bit.com/meeting/2018gzled/images/hhbd/jfmyyjppt002.pdf 上海晶丰明源智能照明方案介绍] | ||
+ | |||
+ | [http://www.bpsemi.com.cn/uploads/file/20181017105105_356.pdf BP5926 Datasheet] | ||
+ | |||
+ | <br> | ||
=== MY9291 === | === MY9291 === | ||
− | + | 台湾明阳 4 通道恒流 LED 驱动芯片,可控制 R, G, B, W 四路 LED 灯珠 | |
第504行: | 第586行: | ||
最大输出电流限制: | 最大输出电流限制: | ||
− | R = | + | R = 0.38V / Iout |
满输出 350mA,则每路的限流电阻都得选为:1R,1/4 W 够用 | 满输出 350mA,则每路的限流电阻都得选为:1R,1/4 W 够用 | ||
− | OpenLight | + | * OpenLight 球泡早期 5 颗 2R7,RGBW 限流电阻分别为 2.7, 2.7, 2.7, 1.2,限流 140mA, 140mA, 140mA, 300mA |
+ | * OpenLight 球泡后期 5 颗 4R7,RGBW 限流电阻分别为 4.5, 4.5, 4.5, 2.2,限流 84mA, 84mA, 84mA, 172mA | ||
− | + | * OpenLight 球泡 RGBW 灯,R/G/B 选用电阻 4R7,限流为 81mA 左右,W 用两个 4R7 并联 2.35R 左右,限流为 162mA 左右。这样基本限制经过每颗 5730 (0.5W) 灯珠的电流为 80mA 左右,以延迟灯珠老化。这样整体功率被限制在 5W,如要增加亮度,可将这 5 个 4R7 电阻替换为 3R0,可将输出功率增加到 7W | |
+ | * OpenLight 球泡 WWWW 灯,选用电阻 2R7,限流为 141mA | ||
+ | * OpenLight 控制器,1R2 限流为 317mA,1R3 则限流为 269mA,可酌情选用 | ||
+ | |||
+ | <br> | ||
+ | |||
+ | === 其他 === | ||
* MY9231 3 通道恒流 LED 驱动芯片 | * MY9231 3 通道恒流 LED 驱动芯片 | ||
* MY9221 12 通道恒流 LED 驱动芯片 | * MY9221 12 通道恒流 LED 驱动芯片 | ||
− | |||
<br><br> | <br><br> | ||
− | == | + | === 可选方案 === |
− | + | OpenLight 铝基板上,LED 灯珠默认布局为: | |
− | + | * Red LED 6 颗串联,正极接 12V,负极接控制板 R (MY9291 之 OUTA) | |
+ | * Green LED 4 颗串联,正极接 12V,负极接控制板 G (MY9291 之 OUTB) | ||
+ | * Blue LED 4 颗串联,正极接 12V,负极接控制板 B (MY9291 之 OUTC) | ||
+ | * White LED x8 (4 颗串联为一组, 2 组并联,正极接 12V,负极接控制板 W (MY9291 之 OUTC)) | ||
<br><br> | <br><br> | ||
− | === | + | === Schemmatics === |
− | + | [[文件:Noduino-open-light-v2.4-sch.png | 1000px]] | |
− | + | <br><br> | |
− | + | == 电源 == | |
− | + | === 恒压 === | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | * 12V 1A 恒压电源模块,额定 12W。PLF12A/12V,66mm x 31mm x (24-2)mm,适用外壳 C-003(外部 80x35x23mm,内部 67x30x21mm) | |
− | [[ | + | * 12V 3A 恒压电源模块,额定 36W。GPN30F/12V,100 x 50mm x (31-2) mm,适用外壳尺寸 157x54x36mm 阻燃PCV0 [型号8203] |
+ | * [http://wiki.jackslab.org/Power#MP2359 常用电源芯片] | ||
<br><br> | <br><br> | ||
− | === | + | === 恒流 === |
− | + | 市面上销售的 LED 恒流源,都会标注输出电流多少、电压范围啥的: | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | * 输出电流 270mA、输出电压 36~63V(标 12-18x1W),则 5730 (150mA) 两并 (300mA) 支持 12 ~ 21 串(最大建议 -3 为 18 串),串少了(烧芯片)多了(点不亮)都不行 | |
− | + | * 输出电流 270mA、输出电压 24~42V(标 8-12x1W),则 5730 (150mA) 两并 (300mA) 支持 8 ~ 14 串(最大建议 -2 为 12 串) | |
+ | * 输出电流 220~240mA、输出电压 24~85V(标 8-24W) | ||
<br><br> | <br><br> | ||
第571行: | 第650行: | ||
* [[Noduino]] | * [[Noduino]] | ||
+ | * [http://wiki.jackslab.org/Power#MP2359 常用电源芯片] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<br><br> | <br><br> |
2021年2月16日 (二) 12:00的最后版本
目录 |
[编辑] 1 Notes
Roadmap 2021
- 2021/01: 影视级高品质照明尝试
- 2021/02: 球泡高品质升级,尝试一体铝基板,ESP8285 主控,0805 (1/8W) 限流
- 2021/03: 球泡多个绑定,mesh
- 2021/04: 球泡一体铝基板,ESP32 主控
[编辑] 2 概述
OpenLight 球泡灯:
OpenLight 独立控制器:
[编辑] 3 Quick Start
快速上手视频:http://v.youku.com/v_show/id_XMTY1MTMzMjA0NA==.html
- 灯通电,等待 8 s左右
- 灯在红色渐变,表示灯在等待配网
- 如果不在红色渐变,请开关三次(开 – 灯亮 – 关,重复三次),可进入红色渐变等待配网状态
- 手机连接 WiFi 路由,微信扫描右侧二维码,点击 ”配置设备上网“
- 按提示输入 WiFi 密码,点 “连接”,等待配网完成(注意,设备不支持 5G WiFi,只支持 2.4G;另外企业级安全认证也不支持)
- WiFi 配置完成后,微信自动进入局域网发现设备模式,其会列出设备列表
- 点击第一个设备,进入页面,在页面最下面会有 “绑定设备” 按钮 (如果已经绑定过改设备,最下面的按钮为“进入公众号”),点击按钮,完成设备绑定
- 完成后,点“进入公众号”,在公众号菜单的 “智能设备”,即可列出你绑定的所有设备,点一个设备,即可进入设备控制页
- 其他说明:
- 其他人需要控制设备,需要先连接到同样的路由器,在设备通电的情形下,扫描同样的二维码,点“设备已联网,跳过此步”,直接“发现”、“绑定设备” 即可在公众号菜单“智能设备里控制
- 灯泡要迁移到其他的路由,可开关三次,扫描二维码配一下网络即可,无需再绑定
- 灯泡从家移到公司,找不到原来的路由会自动进入等待配网状态(红色渐变),扫描二维码配一下网络即可
- 开关 6次(开 – 灯亮 – 关,重复 6次),可恢复出厂设置
[编辑] 4 Open API
Afer you guys 'Link Device' in WeChat, Enter Official Account:
- click "Devices" to list your binding devices
- select your OpenLight in the list, enter control page, click upright corner, then Copy URL
- paste the URL into web browser (Chrome or Safari) to access the control page in browser
- check the source code of the page to get the following variables:
var devid = YOUR_DEVICE_ID; var mqtt_uname = xxxxxxxx; var mqtt_pass = TTTTTTTTTTTTTTTT; < ---- 3600s life time var mqtt_server = xxx.xxx.xxx.xxx; var mqtt_port = xxx;
[编辑] 4.1 node.js
Prepare the node.js:
# download the node-v6.9.1-xxx.tgz from http://nodejs.org $ tar xf node-v6.9.1-*.tar.xz $ sudo cp -a node-v6.9.1*/* /usr/local/ $ sudo npm install -g MQTTClient $ sudo npm install -g request
[编辑] 4.1.1 Turn Off
Using the node.js to switch off the OpenLigh:
$ cat light-off.js #! /usr/bin/env node var opt = { username: "YOUR_mqtt_uname", password: "" }; var http_req = require('/usr/local/lib/node_modules/request'); http_req.post( 'http://api.noduino.org/user/token', { json: {user_id: opt.username} }, function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body); opt.password = body.user_token; var MQTTClient = require('MQTTClient').Client; var client = new MQTTClient('mqtt.noduino.org', 1883, opt); client.connect(function () { console.log("connect ok!"); var pubopt = { qos_level: 2 }; var state = { on: 0 <---- off }; var data = '{"m":"set", "d":{' + '"s":' + state.on + '}}'; client.publish('app2dev/YOUR_DEVICE_ID', data, pubopt, function (message_id) { console.log("public ok! message_id = " + message_id); process.exit(0); }); }); } else { console.log("Request the user token failed"); process.exit(1); } } ); $ ./light-off.js
[编辑] 4.1.2 Turn On
Turn on the OpenLight:
$ cat light-on.js #! /usr/bin/env node var opt = { username: "YOUR_mqtt_uname", password: "" }; var http_req = require('/usr/local/lib/node_modules/request'); http_req.post( 'http://api.noduino.org/user/token', { json: {user_id: opt.username, app_id:"mj2030064278", app_key:"0077d4829f52b1b2d668f8a82c5f5ded"} }, function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body); opt.password = body.user_token; var MQTTClient = require('MQTTClient').Client; var client = new MQTTClient('mqtt.noduino.org', 1883, opt); client.connect(function () { console.log("connect ok!"); var pubopt = { qos_level: 2 }; var state = { on: 1 <---- on }; var data = '{"m":"set", "d":{' + '"s":' + state.on + '}}'; client.publish('app2dev/YOUR_DEVICE_ID', data, pubopt, function (message_id) { console.log("public ok! message_id = " + message_id); process.exit(0); }); }); } else { console.log("Request the user token failed"); process.exit(1); } } ); $ ./light-on.js
[编辑] 4.1.3 Setup Color
Change the color of the OpenLight:
$ cat light-color.js #! /usr/bin/env node var opt = { username: "YOUR_mqtt_uname", password: "" }; var http_req = require('/usr/local/lib/node_modules/request'); http_req.post( 'http://api.noduino.org/user/token', { json: {user_id: opt.username, app_id:"mj2030064278", app_key:"0077d4829f52b1b2d668f8a82c5f5ded"} }, function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body); opt.password = body.user_token; var MQTTClient = require('MQTTClient').Client; var client = new MQTTClient('mqtt.noduino.org', 1883, opt); client.connect(function () { console.log("connect ok!"); var pubopt = { qos_level: 2 }; var state = { red: 0, green: 0, blue: 255, <--------- outputting full power of the blue channel white: 0, on: 1 }; data = '{"m":"set", "d":{' + '"r":' + state.red + ',"g":' + state.green + ',"b":' + state.blue + ',"w":' + state.white + ',"s":' + state.on + '}}'; client.publish('app2dev/YOUR_DEVICE_ID', data, pubopt, function (message_id) { console.log("public ok! message_id = " + message_id); process.exit(0); }); }); } else { console.log("Request the user token failed"); process.exit(1); } } ); $ ./light-color.js
[编辑] 4.1.4 FAQ
If you get the following error:
/usr/local/lib/node_modules/MQTTClient/client.js:56 throw Error('user names are kept to 12 characters or fewer'); ^ Error: user names are kept to 12 characters or fewer
Please patch the /usr/local/lib/node_modules/MQTTClient/client.js to remove the line of checking the length of username and password:
--- a/client.js +++ b/client.js @@ -52,10 +52,10 @@ var Client = exports.Client = function (host, port, options) { options.alive_timer = 30; options.ping_timer = parseInt(options.alive_timer * 0.6 * 1000); // 用户名和密码 - if (typeof options.username == 'string' && options.username.length > 12) - throw Error('user names are kept to 12 characters or fewer'); - if (typeof options.password == 'string' && options.password.length > 12) - throw Error('passwords are kept to 12 characters or fewer'); + //if (typeof options.username == 'string' && options.username.length > 12) + // throw Error('user names are kept to 12 characters or fewer'); + //if (typeof options.password == 'string' && options.password.length > 12) + // throw Error('passwords are kept to 12 characters or fewer'); // Will flag if (options.will_flag && (typeof options.will_topic != 'string' || typeof options.will_message != 'string')) throw Error('missing will_topic or will_message when will_flag is set');
[编辑] 4.2 HTML5
The device control page in WeChat is a H5 page. Using a MQTT client implement in javascript , using the mqttws31.js library:
var client_id = parseInt(Math.random() * 10000, 10) + '_' + mqtt_uname; var client = new Paho.MQTT.Client(mqtt_server, mqtt_port, "/mqtt", client_id); function failConnect(e) { console.log("connect failed"); console.log(e); console.log("reconnecting ..."); client.connect({userName: mqtt_uname, password: mqtt_pass, onSuccess:onConnect, onFailure: failConnect, mqttVersion:3}); } function onConnect() { console.log("onConnect OK!"); subscribe('dev2app/' + devid); } function subscribe(topic) { client.subscribe(topic); } function onMessageArrived (message) { console.log("Arrived Message: [", message.payloadString, "]"); try { job = JSON.parse(message.payloadString); set = job.d; } catch(e) { console.log("JSON object error!"); alert("JSON error, RX data is: " + message.payloadString); return; } if(job.m == 'set' || job.m == 'status') { //console.log("set ui state"); set_ui_state(set); } if(job.m == 'offline') { blockUI(); } } function onDisConnect() { console.log("reconnecting ..."); client.connect({userName: mqtt_uname, password: mqtt_pass, onSuccess:onConnect, onFailure: failConnect, mqttVersion:3}); } function mqtt_publish(msg){ var topic = 'app2dev/' + devid; message = new Paho.MQTT.Message(msg); message.destinationName = topic; client.send(message); console.log("publish message: " + msg); } function mqtt_init() { client.connect({userName: mqtt_uname, password: mqtt_pass, onSuccess:onConnect, onFailure: failConnect, mqttVersion:3}); client.onMessageArrived = onMessageArrived; client.onConnectionLost = onDisConnect; } mqtt_init();
[编辑] 5 极客定制
[编辑] 5.1 编译固件
获取 noduino-sdk:
$ git clone --recursive git://github.com/noduino/noduino-sdk.git noduino-sdk
生成 toolchain (you need Python 2.7):
$ cd noduino-sdk/toolchain $ ./gen.py
编译:
$ cd ../sketch/open-light $ make
[编辑] 5.2 烧写固件
[编辑] 5.2.1 Serial
Prepare a USB2UART board, something like FT232RL or CP2102/CP2104:
Upload firmware throught serial for OpenLight Bulb:
Upload firmware throught serial for OpenLight Controller:
- USB2UART_GND ------> SmartNode_GPIO0 / Bulb_GPIO0
- USB2UAR_GND -----> SmartNode_GND / Bulb_GND
- USB2UAR_RXD -----> SmartNode_TX / Bulb_TX
- USB2UAR_TXD -----> SmartNode_RX / Bulb_TX
Connect USB2UAR_VCC3.3 -----> SmartNode_VCC / Bulb_3V3 at last
ESP8285 will be enter upload mode, we can upload the compiled firmware through serial using following commands in Linux:
$ cd /path/to/noduino-sdk/sketch/open-light $ make produce ESPPORT=/dev/ttyUSB1
In windows:
$ make produce ESPPORT=COM7
COM7 is your USB2UART device
In MAC OS, maybe it's:
$ make produce ESPPORT=/dev/cu.SLAB_USBtoUART
/dev/cu.SLAB_USBtoUART is your USB2UART device
[编辑] 5.2.2 Online
- Login
- Username: noduino
- password: noduino1234
Click the "Add files", select the user1.bin and user2.bin located in /path/to/noduino-sdk/sketch/open-light/build/
Then click "Start upload" to upload the user1.bin and user2.bin into the server temporaily
[编辑] 6 硬件原理
[编辑] 6.1 Cree LED
XLamp XHP70.2:
- 7 x 7 mm
- 6V, 12V
- 4800, 2400 mA
- 29 W
- 125 °
- 3408 Lum @4000K 70CRI
- XHP70.2 Datasheet
- XHP70 Datasheet
- https://www.cree.com/led-components/products/xhp-family-leds/xhp-leds
[编辑] 6.2 LED 灯珠
LED 灯珠 (5730) 单颗特性为:
- 尺寸 5.7 x 3.0 mm
- 最大电流 150mA (0.5W)
- VF 为 3.0 - 3.4V (Red LED为 2.0 - 2.2V)
- 亮度 50 - 55 lm
LED 灯珠其实就是一个二极管,只要有一个正向导通电压 (VF) 就能发光,一般为 2 - 3.5V,低于此电压灯珠不能发光,高于此电压,灯珠会烧坏。
LED 伏安特性:
- 高于开启电压,LED 发光, 开启电压对不同 LED 其值不同,GaAs 为 1V,红色 GaAsP 为 1.2V,GaP 为 1.8V,GaN 为 2.5V
- 随着电压升高,电流指数级增大。。。
- 温度越高,开启电压越低,上述伏安曲线图,整体向左平移。。。
>> 控制灯珠亮度的,是电流大小,因此调光灯实际调得是电流的大小。电流超过额定电流,会加速灯珠老化,缩短灯珠寿命:
OpenLight 16W 3200K 白光吸顶盘实测:
- RGBW = 255, 四路电压 11.50V; 11.5V/4 = 2.875V
- RGBW = 186, 四路电压 11.08V
- RGBW = 125, 四路电压 10.50V
- RGBW = 051, 四路电压 09.86V
- RGBW = 005, 四路电压 09.43V; 9.43V/4 = 2.35V
[编辑] 6.3 高显 LED 灯珠
- 蓝光 LED + YAG 荧光粉的二基色白光 LED 的显色指数一直徘徊在60—80之间,其主要原因是在YAG光谱中,缺少红光部分的光谱,使获得的白光LED的一般显色指数偏低。
提高传统蓝光 LED + YAG 荧光粉的二基色白光 LED 显色指数的方法是增加其白光光谱中的红光辐射成分,比如加入一个红光 LED,通过调整电流来调整白光和红光的亮度,然后测量显色指数等色度学参数,获得白光和红光的配比。这种方式的缺点是耗时繁琐。
[编辑] 6.4 FP7102
- 输入电压:3.6V ~ 28V
- 输出电压:2V ~ 25V
- 输出电流:2A
- 最大 50W = 25V x 2A,生猛!
- 效率:93%
- 工作频率:320KHZ
- 内置MOS为低内阻 PMOS
- 4mA 超低工作电流
- 内置:过温,过流,软起动保护
- R2 为限流电阻,Imax = 0.25V / R2
- 芯片最大输出 2A,因此 R2 一定要大于 0.13Ω = 0.25V/ 2A
- 比如 12 颗 0.5W 5730 白光 LED,极限 0.15A x12 = 1.8A, R2 = 0.25V/1.8A = 0.139Ω
- FP7102 的输出电压随所接之 LED 拓扑而变化,最多支持 28V/3V = 9 颗串
[编辑] 6.5 BP5926B+BP2876D
[编辑] 6.6 MY9291
台湾明阳 4 通道恒流 LED 驱动芯片,可控制 R, G, B, W 四路 LED 灯珠
- 特性:
- 3.3 - 5V 电源电压范围(±10%)
- 每个通道 5 - 350 mA 恒流输出范围
- 可承受最大输出电压 24V,支持多颗 LED 串联
- 外接器件少,仅需四个外接电组来设定四組恆流电流
- 框图:
电源为恒压源,可以多片级联,MCU 的控制线就两个:DI 和 DCK
- 电源电压与灯珠串并联确定:
- 12V 电源的情形,如选用 VF 为 3V 左右的 LED 灯珠,则需要 4 颗串联,这样每颗灯珠分到电压为 3V 左右;2V 左右的灯珠,则需要 6 颗串联
- 24V 电源,则 3V 灯珠 8 颗串联,2V 灯珠 12 颗串联
- 6V 电源,则 3V 灯珠 2 颗串联,2V 灯珠 3 颗串联
- 输出限流
MY9291 单路最大输出 350mA,为节约灯珠寿命,可限制通过灯珠的最大电流以节约灯珠寿命
最大输出电流限制:
R = 0.38V / Iout
满输出 350mA,则每路的限流电阻都得选为:1R,1/4 W 够用
- OpenLight 球泡早期 5 颗 2R7,RGBW 限流电阻分别为 2.7, 2.7, 2.7, 1.2,限流 140mA, 140mA, 140mA, 300mA
- OpenLight 球泡后期 5 颗 4R7,RGBW 限流电阻分别为 4.5, 4.5, 4.5, 2.2,限流 84mA, 84mA, 84mA, 172mA
- OpenLight 球泡 RGBW 灯,R/G/B 选用电阻 4R7,限流为 81mA 左右,W 用两个 4R7 并联 2.35R 左右,限流为 162mA 左右。这样基本限制经过每颗 5730 (0.5W) 灯珠的电流为 80mA 左右,以延迟灯珠老化。这样整体功率被限制在 5W,如要增加亮度,可将这 5 个 4R7 电阻替换为 3R0,可将输出功率增加到 7W
- OpenLight 球泡 WWWW 灯,选用电阻 2R7,限流为 141mA
- OpenLight 控制器,1R2 限流为 317mA,1R3 则限流为 269mA,可酌情选用
[编辑] 6.7 其他
- MY9231 3 通道恒流 LED 驱动芯片
- MY9221 12 通道恒流 LED 驱动芯片
[编辑] 6.8 可选方案
OpenLight 铝基板上,LED 灯珠默认布局为:
- Red LED 6 颗串联,正极接 12V,负极接控制板 R (MY9291 之 OUTA)
- Green LED 4 颗串联,正极接 12V,负极接控制板 G (MY9291 之 OUTB)
- Blue LED 4 颗串联,正极接 12V,负极接控制板 B (MY9291 之 OUTC)
- White LED x8 (4 颗串联为一组, 2 组并联,正极接 12V,负极接控制板 W (MY9291 之 OUTC))
[编辑] 6.9 Schemmatics
[编辑] 7 电源
[编辑] 7.1 恒压
- 12V 1A 恒压电源模块,额定 12W。PLF12A/12V,66mm x 31mm x (24-2)mm,适用外壳 C-003(外部 80x35x23mm,内部 67x30x21mm)
- 12V 3A 恒压电源模块,额定 36W。GPN30F/12V,100 x 50mm x (31-2) mm,适用外壳尺寸 157x54x36mm 阻燃PCV0 [型号8203]
- 常用电源芯片
[编辑] 7.2 恒流
市面上销售的 LED 恒流源,都会标注输出电流多少、电压范围啥的:
- 输出电流 270mA、输出电压 36~63V(标 12-18x1W),则 5730 (150mA) 两并 (300mA) 支持 12 ~ 21 串(最大建议 -3 为 18 串),串少了(烧芯片)多了(点不亮)都不行
- 输出电流 270mA、输出电压 24~42V(标 8-12x1W),则 5730 (150mA) 两并 (300mA) 支持 8 ~ 14 串(最大建议 -2 为 12 串)
- 输出电流 220~240mA、输出电压 24~85V(标 8-24W)
[编辑] 8 参考
- 更多信息访问: