张小哥

Tmall Genie sound controlled snowflake lamp

 
Overview

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:

Snowflake lamp front.png

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:

Finished product and PCB.jpg

Front view:

Front.jpg

Rear view:

Back.jpg

Demo video

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 13:42:49

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号