太白金星

[Sleep well] Automatic light-off device for bedroom based on STM32

 
Overview

Preface

The author, Xiao Li, studies at a university in Northeast China that cuts off power on time at 23:00. After the power in the dormitory automatically shuts off, Xiao Li and his three considerate roommates would always press the light switch in the dormitory, but they did not know whether someone had pressed it before them. Facing the delicate buttons on the clean white wall, facing up is off and facing down is off. This is a problem. Every time, the Schrödinger switch state of the bedroom headlight always makes Xiao Li, who has difficulty choosing, unable to stop. Finally, after experiencing the big speechless incident [the third time in a row that I didn’t wake up early but was woken up at 5:30 by a light that I guessed the wrong switch status after turning on the switch the day before] at 5:30 , a dormitory automatic light-off device project was officially put on the agenda. .

 

product demand

  • Regardless of the current status of the headlights, they can automatically operate to ensure that the bedroom headlights will not come on and affect sleep before closing the next morning.
  • Do not modify the electrical wiring in the dormitory and do not connect it to the mains socket for a long time to avoid potential safety hazards.
  • It’s best not to charge, reducing any extra hands-on operations

 

Design ideas

Photosensitive control at the moment of power trip, battery powered, pasted on the wall switch, mechanical action to press the switch

After referring to various designs of dormitory light-off devices, Xiao Li decided to use the solution of photovoltaic cells + supercapacitors + TPS61094 + STM32 system board to achieve maximum automation control.

TPS61094 is an extremely low-power power supply chip with supercapacitor management function. With the low-power mode of STM32, it can realize fully automatic lights-off through photovoltaic battery power supply and supercapacitor energy storage, solving the problem of Xiao Li and his roommates in one go. No worries.

 

Project Features

  • Leave it alone: ​​Use solar cells combined with TPS61094 and supercapacitors to charge and store energy during the day, and automatically operate when the power is cut off at night, and you can leave it alone after installation.
  • Lighting judgment program optimization: Delay multiple times to judge the status before taking action after the ambient light jumps, effectively reducing jitter and accidental touches due to light changes in the bedroom scene
  • Reset to programmable state: STM32 cannot be programmed in low-power mode, so it is specially designed to enter low-power consumption through the first light change after reset, which reduces trouble during the debugging and verification phase.
  • Compact size: For the sake of beauty, the PCB is designed to be plugged into the STM32 minimum system board. The solar cells can be directly attached to the back of the PCB. The finished product will not look too dark when pasted on a white wall.
  • Second innovation is possible: The device is essentially a photovoltaic voltage-stabilized power supply board that integrates a photosensitive sensor, a switch tube and a trigger. But if you don’t connect STM32, it can also be used directly as a 5v to 3.3v regulated power supply module through the reserved pin header.

 

There is a problem

The project is still in the verification stage. The basic program logic has been implemented on the breadboard, and the schematic diagram and PCB have been basically drawn. However, TPS61094 has not yet arrived, and the production time of the finished product is unknown.

In addition, limited by Xiao Li's hardware design capabilities, errors will inevitably occur in the schematic diagram and PCB, such as unreasonable component parameters, confusing PCB routing, etc. Please correct me in the comment area or discuss via private message.

The program code can be modified at any time and is relatively simple. No attachments will be uploaded for the time being. It will be updated in time after the actual product is obtained and confirmed to be used.

 

(The blue LED in the video simulates the MOS switch status of the servo power supply, and the red LED simulates the trigger/CLR signal.

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-20 02:31:52

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号