You are on page 1of 16

Summer Internship Report

On

LED DISTANCE INDICATOR USING ARDUINO


BACHELOR OF TECHNOLOGY

ELECTRONICS & COMMUNICATION ENGINEERING

Submitted by:

K.VINOD 21071A0498

J.MOSES 21071A04A1

Under the Supervision of

Dr. A. Ramesh Kumar


Associate Professor
VNRVJIET

Academic Year: 2023-24

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI
INSTITUTE OF ENGINEERING AND TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade
NBA Accredited CE, EEE, ME, ECE, CSE, EIE, IT – B .Tech Programs
Approved by AICTE, New Delhi, Affiliated to JNTUH
Recognized as “College with Potential for Excellence” by UGC
Vignana Jyothi Nagar, Bachupally , Nizampet (S.O.), Hyderabad-500 090.Telangana, India.
VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI
INSTITUTE OF ENGINEERING AND TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade
NBA Accredited CE, EEE, ME, ECE, CSE, EIE, IT -B .Tech Programs
Approved by AICTE, New Delhi, Affiliated to JNTUH
Recognized as “College with Potential for Excellence” by UGC
Vignana Jyothi Nagar, Bachupally, Nizampet (S.O.), Hyderabad-500 090.Telangana, India.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE
This is to certify that Summer Internship report titled “LED DISTANCE INDICATOR”that is
being submitted by K.VINOD(21071A0498), J.MOSES(21071A4A1), for the fullfilment of
summer internship at V Sem of Bachelor of Technology in Electronics & Communication of the
VNR VJIET, Hyderabad during the academic year 2023-24 is a record of bonafide work carried
out by him/her under our guidance and supervision.

FACULTY SUPERVISOR HEAD OF THE DEPARTMENT


Dr. A. Ramesh Kumar Dr. S. Rajendra Prasad
Associate Professor Professor and Head
Department of ECE Department ECE
VNRVJIET VNRVJIET
INDEX

TOPIC PAGE NO.

Acknowledgement 1

Abstract 2

Chapter 1: Introduction 3

Chapter 2: Components and software required 4-6

2.1 Software Requirements 4

2.2 Hardware Requirements 4-6

Chapter 3: MethodologY 7-
7
3.1 Circuit Design
3.2 Working 7
8
3.3 Code
9-11

Chapter 4: Results 12-15

Chapter 5: Conclusion 16

References 16
ACKNOWLEDGEMENTS

We are indebted to Dr . C. D. NAIDU, Principal, VNRVJIET, for his


help andguidance in our work. We consider ourselves fortunate to have obtained
his friendly and valuable advice during the course of our summer internship.
Our sincere thanks to Dr . S. RAJENDRA PRASAD, Professor, Head
of the Department, ECE, VNR VJIET for his esteemed guidance and
encouragement provided during the course of our summer internship.
We would like to express our sincere thanks to, Dr. V. Krishna Sree
,Associate Professor, VNR VJIET for his precious guidance and kind cooperation
at everystep of this summer internship.
We are thankful to all the staff members of ECE department,
VNRVJIET, forhelping us during this summer internship.
We are thankful to all the summer internship committee members of
ECE department, VNRVJIET, for helping us during this summer internship.
Finally, we are very thankful to our family members and our friends
for theirgreat moral support.

K.VINOD 21071A0498
J.MOSES 21071A04A1

1
ABSTRACT

This project presents a hands-on exploration of Arduino microcontroller


capabilities in conjunction with an HC-SR04 ultrasonic sensor to create an
interactive distance measurement system. The primary focus is on enhancing
user understanding through the incorporation of visual feedback using Light
Emitting Diodes (LEDs). The project introduces fundamental concepts of
sensor interfacing, signal processing, and conditional programming.

The hardware configuration involves establishing connections between the


Arduino board and the HC-SR04 sensor, facilitating bidirectional
communication. LEDs are integrated into the system to provide a real-time
visual representation of measured distances. The ultrasonic sensor functions by
emitting pulses and measuring the time taken for the echoes to return, allowing
for precise distance calculations.

The Arduino code orchestrates the synchronization between the sensor readings
and LED activation. Distance data is processed, and LEDs are selectively
illuminated based on predefined distance thresholds. This interactive feedback
mechanism enhances user engagement and facilitates a tangible understanding of
distance measurement concepts.

The project serves as a foundational exploration into the applications of


ultrasonic sensors, offering practical insights into object detection scenarios.
Users can observe the dynamic relationship between distance values and LED
states through the Serial Monitor, fostering a platform for experimentation and
customization. The simplicity of the project structure makes it an ideal starting
point for enthusiasts seeking to delve into the realms of physical computing,
sensor integration, and Arduino-based projects.

2
CHAPTER 1

