1. Introduction:
1. I saw a snowflake lamp design online some time ago. I wanted to make one, but I couldn’t find the source file and I didn’t want to draw the PCB frame (it’s boring and difficult to draw).
So I put it aside. When I was browsing the open source platform, I saw someone drawing more than one snowflake lantern, all controlled by STM32:
①STM32 snowflake lamp: https://oshwhub.com/chenyuxi/stm32xue-hua-deng
② Snowflake LED lights: https://oshwhub.com/mo-ming-dian-zi/xue-hua-LEDdeng
GOOD, no need to draw an outer frame, just make one when you have nothing to do!
2. Function introduction:
①ESP-12S main control, based on Blinker IoT platform, realizes WIFI network control
②Mobile APP can realize 256 levels of brightness control and full-color color adjustment
③Tmall Elf voice control to realize partial color adjustment (Tmall Elf entry limit)
Front view:
2. Tutorial:
①Software tutorial
1. Download and install Arduino IDE and related libraries
2. Download and install blinker APP and customize control components
3. Modify the program and compile the upload program
4. Bind Tmall Genie (prerequisite is to have a smart speaker)
Detailed tutorial: https://blog.csdn.net/kudianwanjia
②The complete program is downloaded in the attachment. The program code for the mobile APP control part is as follows, it is very simple:
#define BLINKER_PRINT Serial
#define BLINKER_WIFI
#define BLINKER_ALIGENIE_LIGHT
#include "Blinker.h"
#include "Adafruit_NeoPixel.h"
#define PIN 12
#define NUMPIXELS 6
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
char auth[] = "21d4f***74de";
char ssid[] = "12345678";
char pswd[] = "12345678";
/***************手机APP控制程序***************/
//创建颜色组件对象,对应APP中颜色主件的"数据键名"
#define RGB_1 "RGBKey"
BlinkerRGB WS2812(RGB_1);
//用于处理ESP8266收到颜色主件传来的数据的回调函数
void ws2812_callback(uint8_t r_value, uint8_t g_value, uint8_t b_value, uint8_t bright_value)
{
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
//红,绿,蓝三色值组合实现七彩效果
BLINKER_LOG("R value: ", r_value); //红灯值
BLINKER_LOG("G value: ", g_value); //绿灯值
BLINKER_LOG("B value: ", b_value); //蓝灯值
BLINKER_LOG("Rrightness value: ", bright_value); //亮度值
pixels.setBrightness(bright_value);//控制RGB灯亮度
//控制RGB灯颜色,循环一次点亮一颗灯,共点亮 NUMPIXELS 颗灯
//所有灯显示相同颜色
for(int i = 0; i < NUMPIXELS; i++){
pixels.setPixelColor(i, r_value, g_value, b_value);
}
pixels.show();
}
void setup()
{
//初始化串口
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
//网络初始化,设置将要连接的WIFI
Blinker.begin(auth, ssid, pswd);
pixels.begin();
//设置颜色组件的回调函数, 当收到指令时会调用函数ws2812_callback控制彩灯
WS2812.attach(ws2812_callback);
}
void loop()
{
Blinker.run();
}
3. Picture display and video demonstration:
1. Video link: Tmall Elf Sound Controlled Snow Lamp
2. The components are dense. If you have a constant temperature heating station, it is recommended to solder the capacitor. If you are afraid of damaging the lamp with manual welding, you may not solder the capacitor.
3. Manual welding, the lamp is not resistant to high temperatures. Be careful when welding. Don’t damage the lamp. If the welding time is too long and no video is recorded, just follow the silk screen welding process.
PCB and finished product pictures:
Front view:
Rear view:
Demo video
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet