[go: up one dir, main page]

CN102520610B - Intelligent light alarm - Google Patents

Intelligent light alarm Download PDF

Info

Publication number
CN102520610B
CN102520610B CN201110402582.2A CN201110402582A CN102520610B CN 102520610 B CN102520610 B CN 102520610B CN 201110402582 A CN201110402582 A CN 201110402582A CN 102520610 B CN102520610 B CN 102520610B
Authority
CN
China
Prior art keywords
module
chip microcomputer
clock
light
voice
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.)
Expired - Fee Related
Application number
CN201110402582.2A
Other languages
Chinese (zh)
Other versions
CN102520610A (en
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.)
Jiangsu University
Original Assignee
Jiangsu 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 Jiangsu University filed Critical Jiangsu University
Priority to CN201110402582.2A priority Critical patent/CN102520610B/en
Publication of CN102520610A publication Critical patent/CN102520610A/en
Application granted granted Critical
Publication of CN102520610B publication Critical patent/CN102520610B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

本发明公开一种智能灯光闹铃,包括单片机、红外通信模块、语音模块、灯光控制模块和时钟及显示模块;所述单片机分别通过输入接口与红外通信模块的接受器连接,输出接口与语音模块和灯光控制模块连接,输入输出接口与时钟及显示模块连接。该灯光闹铃通过晶闸管调光电路组成的灯光控制模块调节灯光强弱,通过语音模块实现输出声音的大小及乐曲的控制,通过红外通信模块进行远程设置与控制,通过单片机实现精确计时和整体控制,从而实现设定时间到达后,启动灯光和音乐,初始时声音低而且灯光弱,随着时间的推移,音乐越来越响亮,灯光逐渐变强。

Figure 201110402582

The invention discloses an intelligent light alarm, which includes a single-chip microcomputer, an infrared communication module, a voice module, a light control module, a clock and a display module; the single-chip microcomputer is respectively connected to the receiver of the infrared communication module through an input interface, and the output interface is connected to the voice module. It is connected with the lighting control module, and the input and output interfaces are connected with the clock and the display module. The light alarm clock adjusts the intensity of the light through the light control module composed of the thyristor dimming circuit, realizes the control of the output sound and music through the voice module, remote setting and control through the infrared communication module, and realizes precise timing and overall control through the single-chip microcomputer , so as to realize that after the set time is reached, the light and music are started. At the beginning, the sound is low and the light is weak. As time goes by, the music becomes louder and the light gradually becomes stronger.

Figure 201110402582

Description

一种智能灯光闹铃A smart light alarm

技术领域 technical field

本发明涉及一种智能灯光闹铃,属于生活应用领域,主要应用于生活起居方面,实现声、光立体化和人性化的闹铃。 The invention relates to an intelligent light alarm clock, which belongs to the field of life application, and is mainly used in daily life to realize a three-dimensional and humanized alarm clock with sound and light.

背景技术 Background technique

传统闹钟大体可分为两种:机械闹钟和石英电子闹钟。机械闹钟如申请号为94226853.9的专利“一种无声机械闹钟”,它是利用带簧发条恢复变形所放出的能量或利用重物下降的重力作能源,以机械振动系统为时间基准,实现时间和时段计量的机械装置。机械钟表机构有多种类型,但一般都由原动系、传动系、擒纵调速系、上条拨针系和指针系组成,工作原理基本相同。石英电子闹钟如申请号为89205631.2的专利“石英电子闹钟”,它是利用水晶片的发振的原理实现时间和时段计量功能。当水晶接受到外部的加力电压,就会有变形及伸缩的性质,相反,若压缩水晶,便会使水晶两端产生电力。这样的性质在很多结晶体上也可见到,称为压电效果。石英表就是利用周期性持续发振的水晶,为我们带来准确的时间。 Traditional alarm clocks can be roughly divided into two types: mechanical alarm clocks and quartz electronic alarm clocks. A mechanical alarm clock, such as the patent "a silent mechanical alarm clock" with the application number 94226853.9, uses the energy released by the belt spring spring to restore deformation or the gravity of the weight falling as the energy source, and takes the mechanical vibration system as the time reference to realize the time. And time metering mechanism. There are many types of mechanical watch mechanisms, but they are generally composed of a prime mover, a drive train, an escapement speed control system, a winding needle system and a pointer system, and the working principles are basically the same. Quartz electronic alarm clock is the patent "quartz electronic alarm clock" of 89205631.2 as application number, and it is to utilize the vibration principle of crystal wafer to realize time and period metering function. When the crystal receives an external force voltage, it will deform and stretch. On the contrary, if the crystal is compressed, electricity will be generated at both ends of the crystal. Such properties can also be seen in many crystals, known as the piezoelectric effect. Quartz watches use crystals that vibrate periodically to bring us accurate time.

