Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

SOUND SENSOR INTERFACING WITH

LPC2148

Project Report

1
ABSTRACT
The sound sensor module is a versatile electronic circuit designed to detect sound
levels that exceed a user-defined threshold. It operates by utilizing a microphone to
capture sound signals, which are then fed into an LM393 op-amp. The PCB
incorporates a potentiometer, allowing users to adjust the sound level setpoint
according to their specific requirements. This adjustable feature is a key component
of the module's flexibility, making it suitable for a range of applications where
precise control over sound detection is crucial.
The onboard potentiometer facilitates easy customization of the threshold, enabling
users to fine-tune the module's sensitivity. When the detected sound level surpasses
the setpoint, the module responds by illuminating an LED and sending the output
low. This functionality is particularly useful for applications such as sound-activated
switches or alarms, where responsive reactions to varying sound levels are essential.
Whether deployed for security purposes or as part of an automation system, the
sound detection sensor module provides a reliable solution for scenarios requiring
dynamic and adjustable sound level monitoring.
The module's design underscores its practicality and adaptability for diverse
applications. Its simplicity, coupled with the ability to easily adjust the detection
threshold, makes it an effective tool for engineers and hobbyists seeking an
accessible and responsive solution for sound-based projects.

OBJECTIVE

The objective of sound sensor interfacing with LPC2148 is to develop a robust and
efficient system for detecting and processing audio signals using the LPC2148
microcontroller. The sound sensor, also known as a microphone or audio sensor, is
integrated into the system to capture ambient sound waves and convert them into
electrical signals. The LPC2148, being a powerful 32-bit ARM microcontroller, is
capable of processing these signals and executing predefined algorithms to analyze
and respond to different sound patterns. The interfacing of the sound sensor with
LPC2148 aims to create a versatile solution applicable in various applications such as
noise monitoring, voice recognition, or even security systems that respond to specific
audio cues.

This project involves establishing a reliable communication interface between the


sound sensor and the LPC2148, configuring the microcontroller to capture and
process analog signals, and implementing algorithms for sound pattern recognition.
The ultimate goal is to create a responsive and intelligent system that can interpret
sound data in real-time, allowing for diverse applications in fields like smart
environments, automation, and surveillance. This project not only enhances the
capabilities of the LPC2148 microcontroller but also contributes to the development
of innovative solutions that leverage sound sensing technology for improved human-
machine interaction and environmental monitoring.
2
INTRODUCTION
The sound detection sensor module serves as a valuable tool in identifying and
responding to sound levels that surpass a predefined threshold. Employing a
microphone for sound capture, the module integrates an LM393 operational amplifier
(op-amp) into its design. This op-amp plays a pivotal role in processing the incoming
sound signals, enhancing the sensitivity and precision of the sound detection.
Incorporated into the module's printed circuit board (PCB) is a potentiometer, an
adjustable resistor, which enables users to set the sound level threshold according to
their specific requirements.

A notable feature of this electronic circuit is its user-friendly interface, allowing for
easy customization of the sound detection threshold through the onboard
potentiometer. By manipulating this component, users can fine-tune the sensitivity of
the module to suit different environments or applications. Upon surpassing the
setpoint, the module provides a visual indicator by illuminating an LED,
concurrently sending the output low. This response mechanism enhances the
module's utility in scenarios where immediate recognition and action are essential,
such as in sound-activated switches or alarms. The combination of simplicity,
adjustability, and responsiveness makes the sound detection sensor module a
versatile solution for applications requiring dynamic monitoring of sound levels.

In summary, this sound detection sensor module offers an effective means of


detecting sound exceeding a specified threshold. Leveraging a microphone, LM393
op-amp, and an adjustable potentiometer, the module provides a user-friendly
experience with customizable sound level settings. The incorporation of an LED
indicator and responsive output adds to its practicality, making it suitable for diverse
applications where precise sound monitoring is paramount.

PROBLEM STATEMENT
To address the problem statement, the code for the LPC2148 microcontroller needs
to be intricately designed to efficiently process the analog signals from the sound
sensor and translate them into meaningful sound level measurements.

The inclusion of a potentiometer in the system design introduces a dynamic element,


enabling users to fine-tune the sensitivity of the sound detection. This adjustment is
crucial for tailoring the system's response to different environments and scenarios.

The intelligence of the sound detection system lies in its ability to analyze incoming
audio signals, compare them against the user-defined threshold, and trigger
appropriate actions when the threshold is exceeded. This might involve activating
alarms, signaling security breaches, or initiating specific automated processes.

