CN108770127A - A kind of multi-functional LED desk lamp based on STC89C52 single chip control - Google Patents

A kind of multi-functional LED desk lamp based on STC89C52 single chip control Download PDF

Info

Publication number
CN108770127A
CN108770127A CN201810703270.7A CN201810703270A CN108770127A CN 108770127 A CN108770127 A CN 108770127A CN 201810703270 A CN201810703270 A CN 201810703270A CN 108770127 A CN108770127 A CN 108770127A
Authority
CN
China
Prior art keywords
chip
circuit
control unit
liquid crystal
clock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810703270.7A
Other languages
Chinese (zh)
Inventor
孙国中
孙强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Dianji University
Original Assignee
Shanghai Dianji University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Dianji University filed Critical Shanghai Dianji University
Priority to CN201810703270.7A priority Critical patent/CN108770127A/en
Publication of CN108770127A publication Critical patent/CN108770127A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • GPHYSICS
    • G04HOROLOGY
    • G04BMECHANICALLY-DRIVEN CLOCKS OR WATCHES; MECHANICAL PARTS OF CLOCKS OR WATCHES IN GENERAL; TIME PIECES USING THE POSITION OF THE SUN, MOON OR STARS
    • G04B47/00Time-pieces combined with other articles which do not interfere with the running or the time-keeping of the time-piece
    • GPHYSICS
    • G04HOROLOGY
    • G04GELECTRONIC TIME-PIECES
    • G04G13/00Producing acoustic time signals
    • G04G13/02Producing acoustic time signals at preselected times, e.g. alarm clocks
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09DRAILWAY OR LIKE TIME OR FARE TABLES; PERPETUAL CALENDARS
    • G09D3/00Perpetual calendars
    • G09D3/12Perpetual calendars electrically operated
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/34Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source
    • G09G3/36Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source using liquid crystals

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Chemical & Material Sciences (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Computer Hardware Design (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

本发明涉及一种基于STC89C52单片机控制的多功能LED台灯,其特征在于,包括由STC89C52单片机芯片搭建的核心控制单元,核心控制单元分别连接液晶显示屏驱动电路、恒流驱动电路、温度检测电路及时钟电路。本发明:1)采用PWM调光技术;2)确保大功率LED端稳定输出;3)使用了LCD12864液晶屏,该液晶屏可以在里面同时显示出年、月、日、星期、时、分、秒以及环境的温度,还有闹铃的符号;4)利用DS18B20温度芯片来检测周围环境的温度;5)引入时钟芯片DS1302为了避免掉电后要重新设置时间;6)配有源蜂鸣器,作为报警信号和用户提醒的闹钟。

The invention relates to a multifunctional LED desk lamp controlled by a STC89C52 single-chip microcomputer, which is characterized in that it includes a core control unit built by the STC89C52 single-chip microcomputer chip, and the core control unit is respectively connected to a liquid crystal display drive circuit, a constant current drive circuit, and a temperature detection circuit in real time. clock circuit. The present invention: 1) adopts PWM dimming technology; 2) ensures stable output of high-power LED terminals; 3) uses LCD12864 liquid crystal screen, which can simultaneously display year, month, day, week, hour, minute, 4) Use the DS18B20 temperature chip to detect the temperature of the surrounding environment; 5) Introduce the clock chip DS1302 to avoid resetting the time after power failure; 6) Equipped with a source buzzer , as an alarm clock for alarm signals and user reminders.

Description

一种基于STC89C52单片机控制的多功能LED台灯A Multifunctional LED Desk Lamp Controlled by STC89C52 Single Chip Microcomputer

技术领域technical field

本发明涉及一种基于ATC89C52单片机的多功能LED台灯,属于单片机在LED台灯领域的应用。The invention relates to a multifunctional LED desk lamp based on an ATC89C52 single-chip microcomputer, which belongs to the application of the single-chip microcomputer in the field of LED desk lamps.

背景技术Background technique