以上两种传统闹钟虽然具有计时和闹铃的功能,但是机械闹钟需要不定时的上发条,使用不便,石英电子闹钟随着使用时间的变长,误差会随之增大。同时上述两种闹铃铃声比较单调,不能录制喜欢的音乐作为铃声,没有与灯光结合起来,缺少立体感、层次感。为此出现了声控闹铃和闹铃灯两种新型闹铃。 Although the above two traditional alarm clocks have the functions of timing and alarm, the mechanical alarm clock needs to be wound up irregularly, which is inconvenient to use. The error of the quartz electronic alarm clock will increase as the usage time becomes longer. At the same time, the above two alarm tones are relatively monotonous, and the music you like cannot be recorded as the ringtone, and it is not combined with the light, which lacks a sense of three-dimensionality and layering. Two kinds of novel alarm bells of voice control alarm bell and alarm bell light have occurred for this reason.

声控闹铃如申请号为200910158584.4的专利“一种声控闹铃及声控闹铃的实现方法”,主要应用于手机,包括闹铃提示装置,语音录入装置,中央处理器等,在闹铃响起时,中央处理器触发并接收语音录入装置发送来的语音信息,根据该语音信息获取对应的控制信息,再发送至闹铃提示装置,使得手机用户在不方便手动控制时通过语音方式实现闹铃的各种操作。又如申请号为200910104350.1的专利“带语音的闹铃方法和装置”,通过输入欲提示的事项,将提示内容存在FLASH存储器,当定时时间到达时,将提示内容从FLASH存储器读出至语音转换设备和显示设备;语音转换设备将提示内容由文字转换为语音信息,并通过扬声器扬声,同时在显示器上显示提示内容。 Voice-activated alarm bells, such as the patent "a voice-activated alarm bell and a method for realizing voice-activated alarm bells" with application number 200910158584.4, are mainly used in mobile phones, including alarm bell reminder devices, voice recording devices, central processing units, etc., when the alarm bell sounds , the central processor triggers and receives the voice information sent by the voice input device, obtains the corresponding control information according to the voice information, and then sends it to the alarm prompt device, so that the mobile phone user can realize the alarm by voice when it is inconvenient for manual control. various operations. Another example is the patent "alarm method and device with voice" whose application number is 200910104350.1. By inputting the item to be prompted, the prompt content is stored in the FLASH memory. When the timing time arrives, the prompt content is read from the FLASH memory to voice conversion Equipment and display equipment; the voice conversion equipment converts the prompt content from text to voice information, and makes the sound through the loudspeaker, and displays the prompt content on the display at the same time.

闹铃灯如申请号为96248332.X的专利“时控闹铃灯”,在灯具的承体上设定闹电子钟,承体内设扬声器和控制联接电路,集定时、定闹铃和灯具于一身,定闹声音大,平时声音小,灯具可定时自动开启和关闭,也可人为控制操作,使用方便。又如申请号为201020151634.4的专利“一种具有闹铃功能的台灯”,它由灯泡、灯罩、支撑臂、闹钟、底座组成。闹钟安装于底座上,其控制电路板与蓄电池置于底座内;底座外设置有时钟旋钮开关、闹铃设定开关、台灯控制开关、电源接口;控制电路板由信号输入电路、信号处理芯片IC、信号输出电路组成,开关SA1、开关SA2、开关SA3构成信号输入电路,三极管VT、LED显示屏、扬声器B、灯泡L构成输出电路。集台灯与闹钟功能于一体,在闹铃响起时,灯泡同时亮起,人们被闹铃叫醒后,便可达到照明需求,使用方便、结构简单。 The alarm lamp is the patent "time control alarm lamp" such as the application number 96248332. All in one, the sound is loud when the alarm is set, and the sound is low at ordinary times. The lamp can be turned on and off automatically at a fixed time, and can also be controlled manually, which is convenient to use. Another example is the patent "a desk lamp with an alarm function" whose application number is 201020151634.4, which consists of a bulb, a lampshade, a support arm, an alarm clock, and a base. The alarm clock is installed on the base, and its control circuit board and battery are placed in the base; the base is equipped with a clock knob switch, an alarm setting switch, a desk lamp control switch, and a power interface; the control circuit board is composed of a signal input circuit and a signal processing chip IC. , Signal output circuit composition, switch SA1, switch SA2, switch SA3 constitute the signal input circuit, triode VT, LED display, speaker B, light bulb L constitute the output circuit. It integrates the functions of desk lamp and alarm clock. When the alarm rings, the light bulbs light up at the same time. After people are woken up by the alarm, they can meet the lighting needs. It is easy to use and simple in structure.

由于声音与灯光结合的闹铃系统能够起到更好的叫醒效果,让人感受到舒适的环境。以上声控闹铃和闹铃灯两种新型闹铃,在闹铃功能上有了改进和提高。但是目前功能还很单一,主要包括:闹铃声单一,不能设定个性化音乐;设定时间和启动停止工作需要人手直接按动,没有实现遥控,使用不便;在闹铃声和灯光亮度结合协调控制上欠缺,没有能够在闹铃时间到时,逐渐综合控制闹铃声强度和灯光亮度,达到更加满意的和人性化的叫醒效果。 The alarm system combined with sound and light can have a better wake-up effect and make people feel a comfortable environment. The above two new types of alarm bells, the voice-activated alarm bell and the alarm bell light, have been improved and enhanced in the alarm bell function. However, the current functions are still very single, mainly including: the alarm tone is single, and personalized music cannot be set; the setting time and starting and stopping work need to be directly pressed manually, and the remote control is not realized, which is inconvenient to use; the combination of alarm tone and light brightness is coordinated and controlled It is lacking in that it is not able to gradually comprehensively control the intensity of the alarm sound and the brightness of the light when the alarm time is up, so as to achieve a more satisfactory and humanized wake-up effect.

