tzcP1K

Smart desk lamp design

 
Overview
This project introduces
a smart desk lamp designed using the domestically produced HC32F460 LED, which can also serve as a desktop accessory. The lamp
can be configured via Bluetooth or serial port,
allowing settings such as on/off status, brightness, display mode, display direction, whether it lights up upon device startup, and LED refresh rate.
Configuration options include three solid color modes, one flowing light mode, and up to 15 customizable modes, combined with a host computer's spectrum display mode.
An OLED screen with a GUI is available for simple button control.
A bootloader is included in the program, supporting upgrades via Bluetooth or serial port.
A Windows host computer is used for configuring the lamp, upgrading the program, and displaying the audio spectrum.
[[Smart Desk Lamp Host Computer Linkage Effect Demonstration] https://www.bilibili.com/video/BV1AMVveaEk5/?share_source=copy_web&vd_source=cb451cbc6fdfc346cba188abc375ade5]
[[Smart Desk Lamp Serial Port Connection to Computer to Implement Spectrum Light] https://www.bilibili.com/video/BV17nVWe9EtL/?share_source=copy_web&vd_source=cb451cbc6fdfc346cba188abc375ade5]
This is an experimental verification machine. Currently, it uses a generic mold purchased from Alibaba. A 3D-printed shell design is planned for the future.
The hardware design
attachments include LCSC Professional Edition project files, which can be downloaded.
These mainly include the HC32F460 core board, button board, power supply board, and lamp board.
The core board includes a CH340 serial port chip, an M3406-ADJ DC-DC chip as the power supply chip, an M24C64 for storing device configuration information, and a reserved 128x64 OLED IIC interface for simple GUI operation with a button board.
The LED board uses 8x16 WS2812b 2020 packaged LEDs, and two capacitors filter the power supply.
The power supply board uses an ETA6093 for charge and discharge management.
The software design
generally uses MDK5 combined with HC32 official examples, porting the UCOS-iii real-time operating system, and designing a bootloader to support program upgrades.
The Bluetooth and serial communication protocol is the DLT645 protocol, with redefined data identifiers for this project, and the protocol supports IAP upgrades.
The bootloader program does not receive program upgrade packages; software package upgrades are integrated into the communication protocol.
The WS2812B LEDs are driven using SPI+DMA, with an abstract layer managing all 128 LEDs. XY mapping of the LEDs' actual positions allows setting their colors using XY coordinates, and individual LEDs can be controlled via a host computer. A rich set of settings interfaces is provided; details can be found in the defined data identifier table.
The GUI is currently in a semi-finished state, allowing for basic configuration.
For the
Windows host computer
, please note the serial port configuration: 115200 8 1 EVEN (even parity).
Connecting the desk lamp via the serial port converts the computer's audio output to a spectrum analyzer. My desktop computer doesn't seem to be able to detect BLE Bluetooth, so Bluetooth connectivity is not currently implemented on the Windows host computer.
In the custom mode interface, first select the corresponding mode, or create a new mode and then select a new one.
Note: After creating or deleting a mode, please re-acquire the desk lamp information.
Double-clicking the table allows you to set the color of the corresponding LED. In synchronous mode, changes made on the host computer are synchronized to the desk lamp in real time; in asynchronous mode, you need to click "Send Data" after setting the parameters.
Whether in synchronous or asynchronous mode, remember to click save. Data in the EEPROM will not be overwritten if you don't click save, and the data will remain in the EEPROM after switching modes.
The spectrum lamp requires the desk lamp to be in custom mode; it will not display in non-custom mode.
The program is attached and you can download it.
The Android host application
is under development...
For any suggestions or to request the source code, please contact me
. The program is still being modified; those interested can contact me
at 1175020474@qq.com .
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-26 12:07:16

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号