随着21世纪社会科学技术的不断进步发展,电子产业呈现蓬勃发展的态势。目前现有的产品化的LED台灯有很多,但大多功能单一。灯具市场上出售的灯具种类繁多,一般台灯均采用220V交流电源供电,日光灯管、白炽灯泡为光源,手动开关或触摸感应式开光来控制。With the continuous progress and development of social science and technology in the 21st century, the electronics industry is showing a trend of vigorous development. There are many existing commercialized LED desk lamps at present, but most of them have a single function. There are many kinds of lamps and lanterns sold in the lamp market. Generally, desk lamps are powered by 220V AC power supply, fluorescent tubes and incandescent bulbs are used as light sources, and controlled by manual switches or touch-sensitive switches.

现市场上大部分产品只有一种亮度,无法按照人们的需求来调节亮度,太亮过于浪费能源且损害人的眼睛,太暗已经无法满足人们的需求了。后来也有可调亮度的LED台灯,但大部分是机械式的调节方式。随着LED台灯产品的发展,也出现了一些多功能的产品,如台灯和时钟的结合、台灯和闹钟结合等,但是很多产品做得并不如人意,并不能满足现代人们对智能化产品的需求。Most of the products on the market now have only one brightness, which cannot be adjusted according to people's needs. Too bright will waste energy and damage people's eyes, and too dark can no longer meet people's needs. Later, there were also LED desk lamps with adjustable brightness, but most of them were mechanically adjusted. With the development of LED desk lamp products, some multi-functional products have also appeared, such as the combination of desk lamp and clock, the combination of desk lamp and alarm clock, etc., but many products are not satisfactory and cannot meet the needs of modern people for intelligent products. .

发明内容Contents of the invention

本发明的目的是:通过改变系统的输出电流来改变台灯上白光LED灯的亮度,并且使得台灯具有多种功能。The purpose of the invention is to change the brightness of the white LED lamp on the desk lamp by changing the output current of the system, and make the desk lamp have multiple functions.

为了达到上述目的,本发明的技术方案是提供了一种基于STC89C52单片机控制的多功能LED台灯,其特征在于,包括由STC89C52单片机芯片搭建的核心控制单元,核心控制单元分别连接液晶显示屏驱动电路、恒流驱动电路、温度检测电路及时钟电路,其中:In order to achieve the above object, the technical solution of the present invention is to provide a multifunctional LED desk lamp based on the STC89C52 single-chip microcomputer control, which is characterized in that it includes a core control unit built by the STC89C52 single-chip microcomputer chip, and the core control unit is respectively connected to the LCD drive circuit , constant current drive circuit, temperature detection circuit and clock circuit, wherein:

温度检测电路采用温度传感器DS18B20,核心控制单元仅通过一个I/O口控制温度传感器DS18B20;The temperature detection circuit adopts the temperature sensor DS18B20, and the core control unit only controls the temperature sensor DS18B20 through one I/O port;

液晶显示屏驱动电路采用LCD12864液晶显示屏组成的液晶电路;The liquid crystal display drive circuit adopts the liquid crystal circuit composed of LCD12864 liquid crystal display;

核心控制单元通过恒流驱动电路驱动LED灯,恒流驱动电路采用恒流芯片CAT4106,恒流芯片CAT4106的PWM接口与核心控制单元相连;The core control unit drives the LED lights through a constant current drive circuit, the constant current drive circuit uses a constant current chip CAT4106, and the PWM interface of the constant current chip CAT4106 is connected to the core control unit;

时钟电路采用时钟芯片DS1302。The clock circuit adopts the clock chip DS1302.

优选地,在所述STC89C52单片机芯片的复位引脚RST上接一个电阻和电容,电阻的另一脚接地,电容的另一脚接+5V电压源,由此形成的充放电电路,充放电电路与复位按键的一端并联,复位按键的另一端接+5V电压源。Preferably, a resistor and a capacitor are connected to the reset pin RST of the STC89C52 single-chip microcomputer chip, the other leg of the resistor is connected to the ground, and the other leg of the capacitor is connected to a +5V voltage source, thereby forming a charging and discharging circuit, a charging and discharging circuit It is connected in parallel with one end of the reset button, and the other end of the reset button is connected to a +5V voltage source.

优选地,所述核心控制单元与蜂鸣器相连。Preferably, the core control unit is connected with a buzzer.