发明内容 Contents of the invention

本发明的目的是提供了一种综合控制闹铃声强度和灯光亮度的可远程控制的智能灯光闹铃。 The object of the present invention is to provide a remote-controllable intelligent light alarm that comprehensively controls the intensity of the alarm sound and the brightness of the light.

本发明的技术方案是:一种智能灯光闹铃,包括单片机、红外通信模块、语音模块、灯光控制模块和时钟及显示模块;所述单片机分别通过输入接口与红外通信模块的接受器连接,输出接口与语音模块和灯光控制模块连接,输入输出接口与时钟及显示模块连接; The technical solution of the present invention is: an intelligent light alarm, including a single-chip microcomputer, an infrared communication module, a voice module, a light control module, a clock and a display module; The interface is connected to the voice module and the lighting control module, and the input and output interfaces are connected to the clock and display module;

所述单片机用于计时和控制语音模块、灯光控制模块和时钟及显示模块,所述单片机还用于与红外通信模块通信; The single-chip microcomputer is used for timing and controlling the voice module, the lighting control module, the clock and the display module, and the single-chip microcomputer is also used for communicating with the infrared communication module;

所述语音模块用于播放音乐和控制音量的大小; The voice module is used to play music and control volume;

所述灯光控制模块用于控制灯光的亮度; The lighting control module is used to control the brightness of the lighting;

所述时钟和显示模块用于显示时间和控制界面。 The clock and display module are used to display time and control interface.

所述红外通信模块包括红外发射器和红外接收器,用于闹钟的远程控制。 The infrared communication module includes an infrared transmitter and an infrared receiver for remote control of the alarm clock.

进一步,所述的单片机为AT89S52,所述的语音模块为ISD4002语音芯片,所述ISD4002语音芯片的片选/SS与所述单片机的P1.0连接,其时钟XCLK与所述单片机的P1.1连接,其数据输入MOSI与所述单片机的P1.2连接,其数据输出MISO与所述单片机的P1.3连接,其中断请求INT与所述单片机的P3.2连接。 Further, described single-chip microcomputer is AT89S52, and described voice module is ISD4002 voice chip, and the chip selection/SS of described ISD4002 voice chip is connected with P1.0 of described single-chip microcomputer, and its clock XCLK is connected with P1.1 of described single-chip microcomputer Connected, its data input MOSI is connected with P1.2 of the single-chip microcomputer, its data output MISO is connected with P1.3 of the single-chip microcomputer, and its interrupt request INT is connected with P3.2 of the single-chip microcomputer.

进一步,所述灯光控制模块为晶闸管调光电路,包括隔离电路和晶闸管电路,所述单片机输出端口P2.7与隔离电路相连,用于通过输出信号调节灯光亮度。 Further, the light control module is a thyristor dimming circuit, including an isolation circuit and a thyristor circuit, and the output port P2.7 of the single-chip microcomputer is connected to the isolation circuit for adjusting the brightness of the light through an output signal.

进一步,所述时钟和显示模块LCD显示器与单片机连接是:数据端与P0口相连,时钟输入端RS与P2.0口相连,读写控制端R/W与P2.1口相连,使能端E与P2.2口相连。当时钟输入端RS出现下降沿信号时, LCD从单片机接收工作命令。当时钟输入端RS出现上升沿信号时,LCD串行接收单片机显示缓冲区的数据,控制LCD显示,且要先串行接收功能命令或者显示的地址,然后接收显示的数据。 Further, the connection between the clock and display module LCD display and the single-chip microcomputer is: the data terminal is connected with the P0 port, the clock input terminal RS is connected with the P2.0 port, the read-write control terminal R/W is connected with the P2.1 port, and the enable port E is connected with P2.2 port. When the clock input terminal RS has a falling edge signal, the LCD receives a work command from the microcontroller. When the clock input terminal RS has a rising edge signal, the LCD serially receives the data in the display buffer of the single-chip microcomputer, controls the LCD display, and first serially receives the function command or the displayed address, and then receives the displayed data.

本发明的有益效果是:通过晶闸管调光电路组成的灯光控制模块调节灯光强弱,通过语音模块实现输出声音的大小及乐曲的控制,通过红外通信模块进行远程设置与控制,通过单片机实现精确计时和整体控制,从而实现设定时间到达后,启动灯光和音乐,初始时声音低而且灯光弱,随着时间的推移,音乐越来越响亮,灯光逐渐变强,使人们从醒来到起床有一个适应的过程,以达到预期的生理和心理效果。 The beneficial effects of the present invention are as follows: the intensity of the light is adjusted by the light control module composed of the thyristor dimming circuit, the output sound volume and the control of the music are realized by the voice module, the remote setting and control are carried out by the infrared communication module, and the precise timing is realized by the single-chip microcomputer And the overall control, so as to realize the set time, start the light and music, the sound is low and the light is weak at the beginning, as time goes by, the music becomes louder and the light gradually becomes stronger, so that people can feel comfortable from waking up to getting up A process of adaptation to achieve desired physical and psychological effects.

