基于单片机控制的定时插座摘 要本文设计了一款基于 STC89C52RC 单片机控制的光敏定时插座,它可以通过人为设定时间和光照强度的强弱,实现自动通电和断电功能,从而达到节能的目的。硬件电路设计包括:单片机最小系统电路、电源稳压电路、1602 液晶显示电路、独立式按键电路、温度控制电路、光敏电阻电路、继电器电路以及报警电路,设计原理主要利用 DS1302 时钟芯片和 PCF8591 芯片经 A/D 转换后在 1602 液晶上显示定时时间和光强大小,利用按键来选择工作模式和设定定时时间以及设定光照的阈值,当定时时间结束或光照强度小于设定光照阈值时,通过继电器的吸合作用来驱动插座的切断,红色发光二极管和蜂鸣器的状态来表示插座的工作状态。软件程序的设计包括:1602 液晶显示程序、DS1302 定时程序、AD 转换程序,按键处理程序、蜂鸣器报警程序,在本文的最后对设计了硬件和软件部分,并进行了调试和制作,基于单片机控制的定时插座系统具有电路简单,可靠性高,定时准确等特点,基本满足设计要求。关键词:STC89C52;光敏;定时;插座装订线THE TIMING SOCKET BASED ON SINGLE-CHIP MICROCOMPUTER ABSTRACTDesign a based on SCM STC89C52RC photosensitive regular outlet, by artificially setting time and the strength of the light intensity, it can achieve automatic power-on and power-off function, so as to achieve the purpose of energy saving. Hardware circuit design includes: the smallest single-chip system circuit, power regulator circuit, 1602 LCD circuit, an independent key circuit, temperature control circuit, the photoresistor circuit, the relay circuit and alarm circuit design principles mainly use the DS1302 clock chip and PCF8591 chip by A / D conversion timing in 1602 and two light levels, use keys to select the operating mode and set the timing and setting a threshold of light, when the time runs out or when the light intensity is less than the set light threshold,the state of the red light emitting diode and a buzzer to indicate the working status of the socket. Software desi...