INTRODUCTION

In the realm of DIY electronics and physical computing, Arduino microcontrollers stand out
as versatile platforms for creative projects. This project introduces a compelling and
interactive exploration into the world of distance measurement using an Arduino Uno board,
an HC-SR04 ultrasonic sensor, and Light Emitting Diodes (LEDs). The core objective is to
demonstrate how these components can be seamlessly integrated to provide real-time visual
feedback based on the measured distance from an object.

Ultrasonic sensors, such as the HC-SR04, operate on the principle of echolocation,


emitting ultrasonic waves and measuring their reflection time to calculate the distance of
an object. By coupling this sensor with an Arduino microcontroller, we aim to translate
this distance data into a dynamic and visually accessible format using LEDs.

The project not only serves as an introduction to interfacing sensors with Arduino but also
incorporates an essential aspect of physical computing – the ability to communicate
information through tangible, observable means. The inclusion of LEDs as visual
indicators adds an interactive dimension to the project, making it accessible and engaging
for enthusiasts and learners of varying levels of expertise.

Through this exploration, users will gain practical experience in coding logic, conditional
statements, and sensor integration. The real-time monitoring of distance measurements on
the Serial Monitor provides a transparent view of the system's functionality, encouraging
further experimentation and customization. This introductory project lays the foundation for
more advanced applications, empowering individuals to delve deeper into the exciting
realms of electronics, programming, and interactive systems.

3
CHAPTER 2

COMPONENTS AND SOFTWARE REQUIRED

2.1 Software Requirements

Arduino IDE

Arduino IDE is a cross-platform application written in java, and is derived from the
IDE for the processing programming language and the wiring project. This platform is
designed to simply Arduino programming with the basics of C/C++ libraries. It includes
a code editor with features such as syntax highlighting, brace matching, and automatic
indentation. It also has the features to verify the code through compiling. Also the code
can be successfully dumped into an Arduino by using Upload feature. These make the
Arduino IDE as an casy and robust tool for interfacing with an Arduino. The Arduino
IDE comes with a C/C++ library called "wiring" (from the project of the same name),
which makes many common input/output operations much easier. Arduino programmes
can be written in C/C++,

2.2 Hardware Requirements

1.Arduino UNO Board(Quantity-1)

The Arduino Uno is an open-source microcontroller board based on the Microchip


ATmega328P microcontroller. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various cxpansion boards (shields) and
other circuits.

Features of the Arduino UNO:

• Microcontroller: ATmega328

• Digital I/O Pins: 14 (of which 6 provide PWM output)

• Analog Input Pins: 6

• Flash Memory: 32 KB of which 0.5 KB used by bootloader

• SRAM: 2 KB (ATmega328)

• EEPROM: 1 KB (ATmega328)

• Clock Speed: 16 MHz

4
2.Connecting Wires (Quantity-requirdable)

3.BreadBoard
4.UltraSonic Sensor 5.LED’s

6.Resistors

6
CHAPTER 3

METHODOLOGY

3.1 CIRCIUT DESIGN:

3.2 WORKING:

The implementation of the Arduino Ultrasonic Sensor project involves a systematic approach,
covering hardware setup, circuit connection, and programming. The following step-by-step
methodology guides you through the process:
1. Gather Components:
- Collect the necessary components: Arduino board, HC-SR04 ultrasonic sensor, jumper wires,
resistors (220-ohm), LEDs, and a breadboard.
2. Understand Component Specifications:*
- Familiarize yourself with the pin configurations and specifications of the HC-SR04, LEDs, and
Arduino board.
3. Circuit Connection:
- Connect the components on the breadboard according to the circuit diagram. Ensure proper
wiring and connections:
- Connect the HC-SR04 to the Arduino.
- Connect LEDs to the Arduino with current-limiting resistors.
- Double-check connections and polarities.
4. Write Arduino Code:
- Open the Arduino IDE on your computer.
- Write or copy the provided Arduino code into the IDE.
- Review the code to understand how it triggers the ultrasonic sensor, calculates distances, and
controls the LEDs based on predefined conditions.
5. Upload Code to Arduino:
- Connect your Arduino board to the computer using a USB cable.
- Select the appropriate board and port in the Arduino IDE.
- Click the "Upload" button to transfer the code to the Arduino board.
6. Monitor Serial Output:
- Open the Serial Monitor in the Arduino IDE.
- Observe the real-time distance measurements printed on the Serial Monitor as the Arduino
interacts with the HC-SR04.
7. Test and Troubleshoot:
- Place objects at varying distances in front of the ultrasonic sensor.
- Verify that the LEDs respond according to the specified distance thresholds.
- Troubleshoot any issues by checking connections, component specifications, and code logic.
8. Experiment and Customize:
- Explore modifications to the code or circuit to adapt the project to your preferences.
- Consider adding more LEDs, adjusting distance thresholds, or incorporating an LCD display
for enhanced visualization.
9. Document and Learn:
- Document your circuit connections, code modifications, and observations.
- Reflect on the learning outcomes and challenges encountered during the project.