附图说明 Description of drawings

下面结合附图和具体实施方式作进一步详细说明。 Further detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

图1是智能灯光闹铃组成结构图; Figure 1 is a structural diagram of the intelligent lighting alarm;

图2是红外遥控组成原理图; Figure 2 is a schematic diagram of the composition of the infrared remote control;

图3是红外解码流程图; Fig. 3 is a flowchart of infrared decoding;

图4是语音芯片硬件连接图; Fig. 4 is a voice chip hardware connection diagram;

图5是播放语音子程序流程图; Fig. 5 is a flow chart of playing voice subroutine;

图6是灯光控制电路原理; Figure 6 is the light control circuit principle;

图7是控制灯光渐变子程序流程图; Fig. 7 is a flow chart of a subroutine for controlling light gradients;

图8是DS1302硬件连接图; Figure 8 is a DS1302 hardware connection diagram;

图9是DS1302驱动程序流程图; Figure 9 is a flow chart of the DS1302 driver;

图10是LCD1602硬件连接图; Figure 10 is a hardware connection diagram of LCD1602;

图11是LCD1602显示子程序流程图。 Figure 11 is a flow chart of the LCD1602 display subroutine.

具体实施方案 specific implementation plan

如图1所示,智能灯光闹铃,包括AT89S52单片机、红外通信模块、语音模块、灯光控制模块、时钟及显示模块,AT89S52单片机分别通过输入接口与红外通信模块的接受器连接,输出接口与语音模块和灯光控制模块连接,输入输出接口与时钟及显示模块连接,各个模块有机的结合成一个整体。其主要技术特征是:基于单片机控制,通过时钟芯片,实现与传统闹铃一样定时和计时功能;通过红外通信遥控器预先设定闹铃时间,选择铃声音乐,按闹铃键启动闹铃工作,按取消键停止闹铃工作;到达设定的时间,单片机同时启动语音模块和灯光控制模块,语音模块播放音乐,并逐渐增强,同时灯光由弱到强产生渐变,声音和灯光到一定的强度不再增加;语音芯片除了存储多种音乐信息,供用户选择喜欢的音乐作为铃声外,还录制不同的语音报时段,当到达整点时,单片机调用对应的语音报时段,进行整点报时。 As shown in Figure 1, the intelligent light alarm includes AT89S52 single-chip microcomputer, infrared communication module, voice module, lighting control module, clock and display module. The module is connected with the lighting control module, the input and output interfaces are connected with the clock and the display module, and each module is organically combined into a whole. Its main technical features are: based on single-chip microcomputer control, through the clock chip, the same timing and timing functions as the traditional alarm clock are realized; the alarm time is preset through the infrared communication remote control, the ringtone music is selected, and the alarm is activated by pressing the alarm button. Press the cancel button to stop the alarm; when the set time is reached, the single-chip microcomputer starts the voice module and the light control module at the same time, the voice module plays music, and gradually increases, and at the same time, the light changes gradually from weak to strong, and the sound and light reach a certain intensity. In addition; the voice chip not only stores a variety of music information for the user to choose favorite music as the ringtone, but also records different voice announcement periods.

如图2所示,红外通信模块包括红外发射和红外接收两部分,红外发射部分为21键红外遥控器,主要包括键盘矩阵、编码调制、LED红外发送器;红外接收部分为HS138B一体化红外接收头,主要包括光电转换放大器、解调电路和解码处理程序。通过红外遥控器工作能够设定闹铃时间、选择闹铃音乐等,手动控制声、光等设备,开启或者关闭闹铃工作等。 As shown in Figure 2, the infrared communication module includes two parts: infrared transmitter and infrared receiver. The infrared transmitter is a 21-key infrared remote control, mainly including keyboard matrix, code modulation, and LED infrared transmitter; the infrared receiver is an HS138B integrated infrared receiver. The head mainly includes photoelectric conversion amplifier, demodulation circuit and decoding processing program. Through the infrared remote control, you can set the alarm time, select the alarm music, etc., manually control the sound, light and other equipment, and turn on or off the alarm work.

21键红外遥控器,采用脉冲宽度调制编码格式编码调制,通过“0”和“1”的编码方式实现脉宽调制,包括周期为2.25ms的组合表示二进制的“1”,脉宽为0.56ms,间隔为1.69ms;周期为1.125ms的组合表示二进制的“0”,脉宽为0.56ms,间隔为0.56ms。通过周期的不同,实现对“1”和“0”编码调制。 The 21-key infrared remote control adopts the pulse width modulation coding format code modulation, realizes pulse width modulation through the coding method of "0" and "1", including the combination with a period of 2.25ms to represent binary "1", and the pulse width is 0.56ms , the interval is 1.69ms; the combination with the period of 1.125ms means binary "0", the pulse width is 0.56ms, and the interval is 0.56ms. Through the difference of the period, the code modulation of "1" and "0" is realized.