本发明的一种基于STC89C52单片机控制的多功能LED台灯,通过STC89C52单片机芯片搭建核心控制系统,同时应用了PWM调光技术,通过改变系统的输出电流来改变白光LED灯的亮度。在显示方面,使用了LCD12864液晶屏,该液晶屏可以在里面同时显示出年、月、日、星期、时、分、秒以及环境的温度,还有闹铃的符号。同时,可以利用DS18B20温度芯片来检测周围环境的温度;为了避免掉电后要重新设置时间,引入了一块时钟芯片DS1302,在闹钟方面,配以有源蜂鸣器,作为报警信号和用户提醒信号。A multi-functional LED desk lamp based on the STC89C52 single-chip microcomputer control of the present invention builds a core control system through the STC89C52 single-chip microcomputer chip, and at the same time applies PWM dimming technology to change the brightness of the white LED lamp by changing the output current of the system. In terms of display, an LCD12864 liquid crystal screen is used, which can simultaneously display the year, month, day, week, hour, minute, second and the temperature of the environment, as well as the symbol of the alarm. At the same time, the DS18B20 temperature chip can be used to detect the temperature of the surrounding environment; in order to avoid resetting the time after power failure, a clock chip DS1302 is introduced. In the alarm clock, it is equipped with an active buzzer as an alarm signal and user reminder signal .

本发明提供的一种基于STC89C52单片机控制的多功能LED台灯,其新技术特点在于:The present invention provides a multifunctional LED desk lamp based on STC89C52 single-chip microcomputer control, and its new technical features are:

1)采用PWM调光技术,通过改变系统的输出电流来改变白光LED灯的亮度;2)台灯的驱动端加上了恒流芯片CAT4106,确保大功率LED端稳定输出;3)使用了LCD12864液晶屏,该液晶屏可以在里面同时显示出年、月、日、星期、时、分、秒以及环境的温度,还有闹铃的符号;4)利用DS18B20温度芯片来检测周围环境的温度;5)引入时钟芯片DS1302为了避免掉电后要重新设置时间;6)配有源蜂鸣器,作为报警信号和用户提醒的闹钟。1) Using PWM dimming technology, the brightness of the white LED lamp can be changed by changing the output current of the system; 2) A constant current chip CAT4106 is added to the drive end of the desk lamp to ensure stable output of the high-power LED end; 3) LCD12864 liquid crystal is used screen, the LCD screen can simultaneously display the year, month, day, week, hour, minute, second and the temperature of the environment, as well as the symbol of the alarm; 4) Use the DS18B20 temperature chip to detect the temperature of the surrounding environment; 5 ) The clock chip DS1302 is introduced to avoid resetting the time after power failure; 6) Equipped with a source buzzer, which is used as an alarm signal and an alarm clock for user reminders.

附图说明Description of drawings

图1为本发明的总体框图;Fig. 1 is the overall block diagram of the present invention;

图2为以STC89C52单片机为核心构建的单片机最小系统电原理图;Figure 2 is the minimum system electrical schematic diagram of the single-chip microcomputer built with the STC89C52 single-chip microcomputer as the core;

图3为以DS18B20为温度传感器的检测电路与主控系统的连接电原理图;Figure 3 is a schematic diagram of the connection between the detection circuit and the main control system with DS18B20 as the temperature sensor;

图4为温度传感器连接示意图;Figure 4 is a schematic diagram of the connection of the temperature sensor;

图5为采用LCD12864液晶显示屏组成的液晶电路;Figure 5 is a liquid crystal circuit composed of LCD12864 liquid crystal display;

图6为恒流驱动电路的电原理图;6 is an electrical schematic diagram of a constant current drive circuit;

图7为本发明软件部分设计框图;Fig. 7 is a block diagram of software part design of the present invention;

图8为LCD12864驱动程序框图;Figure 8 is a block diagram of the LCD12864 driver;

图9为温度检测程序框图;Fig. 9 is a temperature detection program block diagram;

图10为时钟程序设计框图。Figure 10 is a block diagram of the clock program design.

具体实施方式Detailed ways

为使本发明更明显易懂,兹以优选实施例,并配合附图作详细说明如下。In order to make the present invention more comprehensible, preferred embodiments are described in detail below with accompanying drawings.

