Report
Report
Report
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.
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.
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 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.
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.
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.
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.
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 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++);
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:
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.
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