hZefksb9hj

Interactive Smart Desk Lamp

 
Overview
Project Description:
 In the era of intelligent technology, desk lamps are essential tools for daily work and study. However, their general lack of support for smart switching is incompatible with this trend. Therefore, I aim to design a desk lamp that automatically turns on when a person sits down. Furthermore, based on the concept of recognizing human movements, the lamp can be controlled by gesture recognition, and the light intensity can be controlled by a light sensor to maintain the user-defined brightness on the desktop under different lighting conditions. The project utilizes STMicroelectronics' STM32F4 series chips and the RT-Thread Studio development environment, based on the RT-Thread standard version. Human movement and gesture recognition are achieved by acquiring distance data from two distance sensors (10cm apart) and angle data calculated from the distance data. The collected dataset is then used to train a model using STMicroelectronics' NanoEdge AI Studio software and deployed to the RT-Thread standard version to achieve human movement and gesture recognition. Light intensity control is implemented using a PID algorithm combined with a Kalman filter algorithm, and OLED interface rendering is completed using the U8G2 library. 
The overall mind map of the work can be accessed through the mind map I created on Mubu:
https://www.mubu.com/doc/4l4Tz9t34_U . The open source
code is available on gitee:
https://gitee.com/zbssjcbsbbs/lichuang-open-source-work-code/tree/master/%E4%BA%A4%E4%BA%92%E5%BC%8F%E6%99%BA%E8%83%BD%E5%8F%B0%E7%81%AF
 
. Open
source license: GPL 3.0 
(Unauthorized reproduction is prohibited).
 
Project related functions
: (1) The desk lamp will automatically turn on when a person walks in front of it and turn off automatically when they leave. (2) The brightness of the light and the countdown of the Pomodoro timer can be adjusted by recognizing gestures. (3) The brightness is automatically adjusted by using the PID algorithm when the light is on to maintain the brightness of the desktop without changing with the environment. (4) When the automatic lamp-on function needs to be turned off, a forced-off gesture can be used to turn off the automatic lamp-on function, and it can avoid the lamp turning on when a person walks in front of it without a forced-on gesture. 
 
Project Attributes
This project is being published for the first time and is my original project.
 
Project Progress
 
First Stage Functional Verification
Hardware
Liangshanpai extended version completed, discrete LED light board completed, LED driver circuit board completed
 
The Liangshanpai used in the extended version is not convenient when using RT-Thread Studio, so it is considered to replace Liangshanpai with SkyStar development board.
Discrete light board verification is normal
The LED driver board circuit function is normal, but one terminal is drawn backwards
The software
uses the RT-Thread software package ecosystem to adapt and test the various sensors used in the work.
Second Stage Functional Implementation
Hardware
SkyStar extended version completed, LED driver board modification completed, 3D shell modeling completed
Hardware circuit verification is normal, 3D shell assembly is normal, but it is a bit top-heavy, some counterweights can be added to the bottom.
Software
Attempt to integrate all modules into the system at the same time Plan the system function, based on the current situation, determine to try to complete the following functions.
(1) The desk lamp will automatically turn on when a person walks in front of it and turn off when they leave. (2) The brightness of the light and the countdown timer of the Pomodoro Technique can be adjusted by recognizing gestures. (3) The brightness of the desk lamp is automatically adjusted by using the PID algorithm when the lamp is on, so that the brightness of the desk does not change with the environment. (4) When the automatic lamp-on function needs to be turned off, the automatic lamp-on function can be turned off by using a forced-off gesture, and the desk lamp will not be turned on when a person walks in front of it without a forced-on gesture. 
The third stage simplifies the hardware . The main
hardware
is to address the fact that the discrete lamp board is not aesthetically pleasing and requires a ribbon cable connection, so it is designed as an integrated unit. However, the former meets the free printing size, while the latter does not.
The height of the SkyStar Plus expansion board is too high to be built into the base of the desk lamp. Therefore, a minimum system board is designed to replace the SkyStar Plus expansion board, and the more economical STM32F401RCT6 is selected. However, the holes and the 3D printed shell are offset by exactly 90°. Therefore, to achieve a better fit, the hole positions need to be changed, and the hole diameter appropriately increased .
The software,
using CubeMX and RT Thread Studio, was used to port and test the project. The ported hardware and software functioned correctly.
The design principle
for the light switch
involves placing two TOF distance sensors 10cm apart on the light pole to obtain two distance information points. The angle information of the human body can be calculated by the distance difference and the 10cm height difference between the two distance sensors. Thus, at the software level, there are three input data points: sensor 1 data, sensor 2 data, and angle data.
Using these three input data, the model is trained using the anomaly detection mode of STMicroelectronics' NanoEdge AI Studio software, enabling the light to be turned on when someone approaches and turned off when someone leaves.
The interaction
utilizes the software's classification and detection mode to train the model, enabling gesture control of light brightness and the on/off functionality of the Pomodoro Technique light.
Brightness adjustment
is achieved by using a light intensity sensor installed on the lamp head to detect the desktop's light intensity in real time. The LED driver board's PWM dimming mode is then used to adjust the light brightness, forming a closed-loop control that maintains the desktop's brightness regardless of changes in ambient light.
 
Software Description:
The software is mainly divided into two parts: model training and development using the RT-Thread operating system.
Model training includes the following: [details omitted]
. Development using the RT-Thread operating system includes the following: [details omitted].
Physical Demonstration Collection.
 
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-28 02:44:57

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号