0% found this document useful (0 votes)
3 views61 pages

Finalgp

The document presents a project report on 'Dual-Mode IR Communication Between Two Embedded Systems,' submitted for a B.Tech degree in Electronics and Communication. It describes a system using AT89S52 microcontrollers to transmit both digital control data and analog voice signals via infrared communication, highlighting the design and implementation of a transmitter and receiver unit. The project aims to bridge the gap between digital and analog domains, showcasing practical applications in embedded systems engineering.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
3 views61 pages

Finalgp

The document presents a project report on 'Dual-Mode IR Communication Between Two Embedded Systems,' submitted for a B.Tech degree in Electronics and Communication. It describes a system using AT89S52 microcontrollers to transmit both digital control data and analog voice signals via infrared communication, highlighting the design and implementation of a transmitter and receiver unit. The project aims to bridge the gap between digital and analog domains, showcasing practical applications in embedded systems engineering.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
Dual-Mode IR Communication Between Two Embedded System. A Major Project Report Submitted for the Evaluation and Partial Fulfillment of the requirement for the degree of B-tech in Electronics and Communication. SUBMITTED BY: SUPERVISED BY: PRASHANT CHOUDHARY (225/UEC/017) [Link] SHARMA, SUDHANSHU RANJAN (225/UEC/027) VISHAL KUMAR (225/UEC/026) MAKARDHWAJ (225/UEC/009) DEPARIM T OF ELECTROICS AND COMMUNICATION SCHOOL OF INFORMATION AND COMMI TECHNOLOGY, ICATION GAUTAM BUDDHA UNIVERSITY,GREATER NOIDA-201312, GAUTAM BUDDHA NAGAR,UTTAR PRADESH,INDIA ® Oey SCHOOL OF INFORMATION AND COMMUNICATION TECHNOLOGY GAUTAM BUDDHA UNIVERSITY, GREATER NOIDA, 201312, U. P., (INDIA) Candidate’s Declaration We, hereby, certify that the work embodied in this Project report entitled “Dual-Mode IR Communication Between Two Embedded System” in partial fulfilment of the requirements for the award of the Degree of B. Tech (ECE) submitted to the School of Information and Communication Technology, Gautam Buddha University, Greater Noida is an authentic record of our own work carried out under the supervision of Dr, Vidushi Sharma, School of ICT. The matter presented in this report has not been submitted to any other University / Institute for the award of any other degree or diploma. Responsibility for any plagiarism-related issue stands solely with us. Prashant Choudhary(225/UEC/017) Sudhanshu Ranjan(225/UEC/027) Vishal Kumar(225/UEC/026) Makardhwaj yadav(225/UBC/009) This is to certify that the above statement made by the candidates is correct to the best of my knowledge and belief. However, responsibility for any plagiarism- related issue solely stands with the students. Name of Supervisors ~ Dr. Vidushi Sharma Acknowledgement First and foremost, we would like to thank God Almighty for giving us the strength, knowledge, ability and opportunity to undertake this and to persevere and complete it satisfactorily. Without his blessings, this achievement would not have been possible. We Have made efforts in this project. However, it would not have been possible without the kind support and help of many individuals and organizations. We would like to extend our sincere thanks to all of them. We are highly indebted to Dr. Vidushi Sharma, for their guidance, and supervision as well as for providing necessary information. We would like to thank the Dean of SOICT, Prof. Arpit Bhardhwaj and HOD of E Dr. Vidushi Sharma whose support helped us to work on this research area. We would Like to express our gratitude towards our friends & family members’ kind cooperation and encouragement which helped us in taking up this project Abstract This project demonstrates a wi Infrared (IR) link between two embedded systems based on the AT89SS2 (8051 Jess communication and control system over an family) microcontroller. The unique feature of this system is its dual-mode operation, allowing for the transmission of both digital control data and real-time analog voice signals. The system comprises a Transmitter (TX) unit and a Receiver (RX) unit. The TX unit features a 3x3 matrix keypad for number input, a microphone, and a DPDT "Data/Voice” switch, When set to "Data" mode, pressing a number key causes the TX microcontroller to send a corresponding encoded IR signal. On the RX side, the microcontroller decodes the signal, displays the received number on a 7- segment LED, and controls a peripheral DC fan/motor. When the switch is set to "Voice" mode, the microphone is activated, and the analog, signal is modulated and transmitted via the IR LED. The RX unit includes 2 TSOP- based demodulator and an audio amplifier circuit that drives a speaker, providing a real-time analog voice communication link. The project highlights both digital and analog interfacing techniques with the 8051 microcontroller. LIST OF FIGURES Sho. Figure Caption Page no. T ‘Transmitter unit block | 8 diagram, 2 Receiver unit block — | 10 diagram, 3 ‘ATSOSS2 (BOSI) | *A2 Microcontroller Pin Diagram 4 7805 Voltage | 14 Regulator Pinout 3 Segment Display | 13 Decoding Table 6 16 Common — Cathode Common Anode 7- Segment Display Pin Configuration TABLE OF CONTENTS PAGE NO. DECLARATION i ACKNOWLEDGEMENT ii ABSTACT it LIST OF FIGURES 1. Chapter 1: Introduction 13 1.1. Overview 1.2. Motivation 1.3. Objectives 1.4, Project Scope 2. Chapter 2: Literature Survey 47 2.1, Brief History of IR Communication 2.2, Introduction to Embedded Systems and 8051 2.3. Project Motivation and Challenges 3. Chapter 3: System Architecture can 3.1, Transmitter Unit Architecture 3.2. Receiver Unit Architecture 4. Chapter 4: Hardware Description and Interfacing 1218 4.1, AT89852 Microcontroller 4.2. Power Supply Unit (Transformer, Rectifier, 7805) 4.3. Input Peripherals (Keypad, Microphone) 4.4, Output Peripherals (7-Segment Display, Speaker, DC Motor) 4.5. IR Communication Modules (IR LED, Receiver) 4.6, Audio Amplifier Circuit (LM386) 5. Chapter 5: Cireuit Diagram and Working Principle 19-22 5.1, Complete Circuit Connection Explanation (Referencing Figures) 5.2. Detailed Working Principle: Data Mode (Digital) 5.3. Detailed Working Principle: Voice Mode (Analog) 7. Chapter 6: Software Implementation 6.1, Algorithm for Transmitter microcontroller 6.2. Algorithm for Receiver microcontroller 6.3. Code Snippets (Keypad Scanning and Display Update) Chapter 7: Result Analysis and Discussions 7.1, Test Setup and Methodology 7.2. Observed Results (Data and Voice Modes) 7.3, Discussions Chapter 8: Advantages, Disadvantages, and Future Scope 8.1, Advantages 8.2. Disadvantages 8.3. Future Scope Chapter 9: Conclusion References / Bibliography Appendices Appendix A: Microcontroller Assembly Code (TX/RX) Appendix B: List of Components and Cost Analysis vi 23-30 31-35 36-39 40 4 42-60 CHAPTER-1 INTRODUCTION 1.10verview Infrared (IR) communication is a fundamental method of wireless data transfer commonly used in remote controls and short-range consumer devices. This project takes this concept further by demonstrating a robust and versatile communication link between two independent embedded systems. The key innovation is the creation of a system capable of transmitting both structured digital control data and real-time analog voice signals over the same IR channel. This system demonstrates the practical applications of microcontroller interfacing with both digital inputs (keypads) and analog transducers (microphones, speakers), showcasing the breadth of embedded systems engineering. 1.2Motivation The rapid advancement of wireless technologies has revolutionized how embedded systems interact, control peripherals, and exchange data, While modern protocols like Bluetooth, Wi-Fi, and Zigbee dominate high-speed applications, Infrared (IR) communication remains one of the most reliable, cost-effective, and energy-efficient methods for short-range wireless control. The primary motivation for selecting this project was to deeply understand the foundational principles of wireless data transmission and hardware interfacing by building a complete communication link fiom scratch. Furthermore, most academic projects focus purely on either digital data transmission or analog signal processing independently. The core motivation behind this specific design was to bridge the gap between analog and digital domains by creating a dual- mode system. Transmitting discrete digital pulses (data mode) for controlling a motor and a 7-segment display demonstrates precise timing and control logic. Conversely, taking a raw analog audio signal from a microphone, amplifying it, and modulating it over an IR light beam (voice mode) presents a completely different set of engineering challenges related to signal processing and analog circuit design. Finally, working with the classic 8051 microcontroller architecture (AT89S52) provides an excellent educational foundation. By programming the system at the bare- metal level and physically designing, etching, and soldering the PCBs, this project serves as a comprehensive capstone. It consolidates theoretical knowledge of microprocessors, analog electronics, and communication systems into a single, tangible, and working hardware prototype. 1.30bjectives The primary objectives of this project are + To establish successful wireless IR communication between two embedded systems, * To demonstrate digital data transmission for controlling remote peripherals (7- segment display and DC fan). ‘© To implement a real-time analog voice transmission link via IR. © To design a dual-mode system with an easy user-selection switch, * To gain practical experience in PCB design, component soldering, power supply regulation, and interfacing various ECE peripherals (microphone, speaker, motor, display). 1.4Project Scope The scope of this project encompasses the complete hardware design, software development, and physical fabrication of a simplex (one-way) wireless communication system. Specifically, the project boundaries and deliverables are defined as follows: © Hardware Development: The project involves designing and assembling two distinct PCB units—a Transmitter and a Receiver. The hardware scope is limited to utilizing the AT89S52 (8051 family) microcontroller operating at standard clock frequencies. It includes the {tegration of specific input peripherals (a 3x3 matrix keypad and an electret microphone) and output peripherals (a 7-segment display, a 2 DC motor-driven fan, and a loudspeaker). Dual-Mode Funetionality: The core scope is the successful implementation of a selectable dual-mode transmission system over a single Infrared (IR) channel. Data Mode: Encoding and transmitting discrete digital inputs (numbers 1-9) to execute remote hardware actions (updating a display and toggling a motor), Voice Mode: Capturing, amplifying, and modul: \g real-time analog audio signals to be demodulated and played back at the receiver end using an LM386 audio amplifier. Software Implementation: The software scope involves writing, debugging, and burning low-level firmware (typically Assembly or Embedded C) into the microcontrollers. This includes algorithms for matrix keypad scanning, signal timing delays, IR pulse generation, and digital decoding logic. Operational Limitations: The communication range is bounded by the physical limitations of standard Infrared technology. Therefore, the scope is restricted to short-range, line-of-sight communication (typically a few meters), making it suitable for indoor environments without physical obstructions between the TX and RX LEDs. Application Focus: While developed as an educational prototype, the scope of this system demonstrates concepts highly applicable to shorterange secure industrial remote controls, localized voice-announcement systems, and smart home automation frameworks that require both data and audio interfacing without the complexity of Wi-Fi or Bluetooth protocols. CHAPTER 2 LITERATURE SURVEY 2.1Brief History of IR Communication The discovery of Infrared (IR) radiation dates back to the year 1800, when astronomer Sir William Herschel used a prism to refract light from the sun and detected invisible electromagnetic waves lying just beyond the red end of the visible spectrum. For over a century, the primary applications of IR were restricted to thermal measurements and specialised military optics, particularly during World War I In the context of wireless communication, IR technology saw its first major consumer breakthrough in the late 1970s and early 1980s. During this time, consumer electronics manufacturers began replacing older, interference-prone ultrasonic television remote controls with infrared versions. These early remote controls utilised simple pulse-coded transmission to send by control protocols. sic digital commands over short distances, laying the foundation for modern IR The 1990s marked a significant evolution with the establishment of the Infrared Data Association (IrDA). The InDA standard formalised protocols for short-range, point-to- point digital data transfer. This enabled devices such as early laptops, Personal Digital Assistants (PDAs), and mobile phones to exchange files and contact information Wirelessly before the widespread adoption of Radio Frequency (RF) technologies like Bluetooth and Wi-Fi, Today, while RF technologies have largely taken over high-bandwidth and non-line- of-sight communications, Infrared remains an indispensable technology in the embedded systems domain, Its simplicity, extremely low manufacturing cost, low power consumption, and immunity to radio frequency interference make it the preferred choice for dedicated short-range control links—principles that are directly leveraged in the dual-mode communication system developed in this project. 2.2Introduction to Embedded Systems and the 8051 Microcontroller + Embedded Systems Overview An embedded system is a highly specialised computing system comprising both hardware and software, designed to perform one or a few dedicated functions, often with real-time computing constraints. Unlike a general-purpose personal computer that can run a vast array of applications, an embedded system is tailored to a specific task, allowing engineers to optimize it to reduce the size, cost, and power consumption of the product while increasing reliability and performance. In the context of this project, both the ‘Transmitter and Receiver units act as independent embedded systems interacting with physical peripherals (keypads, motors, displays) and communicating via an optical channel. + The 8051 Microcontroller Architecture At the heart of the embedded systems designed for this project lies the 8051 microcontroller. Originally developed by Intel in 1980 for use in embedded systems, the 8051 is an 8-bit microcontroller based on the Harvard architecture. This architectural style utilizes separate memory spaces and buses for program instructions (ROM/Flash) and data (RAM), allowing the CPU to fetch an instruction and read/write data simultaneously, thereby improving execution speed. The standard 8051 architecture provides a robust set of features integrated into a single chip, which drastically reduces the need for external components, These features include: + &bit ALU: Capable of processing 8 bits of data at a time. + W/O Ports: Four 8-bit bidirectional input/output ports (Port 0, 1, 2, and 3), providing a total of 32 1/0 pins for interfacing with extemal devices. + Timers/Counters: Two (or three, depending on the variant) 16-bit timers used for generating precise delays, counting external events, or generating the 38kHz carrier frequency required for IR transmission. + Serial Communication: A full-duplex UART (Universal Asynchronous Receiver- Transmitter) for serial data transfer. + Interrupt System: A multi-source, multi-priority interrupt structure essential for handling asynchronous events like keypad presses or incoming IR signals The AT89S52 Variant While the original Intel 8051 is obsolete, its architecture became an industry standard, leading various manufacturers to produce enhanced derivatives, This project utilizes the AT89S52, manufactured by Atmel (now Microchip Technology), The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller that fully retains the classic 8051 instruction set and pinout. Crucially for project development, it features 8K bytes of In-System Programmable (ISP) Flash memory. This flash memory allows the microcontroller to be reprogrammed repeatedly without needing to remove the chip from the circuit board, making the iterative software development and debugging process highly efficient. Its combination of robust legacy architecture and modem flash memory makes it an ideal educational platform for bridging the gap between hardware interfacing and low-level software control. 2.3Project Motivation and Challenges Motivation The primary motivation behind this project was to move beyond theoretical textbook knowledge and engage in the complete lifecycle of hardware design and low-level software implementation. While modern microcontrollers (like Arduino or ESP32) offer high-level abstractions and readily available libraries, working with the classic 8051 architecture forces a deeper understanding of underlying computer architecture, memory mapping, and register-level programming. Specific motivating factors included: + Bridging Analog and Digital Domains: The most compelling aspect of this, project is its dual-mode capability. It requires solving the precise timing and logical challenges of digital communication (Data Mode) while simultaneously addressing the amplification and modulation challenges of analog signals (Voice Mode) within the same physical framework. + Practical Interfacing: The project nec sitates interfacing a wide variety of standard electronic components—from digital logic ICs (7447), displays, and motor drivers, to analog sensors (microphones) and transducers (speakers). + System-Level Design: Moving from a breadboard prototype to a finalized, soldered PCB layout requires careful consideration of power distribution, signal routing, and noise reduction, providing invaluable practical engineering experience, Key Challenges Addressed Developing this system presented several engineering challenges that had to be overcome: + Analog Signal Attenuation and Noise: In "Voice Mode," the electrical signal generated by the electret microphone is in the millivolt range. Designing an effective pre-amplifier stage that provides sufficient gain without introducing excessive noise or distortion before modulating the IR LED was a significant challenge. + IR Signal Range and Alignment: Infrared communication is inherently directional and prone to attenuation over distance or due to ambient light interference. Careful sele jon of the carrier frequency (38KHz) and the use of a dedicated receiver module (TSOP1738) were required to ensure reliable data transmission in normal indoor lighting conditions. + Timing Synchronization in Software: For the digital "Data Mode,” the 8051 microcontroller must ceurately generate specific pulse widths for transmission and precisely measure incoming pulse durations for reception. Developing the Assembly/Embedded C code to maint in this strict timing synchronization without hardware interrupts failing was critical for reliable data decoding. + Power Supply Stability: Driving inductive loads like a DC motor alongside sensitive microcontrollers and analog audio amplifiers on the same power supply can cause voltage dips and switching noise. Implementing robust power regulation using the 7805 IC and adequate decoupling capacitors was essential to prevent system resets or audio distortion. CHAPTER 3 SYSTEM ARCHITECTURE 3.1 Transmitter Unit Architecture The Transmitter Unit is designed to be a portable, battery-operated device responsible for encoding user inputs—both digital keystrokes and analog voice—and transmitting them via an infrared optical link ey Pd Figure 1: [Transmitter Unit Block Diagram showing these connections: Power Supply , Keypad, UM91214A IC , Data/Voice Switch, Mic , Pre-Amp , IR LED Driver , IR LED] The architecture of the Transmitter Unit comprises the following core modules: ‘© Power Supply Module: The entire transmitter board is powered by a standard 9V DC battery. To ensure stable operation of the sensitive microcontroller and analog components, a 7805 voltage regulator IC is utilized to step down and regulate the voltage to a constant +5V DC. Filtering capacitors are included to suppress high- frequency noise and voltage ripples. «Input Interface (Digital): A 3x3 matrix keypad serves as the primary digital input mechanism. It is connected directly to the I/O ports of the AT89S52. The microcontroller continuously scans these rows and columns to detect which specific key (1 through 9) has been pressed by the user. «Input Interface (Analog): An electret condenser microphone is used to capture acoustic signals (voice). Because the output of the microphone is extremely weak (in the millivott range), it is immediately fed into a pre-amplifier circuit (typically a single-stage transistor amplifier) to boost the signal strength before modulation. © Mode Selection Switch: A physical DPDT (Double-Pole Double-Throw) switch acts as a hardware multiplexer, allowing the user to select the operating mode ("Data" or "Voie © In Data Mode, the switch routes the digital pulse train generated by the microcontroller to the IR LED driver. ‘© In Voice Mode, the switch bypasses the microcontroller entirely, routing the amplified analog audio signal directly to the IR LED driver. * IR Modulator and Output Stage: Regardl s of the selected mode, the final signal (digital pulses or analog waves) must be transmitted optically. This stage consists of a transistor driver circuit that provides sufficient current to the Infrared (IR) transmitting LED. In Data Mode, the LED flashes on and off to transmit digital codes. In Voice Mode, the LED's brightness varies continuously in proportion to the audio signal's amplitude, achieving optical Amplitude Modulation (AM). 3.2 Receiver Unit Architecture The Receiver Unit serves as the base station in this communication link. Its primary function is to detect the incoming optical signals (IR), separate the data from the analog audio, process the information, and drive the appropriate output peripherals. Figure 2: Receiver Unit Block Diagram showing these connections: Power Supply (Step down Transformer) , AT89S52, 7447 Decoder, 7-Segment Display, Motor Driver , DC Fan. Separately show: Photodiode/Analog Receiver, Audio Amplifier (LM386), Speaker , Led , Transistors ] The architecture of the Receiver Unit comprises the following core modules 1. Power Supply Module (Mains Powered): Unlike the battery-operated transmitter, the receiver is designed for continuous operation and uses a step-down transformer connected to the AC mains. The transformer reduces 230V AC to approximately 9V-12V AC. This is followed by a bridge rectifier to convert AC to DC, filtering capacitors, and a 7805 voltage regulator to provide a stable +SV DC 10 for the logic circuits. The unregulated DC voltage is likely used to power the higher-current DC motor and the audio amplifier. IR Receiver (Digital Data Path): The digital reception relies on an integrated IR receiver module, such as the TSOP1738. This module is specifically tuned to detect IR light modulated at 38kHz. It internally handles the amplification, filtering, and demodulation of the incoming signal, outputting a clean, logic-level pulse train that precisely mirrors the digital data sent by the transmitter. This pulse train is fed directly into the AT89$52 microcontroller. IR Receiver (Analog Voice Path): photodiode Core Processing Unit (AT89S52): The 8051 microcontroller is the brain of the receiver's data mode. It runs a continuous loop waiting for incoming pulses from the TSOP module. Upon receiving a pulse train, the firmware measures the timing intervals to decode the binary data. Once decoded, the microcontroller generates the necessary control signals to drive the output peripherals based on the received ‘command. Output Peripherals (Digital Control): © T-Segment Display: The microcontroller outputs a 4-bit Binary Coded Decimal (BCD) number to a 7447 display driver IC. The 7447 decodes this BCD input and drives the corresponding segments of the common-anode ‘7-segment display to show the number transmitted from the keypad. 2 DC Motor/Fan: Specific digital commands (e.g., pressing key 'I') trigger the microcontroller to toggle an output pin connected to a motor driver circuit (typically a transistor switch or relay), turning the fan ON or OFF. Audio Amplifier and Output (Voice Mode): The weak analog signal recovered by the photodiode in Voice Mode is routed to an audio power amplifier IC, specifically the LM386. The LM386 pro jes the necessary voltage and current gain to drive a standard permanent magnet loudspeaker, reproducing the original voi signal transmitted by the user. “ CHAPTER 4 HARDWARE DESCRIPTION AND INTERFACIN 4.1, AT89S52 Microcontroller The core of both the Transmitter and Receiver units is the AT89S52 microcontroller, which belongs to the classic 8051 8-bit microcontroller family. It is a low-power, high+ performance CMOS 8-bit microcontroller with 8K bytes of In-System Programmable (ISP) Flash memory. Its key features include 256 bytes of RAM, 32 1/0 lines, three 16- bit timer/counters, and a full-duplex UART serial port. In this project, the microcontroller is programmed using Assembly language to manage input reading, IR code generation/decoding, and peripheral control. Paaint2 Figure 3: 12 4.2. Power Supply Unit (Transformer, Rectifier, 7805) A stable and noise-free direct current (DC) power supply is the most critical requirement for the reliable operation of any embedded system. Microcontrollers (like the AT89S52), logic ICs (like the 7447), and IR receiver modules (like the TSOP1738) are highly sensitive to voltage fluctuations and require a strict +5V DC supply. This project utilizes two distinct power supply strategies for the Transmitter and Receiver units, Transmitter Power Supply (Battery Operated) To maintain portability, the Transmitter Unit is powered by a standard 9V DC battery. However, since the internal logic components require SV, the 9V battery output is directly fed into an LM7805 voltage regulator IC, Filtering capacitors (typically 10HF to 100qF) are placed at the input and output pins of the 7805 to suppress transient switching noise generated by the microcontroller and the keypad scanning process. Receiver Power Supply (Mains Operated) Because the Receiver Unit acts as a base station and drives higher-current loads like a DC motor and a loudspeaker amplifier, it is designed to operate continuously from the 230V AC mains. The power supply circuit on the receiver board (visible on the yellow PCB in Figure 2) consists of four fundamental stages: 1, Step-Down Transformer: A centre-tapped or standard step-down transformer is used to reduce the high-voltage 230V AC mains supply to a safer, lower voltage, typically 9V or 12V AC. This voltage provides sufficient headroom for the subsequent regulation stages. 2, Bridge Reetifier: The low-voltage AC from the transformer is fed into a full-wave bridge rectifier circuit constructed using four standard rectifier diodes (such as 1N4007). The rectifier converts the alternating current (AC), which reverses direction, into a pulsating direct current (DC) that flows in only one direction. 3. Smoothing/Filtering: The pulsating DC output from the rectifier is not suitable for logic circuits as it drops to zero volts periodically. To resolve this, a large electrolytic filter capacitor (¢.g., 470KF or 1000F) is placed in parallel with the rectifier output, This capacitor charges during the peak voltage cycles and 13 discharges slowly during the dips, effectively smoothing the pulsating wave into a steady DC voltage with a slight ripple. 4, Voltage Regulation (LM7805): The final and most crucial stage is the LM7805 voltage regulator IC. It takes the smoothed (but still slightly fluctuating) unregulated DC voltage (which {be around 10V-14V at this stage) and outputs a precise, constant +SV DC. qa bee = Imput (1) Output (3) Ground (2) Figure 4: 7805 Voltage Regulator Pinout showing the TO-220 package of the 7805 with its 3 pins labeled: Pin 1 (Input), Pin 2 (Ground), and Pin 3 (Output). The unregulated voltage tapped before the 7805 regulator is typically routed to power the DC motor and the LM386 audio amplifier, as these components require more power and are less sensitive to minor voltage ripples. The regulated +5V output from Pin 3 of the 7805 is exclusively distributed to the AT89S52 microcontroller, the TSOP IR receiver, and the 7-segment display logic. 4.3. Input Peripherals + 3x3 Matrix Keypad: Nine push-button keys are organized in a 3x3 matrix to conserve microcontroller I/O pins. A. specific programming algorithm (keypad 14 scanning) is used to detect key presses and assign each key a unique numerical value (1 to 9) for transmission. + Microphone: A standard electret condenser microphone is used to convert acoustic (voice) signals into faint electrical analog voltages. In "Voice" mode, this signal is amplified to modulate the IR transmitter LED. 4.4. Output Peripherals (7-Segment Display, Speaker, DC Motor) The Receiver Unit serves as the control hub, translating the demodulated IR signals into physical actions or audible sound. This is achieved through three distinct output peripherals, demonstrating both digital control and analog signal reproduction, 1. 7-Segment Display and BCD Decoder (Digital Output) To visually confirm the reception of digital data (from the transmitter's keypad), a standard 7-segment LED display is utilized on the receiver board, Segments (“= ON) Display Segments (“= ON) Display ajlbi|ci|dje/fig a}b/[ci]dje|tig Y\|Yiy¥ iy ly [4 G iyviviviviyiyiv| a Y|Yv i iviviv Y\¥| Yiv| viv) lvl 2 dvivie| duly) oa Y|V[y| vl ZF Yiv[yiy[V[& Y|Y Y[iv¥p 4 yy Y|v|v fC IME Yess ZZ “| |vYiviviviv] Ss lv YI4iYI4] [VIZ C7 Y| AAA F Figure 5: + Interfacing Mechanism: Instead of using seven individual pins of the 8051 microcontroller to drive each segment of the display (which would be an inefficient use of /O resources), the microcontroller outputs a 4-bit Binary Coded Decimal (BCD) value. This 4-bit data is fed into a 7447 BCD-to-7-Segment Decoder IC. + Operation: The 7447 IC acts as an intermediate driver. It reads the 4-bit binary input (e.g., 0101 for the number 5) and actively pulls the correct segment pins low 15 to illuminate the number "5" on a Common Anode 7-segment display. This method simplifies the microcontroller's software logic and saves crucial /O pins. Common Cathode Common Anode f Gnd a b U dp SSD Configuration Figure 6: [Common Cathode / Common Anode 7-Segment Display Pin Configuration here. A standard diagram showing the segments A-G and the common pin.| 2, DC Motor and Cooling Fan (Digital Control) To demonstrate real-world peripheral control (such as turning on an appliance remotely), a small 9V DC motor attached to a cooling fan is integrated into the receiver unit. + Interfacing Mechanism: A microcontrollers /O pin cannot provide the current necessary to drive a DC motor directly (microcontroller pins typically source/sink only a few milliamperes, while a motor requires hundreds of milliamperes), Therefore, a motor driver circuit is employed. 16 + Operatio : While a dedicated IC like the L293D can be used, a simple NPN transistor (such as the BC547 or 2N2222) acting as an electronic switch is often sufficient for a unidirectional fan. When the microcontroller receives a specific “Tum ON" command via the IR link, it sends a high signal (+5V) to the base of the transistor saturates the transistor, completing the circuit to ground and allowing current to flow from the unregulated power supply through the motor, turing the fan on. A freewheeling diode is typically placed across the motor terminals to protect the transistor from back-EMF spikes generated by the motor’s inductive coil when it turns off. Permanent Magnet Loudspeaker (Analog Output) The defining feature of the "Voice Mode" is the reproduction of analog audio. This is handled by a standard permanent magnet dynamic loudspeaker. + Interfacing Mechanis the loudspeaker is the final stage of the analog receiver, path. It is connected directly to the output of the LM386 audio power amplifier IC (detailed in Section 4.6). + Operation: The LM386 provides the necessary current gain to the weak, demodulated voice signal. This amplified alternating electrical current passes through the voice coil of the loudspeaker. The coil sits within a permanent magnetic field. As the electrical audio signal fluctuates, it ereates a varying electromagnetic field that interacts with the permanent magnet, causing the attached speaker cone to vibrate, These vibrations push the surrounding air, recreating the original acoustic voice signal spoken into the transmitter's microphone. 4.5. IR Communication Modules + IR Transmitter LED (Figure 3): This is a simple LED that emits infrared light, typically at a 940nm wavelength. In "Data" mode, the microcontroller switches it ON and OFF rapidly to generate pulse-encoded data. In "Voice" mode, the analog microphone signal is super-imposed on a carrier to modulate the LED's intensity, + IR Receiver Module : The module (or a similar common receiver module) is a integrated circuit that receives IR signals, demodulates a specific 38kHz carrier frequency, and provides a clean digital output. The internal photodiode and pre- 17 amplifier stage make it highly immune to ambient light. In this project, it is used for receiving the pulse-encoded digital data. For "Voice" mode, a separate phototransistor/photodiode circuit would be required since TSOP modules only work with carrier-modulated digital pulses. I will clarify this as a separate analog receiver circuit path, 4.6. Audio Amplifier Circuit (LM386) ‘A separate audio amplifier stage, likely based on a simple IC like the LM386, is present on the yellow power supply board of the Receiver unit (indicated by the small IC near the filter capacitors). This amplifier is essential during "Voice" mode to amplify the faint received analog signal to a level strong enough to drive the loudspeaker. CHAPTER 5 18 WORKING PRINCIPLE 5.1 Detailed Working Principle: Data Mode (Digital) Transmitter Unit Operation: 1, Selection: The user sets the DPDT switch (marked "Data/Voice" in Figure 3) to "Data" mode. This routes the power and signals to the microcontroller input and the IR encoding section. 2, Input: Transmitter unit continuously executes a keypad scanning algorithm, When the user presses a button on the 3 Key's. 3, Encoding: The Encoder maps this keypress to a unique binary code. It then x3 keypad, the Encoder Encodes the input (e.g., generates a specific pulse-encoded infrared signal (likely using a custom protocol ora standard one like RCS, where the duration of ON/OFF pulses represents binary 1s and 0s). This encoded signal is modulated onto a 38kHz carrier frequency for better immunity and sent via the IR transmitter LED. 4, Power: The TX unit is powered by a standard 9V battery and regulated by a 7805 regulator. Receiver Unit Operation: iver module. jer's. ATB9S52 1, Reception: ‘The IR signals are received by the photodiode r. 2. Decoding: This digital pulse train is input into the Rei microcontroller. The microcontroller's firmware is programmed to measure the time intervals of the received pulses to decode the binary data (e.g., identifying that the received pulse train corresponds to the code for number'5’) 3. Output: Once decoded, the microcontroller sends the 4-bit binary representation of the number ('0101' for 'S') to the input of the display driver IC (7447), which drives the correct segments of the 7-segment display to show the number 'S’ 4, Control: The program logic might also link specific codes to peripheral control (e4g., key I tums on fan, key 2 turns it off), The transformer in the RX unit likely provides power to the fan/motor and the main microcontrollers. 19 5. Power: The main power supply for the RX microcontrollers and display is derived from a step-down transformer , rectified, and filtered, then regulated by a 7805 voltage regulator (standard power supply circuit on the yellow PCB). 5.2. Detailed Working Principle: Voice Mode (Analog) This mode demonstrates basic analog signal transmission over the same IR link. 1. Selection: The user sets the switch to "Voice" mode. This activates the microphone and routes the audio signal to the analog modulation section, bypassing the main digital microcontroller encoding logic. 2. Modulation: The faint electrical signal from the electret microphone is amplified by a simple pre-amplifier transistor circuit. This amplified analog signal is then used to modulate the intensity of the IR transmitter LED directly. This is a form of simple AM (Amplitude Modulation) of the IR light intensity. Reception & Demodulation: At the RX unit, the analog-modulated IR signal is detected by a photodetector circuit, a simple photodiode or phototransistor, which must be part of the receiver board. This produces a weak, recovered electrical analog signal 4. Amplification & Output: This faint signal is fed to an audio power amplifier IC (LM386) located on the yellow PCB. The LM36 boosts the signal to a level that can drive the loudspeaker, allowing the user to hear the transmitted voice. The step- down transformer provides the necessary power for the power amplifier circuit. 5.3. Detailed Working Principle: Voice Mode (Analog) While the Data Mode handles discrete, digital pulses, the "Voice Mode" demonstrates a completely different engineering concept: the transmission of continuous, real-time analog signals over an optical link. This mode effectively turns the IR communie: mn system into a wireless, line-of-sight optical telephone. The working principle relies on the Amplitude Modulation (AM) of the infrared light intensity. The operation ean be broken down into the following sequential stages: 1, Audio Signal Capture and Pre-Amplification (Transmitter Side) + Acoustic to Electrical Conversion: When the user speaks into the clectret 20 condenser microphone on the transmitter board, the acoustic sound waves strike the microphone's intemal diaphragm. This mechanical vibration alters the capacitance inside the microphone, generating a continuously varying, analogous electrical voltage Pre-Amplification: The electrical signal generated by a standard microphone is extremely weak, typically in the range of a few millivolts (mV). If this weak signal were fed directly to the IR LED, the variation in light intensity would be too small to detect over any usable distance. Therefore, the signal is first passed through a pre-amplifier circuit (usually a single-transistor Common Emitter amplifier). This stage boosts the voltage amplitude of the audio signal to a usable level without significantly distorting the wave shape. Optical Amplitude Modulation (Transmitter Side) Voice input: When the physical DPDT switch is toggled to "Voice," the input from the ascouit mic is converted into analog signal. ‘The amplified analog audio signal is routed to the base of the transistor driving the IR transmitting LED. Intensity Modulation: In a standard digital circuit, an LED is either fully ON ot fully OFF, However, in this analog mode, the varying voltage of the audio signal controls the amount of current flowing through the IR LED. As the user's voice gets louder (higher voltage amplitude), more current flows, and the IR LED shines brighter. As the voice gets quieter, the IR LED dims, Consequently, the intensity of the emitted infrared light continuously fluctuates in direct proportion to the original audio waveform. Analog Optical Reception (Receiver Side) Optical to Electrical Demodulation: The digital TSOP1738 receiver cannot be used for this mode, as itis designed to filter out varying light and only accept 38kHz digi pulses. Instead, a discrete optical receiver, such as a standalone photodiode or phototransistor, is utilized, Signal Recovery: The photodiode is revers: varying intensity of the IR light strikes the photodiode’ junction, it causes a proportionally varying leakage current. This fluctuating current is passed through a load resistor, converting it back into a varying electrical voltage. At this point, the 24 original audio waveform has been successfully recovered from the optical link, though it is once again very weak. Power Amplification and Playback (Receiver Side) LM386 Audio Power Amplifier: The recovered weak analog signal is fed into the input pin of the LM386 audio amplifier IC located on the receiver's power supply board. The LM386 is specifically designed for low-voltage consumer audio applications. It takes the weak voltage signal and provides a massive current gain (power amplification). Electrical to Acoustic Conversion: The amplified, high-power audio signal is finally sent to the permanent magnet loudspeaker. The varying electrical current drives the speaker's voice coil, pushing and pulling the speaker cone to displace air. This recreation of the acoustic waves allows the user at the receiver end to hear the real-time voice transmitted across the room via the infrared beam, CHAPTER 6 22 SOFTWARE IMPLEMENTATION 6.1. Algorithm for Transmitter Microcontroller The primary responsibility of the transmitter's microcontroller is to continuously monitor the 3x3 matrix keypad, detect user inputs, and encode these inputs into a formatted digital pulse train for Infrared transmission. Note that this algorithm is exclusively active when the physical hardware switch is set to "Data Mode." The step-by-step logical flow (algorithm) of the transmitter firmware is as follows: Step 1: System I ation + Initialize the internal registers, stack pointer, and variables. + Configure the Input/Output (1/0) ports. Set the pins connected to the keypad rows as Output and the pins connected to the keypad columns as Input. + Configure the internal Timer (c.g., Timer 0) to generate the precise delays required for the [Link] carrier frequency and the transmission bit-widths, Step 2: Enter Main Infinite Loop + The microcontroller enters a continuous while(1) or SIMP loop to constantly poll for user activity Step 3: Keypad Scanning Routine + Ground the first row of the keypad (Logic 0) while keeping other rows high (Logic ). + Read the status of all column pins. + Ifall column pins are High (Logic 1), no key in that row is pressed. + Repeat this process sequentially for the second and third rows. Step 4: Key Press Detection and Debouncing + Ifa Low (Logic 0) is detected on any column pin during the scanning routine, a key press has occurred. + Debounce: Call a software delay function of approximately 20 milliseconds to eliminate mechanical switch bounce, + After the delay, check the column pin again. If it is still Low, the key press is valid. Step 5: Key Identification 23 + Based on the intersection of the currently grounded Row and the Low Column, identify the specific key pressed (Keys 1 through 9). + Map the identified key to its corresponding 4-bit binary value (e.g., Key 'S' is mapped to 0101), Step 6: IR Signal Encoding and Transmission + Start Bit: Generate a distinct "Start Burst” (e.g., a continuous 38kHz square wave for 2.4 ms) to alert the receiver that data is incoming. + Data Bits Transmission: Iterate through the 4-bit binary data sequentially. © If the current data bit is 'I', transmit a specific pulse-width encoded signal (eg., 38KHz burst for 1.2 ms, followed by a 0.6 ms space). © Ifthe current data bit is transmit the alternate signal (e.g., 38kHz burst for 0.6 ms, followed by a 0.6 ms space). + Stop Bit: Transmit a final Stop Bit sequence to signify the end of the data frame. Step 7: Wait for Key Release + Entera localized loop that continuously checks the keypad columns. + Wait until all columns return to High (Logic 1), indicating the user has released the button. This prevents the microcontroller from repeatedly transmitting the same code hundreds of times for a single physical button press. + Return to Step 2 to resume continuous s -anning, 6.2. Algorithm for Receiver Microcontroller The receiver's microcontroller operates as the master decoding and control unit during "Data Mode." Its primary function is to constantly monitor the digital output from the TSOP1738 IR receiver module, decode the incoming pulse-width modulated (PWM) signal back into binary data, and trigger the corresponding output peripherals (the 7- segment display and the DC motor). The step-by-step logical flow (algorithm) of the receiver firmware is as follows: Step 1: System I ation + Initialize the microcontroller’s internal registers and stack pointer. + Configure the Input/Output (I/O) ports. Set the pin connected to the TSOP1738 data output as an Input pin, Set the pins connected to the 7447 BCD Decoder and the 24 Motor Driver circuit as Output pins. + Initialize the internal Timers (e.g., Timer 0) in 16-bit mode. This timer will be used to accurately measure the duration of incoming IR pulses. Step 2: Signal Detection (Wait State) + Enter a continuous loop to monitor the TSOP1738 input pin. + Because the TSOP1738 is an active-low device (it outputs logic HIGH when idle and logic LOW when receiving a 38kHz IR burst), the microcontroller waits for a High-to-Low transition. This transition signifies the arrival of a "Start Bit" or the beginning of a data frame. Step 3: Start Bit Validation and Synchronization + Once a LOW signal is detected, start Timer 0. + Wait for the pin to go HIGH again and stop the timer. + Check if the measured time matches the predefined duration of a valid "Start Burst" (e4g., ~2.4 ms). Ifit does not match, treat it as noise, reset the timer, and return to Step 2. If it matches, proceed to data decoding Step 4: Pulse Width Measurement and Decoding + Initialize a variable (a register) to store the incoming data bits. Set a loop counter for the number of expected data bits (e.g., 4 bits for a 0-9 number range). + For each bit, wait for the pin to go LOW, start the timer, wait for it to go HIGH, and stop the timer, + Determine Logic Level: Compare the measured timer value (pulse width) against a predefined threshold. ©. Ifthe pulse width is relatively long (e.g., > 1.0 ms), interpret it as a Logie " © If the pulse width is relatively short (e.g., < 0.8 ms), interpret it as a Logic ‘0 + Shift the interpreted bit into the data register. Repeat this process until all 4 bits are received and reconstructed into a complete binary nibble. Step 5: Output to 7-Segment Display + Take the successfully decoded 4-bit binary value (e.g., 0111 for the number 7). + Output this exact 4-bit value to the specific VO port pins connected to the inputs of 25 the 7447 BCD-to. segment decoder IC. + The hardware handles the rest; the 7447 will instantly decode the binary input and illuminate the corresponding number '7' on the LED display. Step 6: Peripheral Actuation (Motor Control) + Implement a conditional logic structure (such as a switch-case or if-else statement) to check the value of the decoded number and perform specific hardware actions. + Example Control Logic © IF received_data "1: Set the motor control pin to HIGH (turn ON the DC fan), IF received _data Set the motor control pin to LOW (turn OFF the DC fan). © Other numbers can be mapped to different future peripherals or ignored if unassigned. Step 7: Reset and Loop + Clear the timer flags, reset the data variables to zero, and introduce a brief software delay to prevent multiple accidental triggerings from a single button press on the transmitter side. + Return to Step 2 and resume monitoring the TSOP input pin for the next incoming IR command. 26 6.3. Code Snippets (Keypad Scanning and Display Update) This section provides representative core logic snippets used in the firmware. For clarity and maintainability, the firmware is written in Embedded C using a standard 8051 compiler (such as Keil Vision) rather than raw Assembly language. 1. Keypad Scanning Routine (Transmitter) This function is responsible for scanning the 3x3 matrix keypad. It sequentially pulls each row LOW and checks the columns to detect a key press. It includes basic logic for switch debouncing. #inelude // Define Keypad Port Pins define KEYPAD_PORT PI sbit RI = P10; sbit R2= P11; sbit R3 = P12; // Rows sbit Cl = P1*3; sbit C2 = P14; sbit C3 = P1*S; // Columns // Function to generate a small delay for debouncing void ms_delay(unsigned int time) { unsigned inti, j for(i=0;i= 0 && decoded_number <= 9) { 1 Mask the upper 4 bits to ensure we only send a 4-bit BCD nibble 1/ and output it directly to the port connected to the 7447, DISPLAY_PORT = (DISPLAY_PORT & 0xF0) | (decoded_number & Ox0F); 30 CHAPTER 7 RESULT ANALYSIS AND DISCUSSIONS 7.1 Test Setup and Methodology To ensure the reliability and accuracy of the communication link, a structured testing methodology was established. The testing phase aimed to validate both the digital data transmission capabilities and the analog voice reproduction under typical operating conditions «Hardware Setup: 1, Placement: The Transmitter (TX) unit and Receiver (RX) unit were placed on a stable workbench facing each other. Initial testing began at a close distance (approx. 10 em) to verify basic functionality. 2. Alignment: The infrared transmitting LED on the TX unit was carefully aligned to point directly at the receiver module and the analog photodetector on the RX unit, ensuring a clear line-of-sight optical path 3. Power: The TX unit was powered via its onboard 9V battery, while the RX unit was plugged into a standard 230V AC mains supply, activating its internal step- down transformer and regulation circuitry. 4, Measurement Tools: A digital multimeter was used to verify the stable +5V output from the 7805 voltage regulators on both boards before commencing ‘communication tests. + Testing Methodology (Data Mode): 1, Mode Selection: The physical DPDT switch on the TX unit was set to "Data Mode." 2, Input Sequence: Each key on the 3x3 matrix keypad (labeled | through 9) was pressed sequentially. 3 Observation: For each key press, the 7-segment display on the RX unit was visually inspected to confirm if the displayed number matched the transmitted number. Actuation Test: Specific keys programmed to trigger peripheral actions (¢.g., Key ‘I’ for Motor ON, Key '2' for Motor OFF) were pressed, and the physical response of the DC cooling fan was recorded Range Testing: The distance between the TX and RX units was incrementally increased by 30 cm at a time while repeating the keypad inputs to determine the maximum effective range of the digital IR link before data loss or corruption occurred. Testing Methodology (Voice Mode): Mode Switch: The physical DPDT switch on the TX unit was toggled to "Voice Mode,” activating the microphone circuit and bypassing the microcontroller’s digital encoding Audio Input: A continuous audio source (e.g., a test tone from a smartphone or spoken voice) was directed into the electret microphone at a consistent volume level Acoustic Observation: The output from the permanent magnet loudspeaker on the RX unit was subjectively evaluated for volume, clarity, and the presence of noticeable distortion or background noise. Interference Test: The optical path was briefly interrupted (e.g., passing a hand between the TX and RX LEDs) to observe the immediate cessation of audio playback, confirming that the transmission was strictly optical and not reliant on stray electromagnetic coupling, 32

You might also like