21键红外遥控器具体工作过程是:红外遥控器的每个按键对应着不同的32位二进制数,当某个按键被按下,编码调制把32位二进制数转换成脉冲形式的信号,再经过LED红外发送器将红外脉冲信号发送出去。 The specific working process of the 21-key infrared remote control is: each key of the infrared remote control corresponds to a different 32-bit binary number. When a key is pressed, the code modulation converts the 32-bit binary number into a pulse signal, and then passes The LED infrared transmitter sends out the infrared pulse signal.

HS138B一体化红外接收头,除了工作电源引脚GND和VCC外,还有脉冲信号输出接口引脚OUT。GND和VCC与单片机工作电源地和+5V连接,OUT与单片机的外部中断请求输入段INT1(P3.3)连接。 HS138B integrated infrared receiver, in addition to the working power supply pins GND and VCC, also has a pulse signal output interface pin OUT. GND and VCC are connected with the working power ground of the microcontroller and +5V, and OUT is connected with the external interrupt request input segment INT1 (P3.3) of the microcontroller.

HS138B一体化红外接收头具体工作过程是;HS138B红外接收头检测有红外脉冲信号时,向单片机产生中断请求,调用解码处理程序。 The specific working process of the HS138B integrated infrared receiver is: when the HS138B infrared receiver detects an infrared pulse signal, it generates an interrupt request to the single-chip microcomputer and calls the decoding processing program.

解码处理程序流程图如图3所示,对通过接收头的解调电路输出信号进行调制解码,得到32位二进制码存储在单片机的内存中,并对各个按键的码进行判断,设定各个按键的功能。 The flow chart of the decoding processing program is shown in Figure 3. The output signal of the demodulation circuit of the receiving head is modulated and decoded to obtain a 32-bit binary code stored in the memory of the single-chip microcomputer, and the code of each button is judged, and each button is set function.

如图1所示,语音模块选用美国ISD公司生产的ISD4002语音芯片和扬声器,通过单片机调用播放语音芯片中存放的某段音乐和报时声音。如当时钟到达设置的闹铃时间时,单片机调用语音芯片存储的某音乐段,播放音乐,时间约30秒;当时钟到达整点时间时,单片机调用语音芯片进行语音报时,时间约3-5秒。在播放音乐和语音报时过程中,控制语音播放工作状态指示灯(发光二极管)亮,并可通过自动调节音量数字电位器改变电流,经LM386放大器放大后控制扬声器输出的声音强度。 As shown in Figure 1, the voice module selects the ISD4002 voice chip and speaker produced by the American ISD Company, and calls and plays a certain piece of music and timekeeping sound stored in the voice chip through the single-chip microcomputer. For example, when the clock reaches the set alarm time, the single-chip microcomputer calls a certain music segment stored in the voice chip and plays the music for about 30 seconds; Second. During the process of playing music and voice time reporting, control the voice playback working status indicator light (light-emitting diode) to light up, and the current can be changed through the digital potentiometer to automatically adjust the volume, and the sound intensity output by the speaker can be controlled after being amplified by the LM386 amplifier.

如图4所示, ISD4002语音芯片和AT89S52单片机连接关系是:ISD4002语音芯片的片选/SS与单片机的P1.0连接,时钟XCLK与P1.1连接,数据输入MOSI与P1.2连接,数据输出MISO与P1.3连接,中断请求INT与INT0(P3.2)连接。另外通过P1.7控制语音播放工作状态指示灯。 As shown in Figure 4, the connection relationship between the ISD4002 voice chip and the AT89S52 microcontroller is: the chip select/SS of the ISD4002 voice chip is connected to P1.0 of the microcontroller, the clock XCLK is connected to P1.1, the data input MOSI is connected to P1.2, and the data input The output MISO is connected with P1.3, and the interrupt request INT is connected with INT0 (P3.2). In addition, control the voice playback working status indicator through P1.7.

如图5所示,语音模块在供电以后,单片机调用播放语音的工作流程是:发掉电命令,再发上电命令初始化语音芯片;发播放语音段地址为XX命令;发播放命令,此时扬声器会从语音段XX地址开始放音,当出现语音段结束符EOM时,产生中断信号INT,即该段结束,单片机检测到中断信号后,发掉电命令,立即停止播放。 As shown in Figure 5, after the voice module is powered on, the workflow of the single-chip microcomputer calling and playing voice is: send a power-off command, and then send a power-on command to initialize the voice chip; The loudspeaker will play from the voice segment XX address. When the end of the voice segment EOM appears, an interrupt signal INT is generated, that is, the end of the segment. After the single-chip microcomputer detects the interrupt signal, it sends a power-down command to stop playing immediately.