本发明的LED台灯是具有多功能的,在STC89C52单片机的控制下可以实现台灯亮度的调节,并且有6个调节度。同时,通过LCD12864液晶屏可以显示出年、月、日、星期和时间,并且在DS18B20温度芯片的控制下,可以自动检测出周围环境的温度,还有闹铃设置功能。The LED desk lamp of the present invention has multiple functions, and can realize the adjustment of the brightness of the desk lamp under the control of the STC89C52 single-chip microcomputer, and has 6 adjustment degrees. At the same time, the year, month, day, week and time can be displayed on the LCD12864 LCD screen, and under the control of the DS18B20 temperature chip, the temperature of the surrounding environment can be automatically detected, and there is also an alarm setting function.

本发明的总体设计框图如图1所示。The overall design block diagram of the present invention is shown in Figure 1.

主机设计:主控系统是利用STC89C52RC单片机芯片搭建成的最小系统。电源电路采用的是5V直流电源供电,振荡电路为单片机提供一个内部的时钟,复位电路是为了在系统死机或卡机的时候可以重新启动系统。在软件编程方面,使用C语言编写程序。Host design: The host control system is the smallest system built using the STC89C52RC single-chip microcomputer chip. The power supply circuit is powered by 5V DC power supply. The oscillation circuit provides an internal clock for the microcontroller. The reset circuit is to restart the system when the system crashes or freezes. In terms of software programming, programs are written in C language.

从机设计:从机主要分为四大部分,分别是液晶显示屏驱动电路、恒流驱动电路、温度检测电路及时钟电路。每一部分都是STC89C52RC单片机直接驱动的,在其控制下各自完成自己的功能。Slave machine design: The slave machine is mainly divided into four parts, which are liquid crystal display drive circuit, constant current drive circuit, temperature detection circuit and clock circuit. Each part is directly driven by the STC89C52RC single-chip microcomputer, and each completes its own function under its control.

主控芯片采STC公司生产的一种低功耗、高性能CMOS8位微控制器-STC89C52。用LED作为显示器时,需要对其进行恒流驱动,否则LED可能电流过大而导致烧坏,本发明采用CAT4106的恒流芯片。显示屏要求能显示较多的文字和符号,要求分辨率足够高,选用LCD12864为液晶显示屏,分辨率为128×64满足要求。选用大功率的LED的灯珠来照明,亮度很高。本发明采用的温度传感器是DALLAS公司生产的DS18B20,具有微型化、低功耗、高性能、抗干扰能力强、易配微处理器等优点。The main control chip is a low-power, high-performance CMOS 8-bit microcontroller-STC89C52 produced by STC Company. When an LED is used as a display, it needs to be driven by a constant current, otherwise the LED may burn out due to an excessive current. The present invention uses a CAT4106 constant current chip. The display screen is required to display more characters and symbols, and the resolution is required to be high enough. LCD12864 is selected as the liquid crystal display screen, and the resolution is 128×64 to meet the requirements. High-power LED lamp beads are used for lighting, and the brightness is very high. The temperature sensor used in the present invention is DS18B20 produced by DALLAS Company, which has the advantages of miniaturization, low power consumption, high performance, strong anti-interference ability, and easy configuration with a microprocessor.

第一部分:硬件电路设计Part 1: Hardware Circuit Design

一)主控电路1) Main control circuit

主控电路实际上就是以STC89C52单片机为核心构建的单片机最小系统,如图2所示。The main control circuit is actually the smallest single-chip microcomputer system built with the STC89C52 single-chip microcomputer as the core, as shown in Figure 2.

该主控系统主要由两部分电路组成,一个是复位电路,另一个是振荡电路。复位电路有两种复位方式,分别是上电复位和按键复位。上电复位是在STC89C52单片机的复位引脚RST上接一个10K的电阻和10μF的电容,电阻的另一脚接地,电容的另一脚接+5V,由此形成的充放电电路可以保证单片机在上电的时候复位引脚RST有足够的时间到达高电平,从而可以进行复位。而按键复位则是直接与复位电路并联一个按键,按键另一端接+5V,当按键被按下时复位电容放电,RST引脚也被拉到高电平,也可以达到复位的效果。The main control system is mainly composed of two parts of the circuit, one is a reset circuit, and the other is an oscillation circuit. The reset circuit has two reset methods, namely power-on reset and button reset. Power-on reset is to connect a 10K resistor and a 10μF capacitor to the reset pin RST of the STC89C52 microcontroller, the other leg of the resistor is grounded, and the other leg of the capacitor is connected to +5V. When the power is turned on, the reset pin RST has enough time to reach the high level, so that it can be reset. The button reset is directly connected to a button in parallel with the reset circuit, and the other end of the button is connected to +5V. When the button is pressed, the reset capacitor discharges, and the RST pin is also pulled to a high level, which can also achieve the reset effect.

