1、 基于单片机的音乐彩灯控制器设计 摘要摘要 本设计是一种基于AT89C51单片机音乐控制彩灯的方案,实现单片机演奏音乐,并且对LED彩 灯随音符频率的不同而闪烁发光。本方案以AT89C51单片机作为主控核心,通过三极管放大电流使用蜂鸣 器播放音乐,利用编程实现亮灯循环模式,在有8个LED彩灯,根据用户需求可以编写若干种亮灯模式.例如 左右闪烁,隔几个亮灭,蜂鸣器可以根据用户需求改写编程播放各种音乐。本方案具有设计简单、体积小、 元器件少、电路结构简单等优点。该设计方案设计及其简单,典型的AT89C51单片机,亮灯模式多,播放 各种类型的音乐,具有体积小、价格低、低能耗等优点。在美丽的都市夜晚,
2、彩灯的循环亮灭,播放动人 的音乐,衬托出美丽的氛围。 关键词关键词 AT89C51 LED 彩灯 音乐 Based on single chip music lights controller design Abstract :This design is a musical based on AT89C51 microcontroller control program Lantern,realize MCU playing music, And the LED lights on the frequency of different notes with the light flashin
3、g。 The program for AT89C51 microcontroller as the control center, the current through the transistor amplification using the buzzer to play music, Using programming lighting cycle mode, with 8 LED Lantern, according to user needs to write some kind of switch-mode. For example, flashing around, every
4、 few light off, the buzzer can be adapted according to user requirements play a variety of music programming . The program is simple in design, small size, less components, and simple circuit structure. The design and simple design, the typical 89c51 microcontroller, a switch-mode and more, playing
5、all types of music, has a small size, low price and low power consumption and so on. In the beautiful city at night, lanterns light off cycle, play beautiful music, brings out the beautiful atmosphere. Key words :AT89C51 LED Lantern music 引言 1 1 音乐彩灯方案设计与选择 1 1.1 设计要求 . 1 1.2 基本原理 . 1 1.3 设计电源 . 2 1
6、.4 频率音符 . 2 2 音乐彩灯设计过程 . 3 2.1 元器件选取 . 3 2.2 电路设计 . 3 2.2.1 元器件介绍 . 3 2.2.2 音乐彩灯构思 5 2.3 软件设计 . 6 2.3.1 编程介绍 . 6 2.3.2 设计程序 . 9 3 心得体会 . 11 3.1 课程设计总结 11 3.2 收获与体会 11 参考文献 . 12 第 1 页 共 12页 引言 单片机诞生于 1971 年,经历了 SCM、MCU、SoC 三大阶段,早期的 SCM 单片机都是 8 位或 4 位的。其中最成功的是 INTEL 的 8031,此后在 8031 上发展出了 MCS51 系列 MCU 系统。基于这一 系统的单片机系统直到现在还在广泛使用。 随着工业控制领域要求的提高, 开始出现了 16 位单片机, 但因为性价比不理想并未得到很广泛的应用。90 年代后随着消费电子产品大发展,单片机技术得到 了巨大提高。随着 INTEL i960 系列特别是后来的 ARM 系列的广泛应用,32 位单片机迅速取代 16 位单片机的高端地位,并且进入主流市场。 而传统的 8 位单片机的