The versatility of the system extends its usability across diverse applications, from
enhancing security measures to providing early warnings in environments where
3
sound anomalies may indicate potential issues. This adaptability adds value to the
design, making it a flexible solution for varied user requirements.

The robustness of the solution is a key consideration, necessitating error-handling


mechanisms and calibration routines to ensure accurate and reliable sound detection
over prolonged periods. It should be resistant to false positives and negatives,
providing a dependable performance in real-world scenarios.

Considering power efficiency is crucial for applications where the sound detection
system operates continuously. Optimizing the code and incorporating power-saving
modes in the microcontroller can contribute to prolonged battery life and overall
energy efficiency.

The development process should also include comprehensive documentation to guide


users through the setup, configuration, and customization of the sound detection
system. This documentation ensures that even users with limited technical expertise
can effectively deploy and manage the solution.

Testing and validation procedures should be established to verify the system's


performance under various conditions. This includes assessing its responsiveness,
accuracy, and adaptability to different sound frequencies and amplitudes, ensuring a
reliable and effective implementation.

Application

The developed sound detection system has versatile applications across several
domains due to its adaptability and responsiveness. One significant application is in
the field of security systems. The system can be employed to detect unusual sounds
or intrusions in homes, offices, or industrial settings, triggering immediate alerts or
alarms. Additionally, it can find utility in environmental monitoring, identifying
specific sound patterns indicative of machinery malfunctions, leaks, or abnormal
activities.

Another noteworthy application is in home automation where the system can


contribute to creating a smart environment. For instance, it can be integrated into
lighting or HVAC control systems, allowing for automated adjustments based on
detected sound levels. Additionally, the system could be applied in voice-activated
devices or assistive technologies, enabling users to interact with their surroundings
through voice commands, making it especially useful for individuals with mobility
challenges.

The sound detection system can play a crucial role in healthcare settings. It can be
employed for patient monitoring, detecting distress signals or abnormal sounds that
may indicate a medical emergency. This technology could enhance the efficiency of
healthcare professionals by providing real-time alerts in critical situations.
Additionally, the system's adaptability makes it suitable for use in sleep monitoring
devices, helping individuals track and analyze their sleep patterns for better overall
4
health. The versatility of the sound detection system opens up a myriad of
possibilities, showcasing its potential impact on various aspects of our daily lives and
industries.

Advantages

• Adjustable Sensitivity: One of the key advantages of the system is its ability to
accommodate various environments and user preferences through an onboard
potentiometer. This feature allows users to fine-tune the sensitivity of the sound
detection, making it adaptable to different scenarios.

• Real-time Responsiveness: The system's integration of sound sensor, LPC2148


microcontroller, and sophisticated control logic ensures real-time
responsiveness. This is crucial for applications such as security systems where
timely detection of anomalies is paramount.

• Cost-effective Solution: The use of LPC2148, a cost-effective microcontroller,


coupled with a sound sensor, provides a budget-friendly solution for sound
detection applications. This makes it accessible for a wide range of users and
applications, from hobbyist projects to commercial implementations.

• Versatility: The system's versatility allows it to be integrated into various


systems and applications beyond security, such as automation, environmental
monitoring, or assistive technologies. This flexibility increases the system's
overall utility.

• User-friendly Interface: The inclusion of an onboard potentiometer for


adjusting sound sensitivity enhances the user-friendliness of the system. Users
can easily customize the threshold without the need for complex configurations.
• Integration Potential: The system can seamlessly integrate with other
components of an overall system, making it scalable and capable of contributing
to more comprehensive solutions. This integration potential enhances its
usefulness in diverse applications.

In summary, the developed sound detection system presents advantages such as


adjustable sensitivity, real-time responsiveness, cost-effectiveness, versatility, user-
friendly interface, and integration potential, making it a valuable solution for
security, automation, and other applications requiring sound monitoring capabilities.

COMPONENTS REQUIRED
• LPC2148 Development Board
• Sound Sensor
• LCD Module (To print the Sensor output)

5
SOFTWARE REQUIRED

• Keil IDE

CONNECTION

Sound Sensor:
• Vcc – 5v
• GND – Ground
• Out – P1.24

LCD:
• RS – P0.8
• RW – P0.9
• EN – P0.10
• Data Lines – P0.0 – P0.7

BLOCK DIAGRAM

6
WORKING PRINCIPLE

• The LPC2148 code likely involves configuring specific registers for GPIO pins to set
them as either input or output, ensuring proper communication with the sound sensor
and LCD.