振荡电路是单片机最小系统的另一个部分,由一个晶振和两个电容组成的,一般的单片机内部都自带晶振,晶振在单片机小系统里起着很重要的作用,可以为单片机提供所需要的时钟频率。通常情况下,一个系统都是共用一个晶振,这是为了方便各部分电路的时钟保持一致。在STC89C52单片机中,引脚XTAL1和引脚XTAL2是外接晶振的I/O口,为系统提供稳定,精确的振荡频率。The oscillation circuit is another part of the minimum system of the single-chip microcomputer. It is composed of a crystal oscillator and two capacitors. Generally, the single-chip microcomputer has its own crystal oscillator inside. The crystal oscillator plays a very important role in the small system of the single-chip microcomputer. It can provide the needed Clock frequency. Usually, a system shares a crystal oscillator, which is to facilitate the consistency of the clocks of various parts of the circuit. In the STC89C52 microcontroller, the pin XTAL1 and the pin XTAL2 are the I/O ports of the external crystal oscillator, which provide a stable and accurate oscillation frequency for the system.

二)温度检测电路2) Temperature detection circuit

以DS18B20为温度传感器的检测电路与主控系统的连接图3所示。DS18B20使用的是单总线技术,它只采用单条信号线,既可以传输时钟,又可以传输数据,而且数据的传输是双向的。DS18B20与单片机的连接很简单,只需要一个I/O口就可以控制DS18B20了,所占用单片机的资源是很少。温度传感器DS18B20的D0引脚是与单片机STC89C52的P15引脚相接的,如图4所示。The connection between the detection circuit and the main control system with DS18B20 as the temperature sensor is shown in Figure 3. DS18B20 uses single-bus technology, which only uses a single signal line, which can transmit both clock and data, and the data transmission is bidirectional. The connection between DS18B20 and the single-chip microcomputer is very simple, only one I/O port is needed to control the DS18B20, and the resource occupied by the single-chip microcomputer is very little. The D0 pin of the temperature sensor DS18B20 is connected with the P15 pin of the microcontroller STC89C52, as shown in Figure 4.

三)液晶电路3) LCD circuit

采用LCD12864液晶显示屏组成的液晶电路如图5所示。LCD12864液晶屏一共有20个引脚,其中需要接入的引脚有18个,第16和18的NC引脚悬空。GND(1脚)直接接地;VCC(2脚)接电源,如果没有特别说明,一般默认是接5V的;V0(3脚)接可调电阻,一般是1K左右,用来调节液晶显示对比度;RS(CS)(4脚)是数据/命令选择端(串片选),高电平时数据口显示数据,低电平时数据口显示指令数据;R/W(SID)(5脚)是读/写选择端,E(SCLK)(6脚),当R/W为高电平,使能端也为高电平时,读到的数据是DB7-DB0,当都为低电平时,DB7-DB0的数据被写到IR或DR中去;DB0-DB7(7-14脚)为数据口;PSB(15脚)为并串口方式选择,高电平时并行,低电平时串行;RST(17脚)为复位端,低电平有效;BLA(19脚)和BLK(20脚)分别为背光电源的正负极。The liquid crystal circuit composed of LCD12864 liquid crystal display is shown in Figure 5. The LCD12864 LCD screen has a total of 20 pins, of which 18 pins need to be connected, and the 16th and 18th NC pins are left floating. GND (pin 1) is directly grounded; VCC (pin 2) is connected to the power supply, and if there is no special instruction, it is generally connected to 5V by default; V0 (pin 3) is connected to an adjustable resistor, usually about 1K, which is used to adjust the contrast of the LCD display; RS (CS) (pin 4) is the data/command selection terminal (serial chip selection), the data port displays data when the level is high, and the data port displays command data when the level is low; R/W (SID) (pin 5) is the read/write Write selection terminal, E (SCLK) (pin 6), when R/W is high level and the enable terminal is also high level, the read data is DB7-DB0, when both are low level, DB7-DB0 The data is written to IR or DR; DB0-DB7 (7-14 pins) is the data port; PSB (15 pins) is the parallel serial port mode selection, parallel at high level, serial at low level; RST (17 pins) ) is the reset terminal, active low; BLA (pin 19) and BLK (pin 20) are the positive and negative poles of the backlight power supply respectively.