如图6所示,灯光控制模块由单片机作为控制器,采用晶闸管调光电路调节灯光强弱。晶闸管调光电路有隔离电路和晶闸管电路构成,采用MOC3021双向晶闸管输出型光电耦合器隔离单片机系统和外部的晶闸管。通过调节单片机输出端口P2.7输出脉冲信号的占空比调节灯光的明暗程度。当闹铃时间到达时,灯光控制功能被调用,灯泡的亮度从弱到强变化,达到最亮的强度并延时一定时间。 As shown in Figure 6, the light control module uses a single-chip microcomputer as a controller, and uses a thyristor dimming circuit to adjust the light intensity. The thyristor dimming circuit is composed of an isolation circuit and a thyristor circuit, and the MOC3021 bidirectional thyristor output photocoupler is used to isolate the single-chip microcomputer system and the external thyristor. Adjust the brightness and darkness of the light by adjusting the duty cycle of the pulse signal output by the output port P2.7 of the microcontroller. When the alarm time arrives, the light control function is invoked, and the brightness of the bulb changes from weak to strong, reaching the brightest intensity and delaying for a certain period of time.

灯光控制模块具体工作过程是:单片机的P2.7端口输出低电平信号时,MOC3021的输入端有电流输入,双向晶闸管导通,触发外部的晶闸管Triac导通,使得AC220V的电灯LIGHT回路导通,灯被点亮;反之,当单片机的P2.7端口输出高电平时, MOC3021 的双向晶闸管截至,外部晶闸管Triac断开,相当于电灯LIGHT回路开路,灯熄灭;若单片机P2.7端口输出脉冲信号,晶闸管Triac交替导通和断开,可使灯交替亮灭。导通和截止时间比例越大,则灯看起来越亮,反之导通和截止时间比例越小,则灯看起来越暗。 The specific working process of the lighting control module is: when the P2.7 port of the microcontroller outputs a low-level signal, the input terminal of the MOC3021 has a current input, the bidirectional thyristor is turned on, and the external thyristor Triac is triggered to turn on, so that the AC220V lamp LIGHT circuit is turned on , the lamp is lit; on the contrary, when the P2.7 port of the microcontroller outputs a high level, the bidirectional thyristor of MOC3021 is cut off, and the external thyristor Triac is disconnected, which is equivalent to an open circuit of the LIGHT circuit of the lamp, and the lamp is turned off; if the P2.7 port of the microcontroller outputs a pulse signal, the thyristor Triac is turned on and off alternately, which can make the lights turn on and off alternately. The larger the ratio of on-time and off-time, the brighter the light looks, and the smaller the ratio of on-time and off-time, the dimmer the light looks.

如图7所示,灯光控制模块单片机控制灯光渐变子程序流程是:初始化,设定定时中断25us,开中断,设定P2.7端口输出脉冲信号周期6ms,占空比初值1,最小0,低电平时间初值0,P2.7端口初始为低电平;低电平时间到,则低电平翻转为高电平;高电平时间到,则高电平翻转为低电平;循环维持20个周期占空比不变,20个周期到则调节占空比,低电平时间加1,循环直到占空比到最小0,结束返回。这样通过调节输出脉冲的占空比来实现灯光的渐变。 As shown in Figure 7, the subroutine flow of the light control module single-chip microcomputer control light gradient is: initialization, set the timing interrupt 25us, open the interrupt, set the P2. , the initial value of the low level time is 0, and the P2.7 port is initially low level; when the low level time is up, the low level will be turned into a high level; ;The cycle keeps the duty ratio unchanged for 20 cycles, and when the 20 cycles are reached, the duty cycle is adjusted, and the low level time is increased by 1, and the cycle is continued until the duty cycle reaches the minimum 0, and the end returns. In this way, the gradual change of the light is realized by adjusting the duty cycle of the output pulse.

如图1所示,时钟及显示模块包括时钟芯片和LCD显示屏。通过时钟芯片实现定时计时,通过LCD显示屏及红外遥控器设定闹铃时间等工作参数,通过LCD显示屏显示时钟和工作状态等。时钟芯片选用了DS1302,LCD显示屏采用1602型号的LCD。 As shown in Figure 1, the clock and display module includes a clock chip and an LCD display. Timing is realized through the clock chip, working parameters such as alarm time are set through the LCD display and infrared remote control, and the clock and working status are displayed through the LCD display. The clock chip is DS1302, and the LCD display is 1602 type LCD.

如图8所示,单片机和时钟芯片DS1302串行接口是:P2.3接时钟芯片复位RST,P2.5接时钟芯片串行时钟SLCK,P2.4接时钟芯片串行数据I/O。DS1302时钟芯片上电后自动从初始时间开始计时。 As shown in Figure 8, the serial interface between the microcontroller and the clock chip DS1302 is: P2.3 is connected to the clock chip reset RST, P2.5 is connected to the clock chip serial clock SLCK, and P2.4 is connected to the clock chip serial data I/O. The DS1302 clock chip automatically starts counting from the initial time after it is powered on.