• The initialization of the LCD involves sending specific command sequences to set up
its operating parameters, such as the display mode, cursor properties, and other
configuration settings.

• The cursor is set to the beginning of the first line of the LCD, indicating where the
subsequent message "Sound Detected" will be displayed when a sound signal is
detected by the connected sensor.

• The continuous loop suggests that the microcontroller is constantly monitoring the
state of the sound sensor input on pin P1.24, checking for changes that indicate the
presence of a sound.

• Upon detecting a low signal on pin P1.24, representing the occurrence of a sound, the
program promptly updates the LCD screen with the message "Sound Detected,"
providing a real-time visual indication of the event.

• Following the display update, the LCD is cleared, ensuring a clean slate for the next
round of sound detection. This step is crucial for maintaining a clear and concise
visual representation of sound events.

• The code employs an infinite loop, indicating that the sound detection and LCD
updating process will repeat indefinitely, creating a continuous monitoring system
for real-time sound events.

• The effectiveness of the code is contingent on accurate hardware connections,


ensuring that the sound sensor is correctly wired to the designated GPIO pin and that
the LCD is properly initialized and connected to the LPC2148.

• The overall functionality of the system relies on the proper integration of both the
sound sensor and LCD, as well as the accurate interpretation of the sensor's signals
by the microcontroller. Any discrepancies in hardware connections or initialization
can affect the system's performance.

• This real-time sound detection system with visual feedback on an LCD display could
find applications in various scenarios, such as security systems, noise monitoring, or
interactive installations where immediate response to sound events is essential.

7
SOURCE CODE

#include<lpc214x.h>
#define bit(x) (1<<x)
#define delay for(i=0;i<7000;i++);

#define SOUND (IO1PIN & (1<<24))

unsigned int i;

void lcd_int();
void dat(unsigned char);
void cmd(unsigned char);
void string(unsigned char *);

void main()
{
IO0DIR =0XFFF;
IO1DIR = 0x0;
lcd_int();
cmd(0x80);
string("Group 12");
while(1) {
if(SOUND == 0) { //When the sound detection
module detects a signal, Print in the LCD
string("Sound Detected");
}
delay;delay;
cmd(0x01);
}
}

void lcd_int()
{
cmd(0x38);
cmd(0x0c);
cmd(0x06);
cmd(0x01);
cmd(0x80);
}
void cmd(unsigned char a)
{
IO0PIN&=0x00;
8
IO0PIN|=(a<<0);
IO0CLR|=bit(8); //rs=0
IO0CLR|=bit(9); //rw=0
IO0SET|=bit(10); //en=1
delay;
IO0CLR|=bit(10); //en=0
}
void dat(unsigned char b)
{
IO0PIN&=0x00;
IO0PIN|=(b<<0);
IO0SET|=bit(8); //rs=1
IO0CLR|=bit(9); //rw=0
IO0SET|=bit(10); //en=1
delay;
IO0CLR|=bit(10); //en=0
}
void string(unsigned char *p)
{
while(*p!='\0') {
dat(*p++);
}
}

RESULTS

9
When sound is not detected:

When sound is detected:

10
CONCLUSION

In developing the sound sensor interfacing code with LPC2148, the primary
objective is to create a versatile and responsive system for real-time sound
detection, providing immediate visual feedback through an LCD display. The code's
primary goal is to leverage the LPC2148 microcontroller's capabilities to interface
with a sound sensor, thereby enabling applications in diverse fields.

The system's flexibility allows it to find applications in several domains. In security


systems, it can serve as an integral component for detecting unexpected noises or
intruders, triggering appropriate responses. In industrial settings, the code can be
implemented to monitor machinery sounds, identifying irregularities that may
indicate potential issues or maintenance requirements. Moreover, in home
automation, the system can contribute to creating intelligent environments by
responding to specific sounds, such as alarms or doorbells.

Beyond security, industry, and home automation, the LPC2148 sound sensor
interfacing code finds applicability in educational environments. It can serve as a
hands-on learning tool for students and enthusiasts interested in embedded systems,
offering insights into the integration of sensors and microcontrollers for practical
applications.

In summary, the sound sensor interfacing code with LPC2148 not only addresses
the immediate objective of real-time sound detection but also opens avenues for
diverse applications in security, industry, home automation, and education. Its
versatility, coupled with the reliability of the LPC2148 microcontroller, positions it
as a valuable resource for embedded systems development and exploration across
various domains.

**************

11

You might also like