LCD12864液晶屏内部有一个忙标志位BF,提供内部的工作情况,当为1时,模块正在进行内部操作,且不会再接受外部的指令和数据,为0时,处于准备状态,可接受外部的指令和数据。There is a busy flag BF inside the LCD12864 LCD screen, which provides internal working conditions. When it is 1, the module is operating internally and will not accept external instructions and data. When it is 0, it is in a ready state and can accept external instructions and data.

四)恒流驱动电路4) Constant current drive circuit

本发明采用的大功率LED照明灯是用CAT4106驱动器驱动的,设计的原理如图6所示。The high-power LED lighting used in the present invention is driven by a CAT4106 driver, and the design principle is shown in Figure 6.

CAT4106恒流芯片,最大可输出不超过6W的LED功率。在设计电路时,可以通过外部的一个电阻来实现对驱动电流的精确控制。CAT4106内置的诊断功能可以用来自动调节输出电压,和设定最低及最高电压限制,从而确定LED可接受的工作范围,以最低的电压裕量来进行LED驱动,提升灯光的效果。同时还可以检测到LED开路/短路以及LED通路电压。CAT4106的效率可达90%以上,有着高达2kHz的高频PWM接口和热关断保护,在背景光照明和一般照明中用着广泛的应用性。CAT4106 constant current chip, the maximum LED power output can not exceed 6W. When designing the circuit, precise control of the drive current can be achieved through an external resistor. The built-in diagnostic function of CAT4106 can be used to automatically adjust the output voltage, and set the minimum and maximum voltage limits, so as to determine the acceptable working range of the LED, drive the LED with the lowest voltage margin, and improve the lighting effect. At the same time, LED open/short and LED pass voltage can be detected. The efficiency of CAT4106 can reach more than 90%. It has a high-frequency PWM interface up to 2kHz and thermal shutdown protection. It is widely used in background lighting and general lighting.

第二部分:系统软件设计Part II: System Software Design

在软件部分,采用了C语言这种高级语言来进行程序的编写,由于电路较为复杂,需要编写的程序有多部分,所以采用了部分调试的方法,把各部分电路的程序先分开编写和调试,然后再整合到一起,写入到主程序中调试,这样方便编写和查错,可以大大提高编程的进度。总体的设计框图如图7所示。In the software part, a high-level language such as C language is used to write the program. Since the circuit is more complicated, there are many parts of the program to be written, so the method of partial debugging is adopted, and the program of each part of the circuit is written and debugged separately. , and then integrate them together, write them into the main program for debugging, which is convenient for writing and checking errors, and can greatly improve the progress of programming. The overall design block diagram is shown in Figure 7.

LCD12864驱动程序框图如图8所示;温度检测程序框图如图9所示;时钟程序设计框图如图10所示。The block diagram of the LCD12864 driver is shown in Figure 8; the block diagram of the temperature detection program is shown in Figure 9; the block diagram of the clock program design is shown in Figure 10.

Claims (3)

1. a kind of multi-functional LED desk lamp based on STC89C52 single chip control, which is characterized in that including by STC89C52 monolithics The key control unit that movement piece is built, key control unit be separately connected liquid crystal display driving circuit, constant-current drive circuit, Temperature sensing circuit and clock circuit, wherein:
Temperature sensing circuit uses temperature sensor DS18B20, key control unit only to control temperature sensing by one I/O mouthfuls Device DS18B20;
Liquid crystal display driving circuit uses the liquid crystal circuit of LCD12864 liquid crystal displays composition;
Key control unit drives LED light by constant-current drive circuit, and constant-current drive circuit uses constant current chip CAT4106, permanent The PWM interfaces of stream chip CAT4106 are connected with key control unit;
Clock circuit uses clock chip DS1302.
2. a kind of multi-functional LED desk lamp based on STC89C52 single chip control as described in claim 1, which is characterized in that A resistance and capacitance, another foot ground connection of resistance, capacitance are connect on the reset pin RST of the STC89C52 single chip chip Another foot connect+5V voltage sources, the charge-discharge circuit being consequently formed, charge-discharge circuit is in parallel with one end of reset key, reset Another termination+5V voltage sources of button.
3. a kind of multi-functional LED desk lamp based on STC89C52 single chip control as described in claim 1, which is characterized in that The key control unit is connected with buzzer.
CN201810703270.7A 2018-06-29 2018-06-29 A kind of multi-functional LED desk lamp based on STC89C52 single chip control Pending CN108770127A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810703270.7A CN108770127A (en) 2018-06-29 2018-06-29 A kind of multi-functional LED desk lamp based on STC89C52 single chip control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810703270.7A CN108770127A (en) 2018-06-29 2018-06-29 A kind of multi-functional LED desk lamp based on STC89C52 single chip control