如图9所示,时钟芯片DS1302驱动程序流程是:初始化,要求/RST为低电平,SCLK为低电平,/RST被设置为高,启动了一个数据传送;SCLK发送16个脉冲完成一次数据传送,前8个方波用于输入命令字节,后8个方波用于数据的输出(读DS1302)或数据的输入(写DS1302),在SCLK的上升沿,I/O线上数据被送入DS1302,在SCLK下降沿DS1302输出数据在I/O线上;/RST变为低电平,结束数据传送。 As shown in Figure 9, the clock chip DS1302 driver program process is: initialization, requires /RST to be low level, SCLK is low level, /RST is set to high, and a data transmission is started; SCLK sends 16 pulses to complete one time Data transmission, the first 8 square waves are used to input command bytes, the last 8 square waves are used for data output (read DS1302) or data input (write DS1302), on the rising edge of SCLK, the data on the I/O line It is sent to DS1302, and DS1302 outputs data on the I/O line at the falling edge of SCLK; /RST becomes low level, ending data transmission.

时钟及显示模块时钟操作工作包括:设定DS1302时钟芯片工作方式;设置初始时间等(数据传送从单片机到时钟芯片);读取DS1302内部的实时时钟信息(数据传送从时钟芯片到单片机),然后经过处理后送往LCD显示缓冲区。 The clock operation of the clock and display module includes: setting the working mode of the DS1302 clock chip; setting the initial time, etc. (data transmission from the microcontroller to the clock chip); reading the real-time clock information inside the DS1302 (data transmission from the clock chip to the microcontroller), and then After processing, it is sent to the LCD display buffer.

如图10所示,1602型号的LCD显示器与单片机连接是:DB0-DB7数据端与P0口相连,时钟输入端RS与P2.0口相连,读写控制端R/W与P2.1口相连,使能端E与P2.2口相连。 As shown in Figure 10, the connection between the 1602 model LCD display and the microcontroller is: DB0-DB7 data terminals are connected to P0 port, clock input port RS is connected to P2.0 port, and read-write control port R/W is connected to P2.1 port , the enable end E is connected to the P2.2 port.

如图11所示,1602型号的LCD显示器读写工作过程是: As shown in Figure 11, the reading and writing process of the LCD display of the 1602 model is:

1)     开始E高电平,RS低电平,RW低电平,准备命令传送。 1) Start E high level, RS low level, RW low level, ready for command transmission.

2)     然后写命令,功能初始化:8位数据,两行,5*7矩阵,光标右移,光标不显示,开显示屏。E低电平时,传送初始化命令。 2) Then write commands, function initialization: 8-bit data, two rows, 5*7 matrix, move the cursor to the right, the cursor does not display, and turn on the display. When E is low, the initialization command is transmitted.

3)     命令传送后接着传送字符显示的位置地址,使E高电平,RS低电平,RW低电平准备地址传送,E低电平时,传送地址。 3) After the command is transmitted, the location address displayed by the character is transmitted, so that E is high, RS is low, and RW is low to prepare for address transmission. When E is low, the address is transmitted.

4)     最后是数据传送,使E高电平,RS高电平,准备数据传送,当E低电平时,传送数据。 4) Finally, data transmission, make E high level, RS high level, ready for data transmission, when E is low level, transmit data.

数据传送完后复位RS,RW和E。 Reset RS, RW and E after data transmission.

Claims (2)

1.一种智能灯光闹铃,包括单片机、红外通信模块、语音模块、灯光控制模块和时钟及显示模块;其特征在于:所述单片机分别通过输入接口与红外通信模块的接受器连接,输出接口与语音模块和灯光控制模块连接,输入输出接口与时钟及显示模块连接; 1. A kind of intelligent lighting alarm, comprising single-chip microcomputer, infrared communication module, voice module, lighting control module and clock and display module; It is characterized in that: described single-chip microcomputer is connected with the receiver of infrared communication module by input interface respectively, output interface Connect with the voice module and lighting control module, and connect the input and output interfaces with the clock and display module; 所述单片机用于计时和控制语音模块、灯光控制模块和时钟及显示模块,所述单片机还用于与红外通信模块通信; The single-chip microcomputer is used for timing and controlling the voice module, the lighting control module, the clock and the display module, and the single-chip microcomputer is also used for communicating with the infrared communication module; 所述语音模块用于播放音乐和控制音量的大小; The voice module is used to play music and control volume; 所述灯光控制模块用于控制灯光的亮度; The lighting control module is used to control the brightness of the lighting; 所述时钟及显示模块用于显示时间和控制界面; The clock and display module are used to display time and control interface; 所述红外通信模块包括红外发射器和红外接收器,用于闹钟的远程控制; The infrared communication module includes an infrared transmitter and an infrared receiver for remote control of the alarm clock; 所述的单片机为AT89S52,所述的语音模块为ISD4002语音芯片,所述ISD4002语音芯片的片选/SS与所述单片机的P1.0连接,其时钟XCLK与所述单片机的P1.1连接,其数据输入MOSI与所述单片机的P1.2连接,其数据输出MISO与所述单片机的P1.3连接,其中断请求INT与所述单片机的P3.2连接。 Described single-chip microcomputer is AT89S52, and described voice module is ISD4002 voice chip, and the chip selection/SS of described ISD4002 voice chip is connected with P1.0 of described single-chip microcomputer, and its clock XCLK is connected with P1.1 of described single-chip microcomputer, Its data input MOSI is connected with P1.2 of the single-chip microcomputer, its data output MISO is connected with P1.3 of the single-chip microcomputer, and its interrupt request INT is connected with P3.2 of the single-chip microcomputer. 2.根据权利要求1所述的一种智能灯光闹铃,其特征在于,所述灯光控制模块为晶闸管调光电路,包括隔离电路和晶闸管电路,所述单片机输出端口P2.7与隔离电路相连,用于通过输出信号调节灯光亮度。 2. An intelligent light alarm according to claim 1, wherein the light control module is a thyristor dimming circuit, including an isolation circuit and a thyristor circuit, and the output port P2.7 of the single-chip microcomputer is connected to the isolation circuit , used to adjust the brightness of the light through the output signal.
CN201110402582.2A 2011-12-07 2011-12-07 Intelligent light alarm Expired - Fee Related CN102520610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110402582.2A CN102520610B (en) 2011-12-07 2011-12-07 Intelligent light alarm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110402582.2A CN102520610B (en) 2011-12-07 2011-12-07 Intelligent light alarm