3.3 Code

const int trig = 11;


const int echo = 12;

const int LED1 = 2;


const int LED2 = 3;
const int LED3 = 4;
const int LED4 = 5;
const int LED5 = 6;

int duration = 0;
int distance = 0;

void setup()
{
pinMode(trig , OUTPUT);
pinMode(echo , INPUT);
pinMode(LED1 , OUTPUT);
pinMode(LED2 , OUTPUT);
pinMode(LED3 , OUTPUT);
pinMode(LED4 , OUTPUT);
pinMode(LED5 , OUTPUT);

Serial.begin(9600);

void loop()
{
digitalWrite(trig , HIGH);
delayMicroseconds(1000);
digitalWrite(trig , LOW);
duration = pulseIn(echo , HIGH);
distance = (duration/2) / 28.5 ;
Serial.println(distance);
if ( distance <= 5 )
{
digitalWrite(LED1, HIGH);
}
else
{
digitalWrite(LED1, LOW);
}
if ( distance <= 7 )
{
digitalWrite(LED2, HIGH);
}
else
{
digitalWrite(LED2, LOW);
}
if ( distance <= 10 )
{
digitalWrite(LED3, HIGH);
}
else
{
digitalWrite(LED3, LOW);
}
if ( distance <= 15 )
{
digitalWrite(LED4, HIGH);
}
else
{
digitalWrite(LED4, LOW);
}
if ( distance <= 20 )
{
digitalWrite(LED5, HIGH);
}
else
{
digitalWrite(LED5, LOW);
}
}

1
CHAPTER 4

RESULTS

APPLICATIONS:

The Arduino Ultrasonic Sensor project with LEDs for distance measurement has various practical
applications, showcasing the versatility of Arduino-based systems in real-world scenarios. Here are
some potential applications:

1. Smart Parking System:


- Use the ultrasonic sensor to measure the distance between a vehicle and an obstacle. LEDs can
indicate whether the vehicle is within an optimal parking distance.

2. Security System:
- Implement the system as a proximity-based security alert. LEDs can signal if an object or person
is approaching a designated area.

3. Object Detection for Robotics:


- Integrate the project into robotic systems to detect obstacles or objects in the robot's path. LEDs
can indicate safe or unsafe zones.

4. Home Automation:
- Create a smart home system where the Arduino measures the distance to occupants. LEDs can
signal the proximity of individuals, triggering specific home automation actions.

5. Interactive Art Installations:


- Use the distance measurements and LEDs to create interactive art installations. The visual
feedback can respond dynamically to the audience's proximity.

6. Gesture Control:
- Combine the distance measurement with gesture recognition. LEDs can indicate whether a hand
or object is within a specified range, enabling gesture-controlled applications.

7. Assistive Technology:
- Develop assistive devices for individuals with visual impairments. LEDs can provide haptic
feedback about the proximity of obstacles in their surroundings.

8. Automated Plant Care:


- Measure the distance between the sensor and the soil to determine soil moisture levels. LEDs can
signal when it's time to water the plants.

9. Human-Computer Interaction:
- Implement the system for touchless interaction with computers or devices. LEDs can indicate
when a hand is within range for gesture-based commands.

10. Education and Learning Tools:


- Use the project as an educational tool to teach principles of sensor integration, programming, and
electronics in a hands-on and engaging manner.

11. Retail Queue Management:


- Deploy the system for monitoring and managing queues in retail spaces. LEDs can signal
customers to maintain a specific distance from each other.

12. Social Distancing Reminder:


- In the context of health and safety, the system can be used to remind individuals to maintain a
safe distance from each other in public spaces.

These applications highlight the adaptability of the Arduino Ultrasonic Sensor project,
demonstrating its potential across various domains, from robotics and automation to art and
assistive technology. As technology evolves, the versatility of Arduino-based projects allows for
innovative solutions to diverse challenges.
CHAPTER 6

CONCLUSION

In conclusion, the Arduino Ultrasonic Sensor project with LEDs for


distance measurement not only serves as an engaging and educational
exploration into the realms of sensor integration and programming but also
exhibits significant versatility with numerous practical applications. The
project seamlessly combines the capabilities of the Arduino
microcontroller, HC-SR04 ultrasonic sensor, and LEDs, providing real-
time visual feedback based on measured distances.

REFERENCES

https://www.youtube.com/watch?v=UVrRmDBRKH8
https://en.wikipedia.org/wiki/Arduino_Uno

You might also like