Publications (1)

Publication Number Publication Date
CN108770127A true CN108770127A (en) 2018-11-06

Family

ID=63975218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810703270.7A Pending CN108770127A (en) 2018-06-29 2018-06-29 A kind of multi-functional LED desk lamp based on STC89C52 single chip control

Country Status (1)

Country Link
CN (1) CN108770127A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459010A (en) * 2020-05-13 2020-07-28 佛山职业技术学院 Alarm clock and control circuit

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203015241U (en) * 2013-01-21 2013-06-19 浙江我芯我能科技有限公司 Stroboflash-free LED desk lamp having storage function
CN203243565U (en) * 2013-05-06 2013-10-16 浙江工贸职业技术学院 A multifunctional LED desk lamp
CN204190977U (en) * 2014-09-16 2015-03-04 南京师范大学 Multifunctional LED Simulated Natural Light Gradient System
CN106304485A (en) * 2016-08-23 2017-01-04 暨南大学 Multifunctional intelligent desk lamp based on STM32 and intelligent control method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203015241U (en) * 2013-01-21 2013-06-19 浙江我芯我能科技有限公司 Stroboflash-free LED desk lamp having storage function
CN203243565U (en) * 2013-05-06 2013-10-16 浙江工贸职业技术学院 A multifunctional LED desk lamp
CN204190977U (en) * 2014-09-16 2015-03-04 南京师范大学 Multifunctional LED Simulated Natural Light Gradient System
CN106304485A (en) * 2016-08-23 2017-01-04 暨南大学 Multifunctional intelligent desk lamp based on STM32 and intelligent control method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459010A (en) * 2020-05-13 2020-07-28 佛山职业技术学院 Alarm clock and control circuit

Similar Documents

Publication Publication Date Title
CN104481386B (en) Multi-media classroom lighting control system and method
CN102695319B (en) LED stepless light regulating circuit
CN101034305A (en) Computer automatic dormancy/awaking circuit
CN204178083U (en) A kind of liquid crystal low-temperature heating system controlled based on intelligent temperature
CN105407613A (en) Novel classroom lighting control system
CN204554487U (en) A kind of intelligent student's desk lamp
CN102749840A (en) Timing device for light source life
CN202958031U (en) New type intelligent and energy-saving controller of LED (Light Emitting Diode) desk lamp
CN204311959U (en) Multi-media classroom lighting control system
CN104676425A (en) Intelligent small night lamp
CN207184880U (en) A LED touch dimming lighting control system based on PIC microcontroller
CN204518125U (en) A kind of slip touches LED brightness regulating circuit
CN103142209B (en) Portable vision tester
CN203618176U (en) LED intelligent light controller
CN202026732U (en) Electric heating mosquito-repellent incense heater with liquid crystal display and automatic timing functions
CN205177385U (en) LED writes screen based on singlechip
CN205902168U (en) A multifunctional smart desk
CN205830102U (en) An intelligent eye protection lamp system
CN204009286U (en) An intelligent light transmission controller for liquid crystal electronically controlled dimming film
CN209748860U (en) Lamp control vertical driving power supply
CN1786922A (en) Driving circuit for status display lamp of computer
CN206132216U (en) Light intensity tester
CN102298901A (en) LED energy-saving display control device
CN110880302A (en) LCD screen anti-screen-splash system based on domestic processor and implementation method
CN201594937U (en) LED backlight adjustment switching circuit and display device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181106