Publications (2)

Publication Number Publication Date
CN102520610A CN102520610A (en) 2012-06-27
CN102520610B true CN102520610B (en) 2014-04-09

Family

ID=46291563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110402582.2A Expired - Fee Related CN102520610B (en) 2011-12-07 2011-12-07 Intelligent light alarm

Country Status (1)

Country Link
CN (1) CN102520610B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102854791A (en) * 2012-08-18 2013-01-02 谢玲飞 Secondary control split alarm clock
CN102854792A (en) * 2012-08-18 2013-01-02 谢玲飞 Split alarm clock
CN103687211A (en) * 2013-11-30 2014-03-26 四川邮科通信技术有限公司 Wireless remote control lighting device based on STC89C52RC single-chip microcomputer
CN104822214A (en) * 2015-05-29 2015-08-05 桂林电子科技大学 Intelligent light controller
CN105607458A (en) * 2015-12-30 2016-05-25 陈慧婷 Alarm clock with pattern lamp
CN107861371A (en) * 2017-12-26 2018-03-30 南京工程学院 The electronic alarm that a kind of illumination is waken
CN109283834A (en) * 2018-11-26 2019-01-29 深圳市聚酷智能科技有限公司 Children's alarm clock, control method and children's alarm clock system
CN110161833A (en) * 2019-04-08 2019-08-23 广州启上设计有限公司 A kind of counting-down reminding method, system and the storage medium of desk lamp

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202522863U (en) * 2011-12-07 2012-11-07 江苏大学 Intelligent lighting alarm

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2048202U (en) * 1989-05-13 1989-11-22 徐田青 Quartz electric alarm clock
JP4656201B2 (en) * 2008-07-22 2011-03-23 パナソニック電工株式会社 Discharge lamp lighting device and lighting fixture
CN101957595A (en) * 2009-07-16 2011-01-26 张钦明 Method and device for ringing with sound
CN101605157A (en) * 2009-07-16 2009-12-16 中兴通讯股份有限公司 The implementation method of a kind of acoustic control quarter-bell and acoustic control quarter-bell
CN201622764U (en) * 2009-12-23 2010-11-03 周德峰 Multifunctional electronic perpetual calendar

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202522863U (en) * 2011-12-07 2012-11-07 江苏大学 Intelligent lighting alarm

Also Published As

Publication number Publication date
CN102520610A (en) 2012-06-27

Similar Documents

Publication Publication Date Title
CN102520610B (en) Intelligent light alarm
CN202522863U (en) Intelligent lighting alarm
CN205227013U (en) Intelligence light awakens desk lamp up
CN201772303U (en) A natural wake-up light
CN204879632U (en) Multi -functional intelligence learning lamp
CN201897132U (en) Timing desk lamp
CN202996165U (en) Intelligent electronic perpetual calendar
CN101950154A (en) Multifunctional environment stimulation device
CN201293917Y (en) Multifunctional alarm clock
CN205507386U (en) Intelligence reputation alarm clock
CN202735705U (en) Multifunctional alarm clock
CN201731425U (en) LED intelligent voice tree lamp
CN206178349U (en) Optoacoustic alarm clock
CN213581776U (en) Light awakening system for smart home
CN202675202U (en) A remote control rotating lamp base
CN206975420U (en) A kind of smooth wake-up alarm
CN204633769U (en) A kind of wireless blue tooth light is got up device
CN200976097Y (en) Multifunction digital clock
CN201688234U (en) Desk lamp for electronic metronome
CN206833169U (en) Intelligent alarm clock
CN105354950A (en) Doorbell ringing adjustment control device based on piezoelectric sensing
CN116758684B (en) Light wake-up system and method
CN217335965U (en) A smart music light string
CN105721020A (en) Wireless bluetooth light get-up device
CN205508084U (en) TV remote controller positioner

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140409

Termination date: 20141207

EXPY Termination of patent right or utility model