# Category: Engineering ProjectsPage 1 of 2

Hey guys! Today in this blog, I am going to tell you guys that how to make Visitor Counter Using 7 Segment Display and LDR. It is a very simple and best project to make, you can count the objects using this project. It can be used to count the objects and also you can make this project at a cheap price you need just some simple electronic components just like 7 Segment Display LDR and Johnson counter IC.

# Visitor Counter Circuit Using 7 Segment Display and LDR

#### What is Counter?

A digital visitor counter or an Object counter is necessary to count how many people entered into a specific area or a how many items are generated in a firm. The automatic visitor counter is a simple electronic circuit which is totally based on the analog and digital circuit because it has some part analog and some part is digital(7 segment Display) in analog the main part is LDR sensor which is the sensing element for any object.

It is a simple and innovative project and it can be applied to science fair project for Electronic and Robotics students.

## How does a Visitor Counter Circuit using 7 Segment works?

It can simply be done by this circuit, a light reference and a light sensor are used to detect the person and display the count using seven segment display with the help of 4026. The light reference and the light sensor placed in such a way that the visitor will cross the light path when he enters the hall.

## Circuit Diagram:

#### Visitor Counter Circuit Using 7 Segment Display and LDR

Visitor Counter Using 7 Segment Display and LDR Circuit Diagram

#### Internal Construction Of IC 4026:

Timing Diagram Of IC 4026:

### Circuit Working of Visitor Counter Circuit using 7 Segment :

• The light source from the torch is continually hit on the LDR if so the resistance of LDR is too low and the voltage drop across LDR and ground is less than 0.6V then
• The threshold voltage 0.6V can be set by varying the POT 10K
• When a person or an object is passed between the light beams light will not hit on the LDR so the resistance of LDR becomes high.
• We have V=IxR (Voltage = Current X Resistance) i.e., the resistance of LDR is the high voltage across LDR become high.
• If the voltage across Light Depending Resistor exceeds to 0.6V then the transistor will ON and start conducting When the transistor is ON, the potential at point A becomes LOW and when the transistor becomes OFF, the potential at a will be HIGH.
• As soon as the person crosses the light beam a LOW and HIGH voltage transition occurs at the point A.
• Which is given to the Clock of 4026IC, it will start to count with the clock and display on 7- segment display 4026 will increment the count when each person enters the room.

https://www.videosprofitnetwork.com/watch.xml?key=84023bfeee863e70ba7359105d0725b0

Also Read: How to Interface IR Sensor with Arduino Ultimate GUIDE

### Importance and Applications of Visitor Counter Circuit Using 7 Segment:

• Automatic Entry Counter Circuits are used to count the items that are manufactured in any industry.
• They are used to find how many people are entered into the specific area (House, Malls, Factory).
• They are used to count how many people leave the specific area and they are able to send this data to the PC with the help of some Micro-Controllers.

#### Also, Check:

This is all about Visitor Counter Using 7 Segment Display and LDR. If you like our article then do not forget to share and comment below. If you have built this project give us feedback and share your project picture down below. and if you feel any query about Visitor Counter Using 7 Segment Display and LDR. then comment below.

This article “Interfacing of Ultrasonic Sensor with Arduino” is updated in 2020.

Today, In this tutorial we will learn about the Ultrasonic Sensor Arduino Code and How you can Interface Ultrasonic Sensor (HCSR04) with Arduino. A few days ago, I have posted a complete tutorial on What is Arduino and How you can learn Arduino, and later I have posted different projects on Arduino For Example Line Following Robot, Arduino Based Calculator, Arduino Based Radar System. Those posts were very good and I got the good response, so I thought today let’s interface Ultrasonic Sensor to the Arduino.

So, today I am gonna show you the complete guide on How to Interface Ultrasonic Sensor (HCSR04) with Arduino in a few easy steps.

# How to Interface Ultrasonic Sensor with Arduino:

### What is Ultrasonic Sensor

An Ultrasonic Sensor is an Electronic device which is used to measure a distance of an object using Sound Waves. Its working principle is very simple; it sends out a sound wave at very high-frequency range (Ultrasonic range of > 40KHz) and waits for it to bounce back from the object. As shown in the figure below. Then, the time duration between transmission of the sound wave and receiving of the sound wave is used to calculate the distance.

The formula for the Distance is = (Speed of sound wave * Time delay) / 2

Here you can see we have divided the distance formula by 2 this is because the sound waves travel from the transmitter and back to the receiver which doubles the actual distance.

working of Ultrasonic Sensor

### Ultrasonic Sensor HCSR04 is Consist of:

Ultrasonic Sensor HCSR04 is a simple electronic sensor which basically is used for measuring the distance between the sensor itself and any obstacle in front of it. The sensor has a sender and a receiver on it.
This sensor consists of four pins, which are:

• Vcc (+5V): Ultrasonic Sensor requires +5V to work perfectly.
• Trig (Trigger): This is the important pin because we have to provide trigger Pin after which this ultrasonic sensor emits ultrasonic sound waves.
• Echo: This is also very important pin, it is used When Ultrasonic waves emitted from the transmitter, hit some object then they get bounced back and then those waves are received by the receiver and at that moment this echo Pin goes HIGH.
• GND: The GND is used to complete the circuit, we need to provide ground to HC-SR04 Ultrasonic Sensor.

## Interfacing of Ultrasonic Sensor With Arduino:

Now As we have Covered and understood the working of the Ultrasonic sensor, so we have some knowledge about what we need to do in order to get the values from the Ultrasonic sensor. Let’s now have a look at Interfacing of Ultrasonic Sensor with Arduino.

1. First of all, we need to generate an electronic signal of 10Us (microsecond) and then send it over to trigger pin of Ultrasonic Sensor.
2. After sending the trigger pin we then need to read the echo pin and wait for it to get HIGH.

For Example: if the object is 6 cm away from the sensor, and the speed of the sound is 0.034 cm/µs the sound wave will need to travel about 176 microseconds. But what you will get from the Echo pin will be double that number because the sound wave needs to travel forward and bounce backward.

So in order to get the distance in cm, we need to multiply the received travel time value from the echo pin by 0.034 and divide it by 2. This is illustrated in the figure below.

1. Once the ECHO pin goes HIGH then we need to count the time for how long it remained HIGH.
2. On the basis of this time, we are going to calculate the distance of the object from the ultrasonic sensor.

Mathematical Calculation of Ultrasonic Sensor using Arduino

### Components required for the Connection of Ultrasonic Sensor with Arduino:

https://www.videosprofitnetwork.com/watch.xml?key=84023bfeee863e70ba7359105d0725b0

• Ultrasonic Sensor HCSR04
• Arduino UNO Board

Components required for Interfacing of Ultrasonic Sensor with Arduino

### Circuit Diagram of Connection of Ultrasonic Sensor with Arduino:

The connection is very easy, do not get confused and if you feel any query feel free to comment below. I will make sure to explain it as soon as possible.

Circuit Diagram of Interfacing Ultrasonic Sensor with Arduino

### Ultrasonic Sensor Arduino Code:

```/*

* Ultrasonic Sensor HC-SR04 and Arduino Tutorial

*

* Crated by Sohail Anwar,

* www.studentsheart.com

*

*/

// defines pins numbers

const int trigPin = 12;

const int echoPin = 11;

// defines variables

long duration;

int distance;

void setup() {

pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output

pinMode(echoPin, INPUT); // Sets the echoPin as an Input

Serial.begin(9600); // Starts the serial communication

}

void loop() {

// Clears the trigPin

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds

duration = pulseIn(echoPin, HIGH);

// Calculating the distance

distance= duration*0.034/2;

// Prints the distance on the Serial Monitor

Serial.print("Distance: ");

Serial.println(distance);

*/ visit:www.Studentsheart.com/

}```

Note: If you want to display the results from the HCSR04 Ultrasonic Sensor on an LCD you can use the following source code:

Also Read: How to Interface IR Sensor with Arduino Step by Step GUIDE

### Circuit Diagram for Interfacing Ultrasonic Sensor with LCD:

Circuit Diagram for Interfacing Ultrasonic Sensor with LCD

### Ultrasonic Sensor Arduino Code with LCD:

```/*

* Ultrasonic Sensor HC-SR04 and Arduino Tutorial

*

* Crated by Sohail Anwar,

* www.studentsheart.com

*

*/

// defines pins numbers

#define trigPin 12

#define echoPin 13

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup()

{

lcd.begin(16, 2);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

lcd.setCursor(1,0);

lcd.print("Distance=");

}

void loop()

{

long duration, distance;

digitalWrite(trigPin, LOW); // Added this line

digitalWrite(trigPin, HIGH);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance = (duration/2) / 29.1; // conversion in cm

lcd.setCursor(11,0);

lcd.print(distance); //output on lcd in centimeter

lcd.setCursor(14,0);

lcd.print("cm");

}```

Once you’ve uploaded the code, and if you do not know how to upload the code visit my this post Learn Arduino, the board will begin to transmit data to the computer. You will see Tx LED on the Arduino blinking each time it transmits a data it means the data is transmitted from the Ultrasonic Sensor.

Now click on Serial Monitor and see the values of Distance measured by Ultrasonic Sensor HCSR04, you’ll see the distance is displayed. This is all about How to Interface Ultrasonic Sensor (HCSR04) with Arduino Easy Steps.

While researching on topic “Final Year Projects for Electronics Engineering” we found a number of best projects that are not known to many Electrical or Electronic engineering student. So we have collected the list of best electronics projects from various resources and listed them down below.

You may get the desired project for your theses or project, also you can get best ideas for your final year project if you are interested,  and if you have any suggestions, comments, or new electronics projects ideas then comment down below.

# Latest Final Year Projects for Electronics

### IOT Based Electronics Project:

Photo Credit: Busy.org

1. Automatic Street Lighting system using IoT
2. Smart Building Project using PIR
3. Smart Water Monitoring System using IoT
4. Automatic Smart Parking System using IoT
5. IoT based Home Automation
6. IoT based Biometrics
7. Motion Controlled Servos using IoT
8. IoT Vehicle Simulation System
9. IoT using Raspberry Pi for weather monitoring
10. Weather Monitoring System using IoT
11. Smart Irrigation System using IoT
https://www.videosprofitnetwork.com/watch.xml?key=84023bfeee863e70ba7359105d0725b0

### Embedded System Electronics Projects:

`Note List Down Below is in Ascending order`
1. Automated Railway Crossing
2. Automatic Solar Tracker
3. Automatic Dialing to Any Telephone Using I2C Protocol on Detecting Burglary
4. Automatic irrigation System on Sensing Soil Moisture Content
5. Automatic Surveillance Camera Panning System from PC
6. Auto Intensity Control of Street Lights
8. Auto Metro Train to Shuttle Between Stations
9. Automatic Bell System for Institutions
10. Arduino Based Simple Calculator
11. Automatic Wireless Health Monitoring System in Hospitals for Patients
12. Beacon Flasher Using Microcontroller
13. Bidirectional Rotation of an Induction Motor with a Remote Control Device
14. BLDC Motor Speed Control with RPM Display
15. Cell Phone Based DTMF Controlled Garage Door Opening System
16. Cell Phone Controlled Robotic Vehicle
17. Closed Loop Control for a Brushless DC Motor to Run at the Exactly Entered Speed
18. Cyclo Converter Using Thyristors
19. Density Based Traffic Signal System
20. Detecting Power Grid Synchronization Failure on Sensing Frequency or Voltage Beyond Acceptable Range
21. DTMF Based Load Control System
22. Discotheque Light Stroboscopic Flasher
23. Dish Positioning Control by IR Remote
24. Display of Dialed Telephone Numbers on Seven Segment Displays
25. Distance Measurement by Ultrasonic Sensor
26. Fire Fighting Robotic Vehicle
27. Flash Flood Intimation Over GSM Network
28. Four Quadrant DC Motor Speed Control with Microcontroller
29. FACTs (flexible ac transmission) by TSR
30. FACTs by SVC (flexible ac transmission)
32. GSM Based Monthly Energy Meter Billing via SMS
33. Home Automation System
35. Integrated Energy Management System Based on GSM Protocol with Acknowledgement Feature
36. IR Controlled Robotic Vehicle
37. IR Obstacle Detection to Actuate Load
38. Industrial Battery Charger by Thyristor Firing Angle Control
39. Industrial Power Control by Integral Cycle Switching without Generating Harmonics
40. Lamp Life Extender by ZVS (Zero Voltage Switching)
41. Life Cycle Testing of Electrical Loads by Down Counter
42. Microcontroller Based Line Following Robotic Vehicle
43. Design and Implementation of Metal Detector Robotic Vehicle
44. Automatic Door Opening System with Movement Sense
45. Networking of Multiple Microcontrollers
46. Microcontroller based Non-Contact Tachometer
47. Object Counter with 7 Segment Display using Microcontroller
48. Object Detection using Ultrasonic Sensor
49. Obstacle Avoidance Robotic Vehicle
50. Optimum Energy Management System
51. Predefined Speed Control of BLDC Motor
52. Solar Powered Auto Irrigation System
53. Solar Powered LED Street Light with Auto Intensity Control
54. Speed Checker to Detect Rash Driving on Highways
55. Speed Control Unit Designed for a DC Motor
56. Speed Synchronization of Multiple Motors in Industries
57. Stamp Value Calculator for Postage Needs
58. Sun Tracking Solar Panel
59. Secret Code Enabled Secure Communication Using RF Technology
60. Solar mobile charger
61. Smart Traffic Light System
62. Security System Using Smartcard Technology
63. Security System With User Changeable Password
64. Sine Pulse Width Modulation
65. SVPWM Space Vector Pulse Width Modulation
66. Synchronized Traffic Signals
67. Touch Screen Based Home Automation System
1. Touch Screen Based Industrial Load Switching
2. Touch Screen Based Remote Controlled Robotic Vehicle for Stores Management
3. Tampered Energy Meter Information Conveyed to Concerned Authority by Wireless Communication
4. Theft Intimation of the Vehicle Over SMS to Owner Who Can Stop the Engine Remotely
5. Three Phase Solid State Relay with ZVS
6. Thyristor Controlled Power for Induction Motor
7. Thyristor Power Control by IR Remote
8. TV Remote Operated Domestic Appliances Control
9. Ultra Fast Acting Electronic Circuit Breaker
10. Underground Cable Fault Distance Locator
11. Unique Office Communication System Using RF
12. Using TV Remote as a Cordless Mouse for the Computer
13. War Field Spying Robot with Night Vision Wireless Camera
14. Wireless message Communication Between Two Computers

Photo Credit: Electronicsweekly.com

### Matlab Based Electronics Projects:

1. Fingerprint Recognition
2. Face Recognition
3. Signature Recognition
4. Ear Recognition
5. Gait Recognition
6. Age Estimation
7. Writeprint Recognition
8. Finger-Knuckle-Print Recognition
9. Hand Geometry Recognition
10. Palm Vein Recognition
11. Speech Emotion Recognition
12. Facial Gender Recognition
13. Retina Recognition
14. Keystroke Recognition
15. 3D Face Recognition
16. Infrared Face Recognition
17. EEG Recognition
18. ECG Recognition
19. Speech Recognition
20. Speaker Recognition
21. Iris Recognition
22. Facial Expression Recognition
23. Palmprint Recognition
24. Writer Recognition
25. Fingerprint Classification
26. Face Identification Based on DCT and Neural Networks
27. Face Recognition Based on Wavelet and Neural Networks
28. Text-Independent Speaker Recognition Based on ANN
29. Assembler-based Neural Network Simulator
30. Image Compression With Neural Networks
31. Iris Recognition Based on Neural Networks
32. Neural Networks Based Signature Recognition
33. Leaf Recognition System
34. OCR Optical Character Recognition
`Note: All above MATLAB projects are available at advancedsourcecode`

### RFID Based Electronics Projects:

1. RFID Based Attendance System. [With Front End]
2. ERFID Based Security Authentication System
3. RFID Based Parcel Tracing System
4. RFID Based Animal Tracking System
5. RFID Based Ration Card
6. RFID R/W Based Prepaid Energy Meter
7. RFID Based Car Parking System
8. RFID Based Reservation System
9. Autonomous Navigation Of RFID Sensing Robots
10. RFID Based Banking System.
11. Library Management System Using RFID
12. RFID Based Door Locking System
13. RFID Based ATM System
14. RFID Based National Card/ Passport System
15. RFID Based N.G.O./Student Bus Pass Id System
16. RFID Based Security System For Mining Industries [With Front End]
17. Examination Room Guide Using RFID For The Jumbling System Based Exams
18. Bus Location Announcement System
19. RFID Based Highway Toll Collection
20. Development Of An Embedded System Using RFID Based Security System

### Electronics Projects on Robotics:

1. Artificial intelligence, fuzzy logic, neural networks
2. Wireless AI based mobile robot for multi-specialty operations
3. Wireless AI based firefighting robot for relief operations
4. Wireless AI based intelligent-robot for materials handling
5. Integrated rule-based control of robot using fuzzy system & Neural Networks
6. Ai based firefighting robot for relief operations
7. Ai based intelligent-robot for materials handling
8. Firefighting robotic vehicle
9. Gesture-Based Robotics
10. Mobile Robotics
11. Voice Controlled Robotics
12. Sensor Guided Robotics
13. Bluetooth Robotics
14. Swarm Robotics
15. Ai based mobile robot for multi-specialty operations
16. Industrial security robot with motion detection system
17. Microcontroller controlled robot arm for paint spraying
18. Production monitoring robot
19. Two-axis robot with artificial intelligence
20. Three-axis robot with artificial intelligence
21. Four-axis robot with artificial intelligence
22. Five-axis robot with artificial intelligence
23. Wireless industrial security robot
24. ROBOTIC ARM INTERFACING WITH PC/MCU/ IR/RF
25. HYDRAULIC LIFT
26. LINE FOLLOWER OR TRACING ROBOT
27. AUTOMATED WALKING ROBOT
28. DIGITAL SPEED MEASUREMENT SYSTEM FOR AUTOMOBILE
29. LIFT CONTROL USING PC AND MCU
30. ESCALATOR LIFT USING PC & MCU
31. PATHFINDER MOBILE ROBOT
32. MULTILEVEL CAR PARKING LIFT USING MCU
33. AUTOMATIC RAILWAY CROSSING GATE CONTROLLER
34. AUTO REJECTION + CONVEYER BELT SYSTEM
35. AUTO JACK MACHINE
36. AUTO BRACK SYSTEM FOR AUTOMOBIL
38. HYDROELECTRICITY
39. WIND ELECTRICITY
40. ELECTRICITY FROM SPEED BREAKER
1. SOLAR SUN SEEKER
2. ROBOTIC CRANE WITH UP/DOWN & CIRCULAR MOTION
3. Alive human detector robot with counter using wireless pc interfacing
4. Microcontroller based surveillance robot for a military application
5. Pc controlled the wireless robot using RF module with feedback sensor to detect fire.
6. Pole Climbing robot

### Electrical Engineering Based Electronics Projects:

1. Noiseless speed control of dc motor using PWM converter
2. Remote control of ac / dc motor with parameter monitoring
3. Dual control of electrical devices through computer keyboard and Hardware
4. Substation monitoring system – electrical transmission and distribution Process
5. Electrical network automation & communication systems
6. Remote data monitoring & data analysis for a power station
7. Remote on / off of an ac / dc motor
8. Remote on/off controller for ac motors with parameter monitoring
9. Remote speed control of ac / dc motor
10. Remote switching system for home appliances
11. Postpaid electricity billing automation
12. Power sharing of a transformer with overload protection
13. EB theft monitoring and control system
14. Artificial intelligent solar tracking system with a true graph & pc interface
15. Petrol level indicator

### FPGA Based Electronics Projects:

1. Face detection using eigenfaces on FPGA board
2. VHDL robot
3. The digital clock on seven segment display using FPGA
4. Gesture robot using fpga
5. VHDL based rf controlled the robot
6. Remote controlled a robot in vlsi
7. VHDL based visitor counter
8. VHDL based temperature monitoring using tmp175 sensor
9. Voltmeter using VHDL
10. Water level indicator using a rotary switch
11. Wireless alert system using gsm modem
12. Intelligent car parking system
13. lFan temperature control using FPGA
14. Mobile controlled devices
15. Robotic ARM
16. Mobile controlled a robotic arm
17. Optical fiber losses measurement
18. VGA name display using a spartan kit
19. Time-based controlling devices
20. Prepaid energy meter
21. GSM security system using FPGA and GSM modem
22. Temperature monitoring on VGA screen  using FPGA
23. Transformer overheat detection with control
24. VHDL based GSM home security using SMS Alert
26. VHDL based Viterbi decoder
27. VHDL based image encryption
28. VLSI based door security system
29. Stepper motor speed control and display on LCD
30. Wireless dc motor control
31. VHDL based I2C
32. VHDL based UART serial protocol
33. VHDL based Ethernet card
34. VHDL based DMA
35. Android-based wireless device control with touch sensor
36. Keyboard interface with password access
37. Graphical LCD based device control with touchscreen

### Wearable Technology based Electronics Project:

1. Wearable video display
2. Smart jacket for bikers
3. Wearable health monitoring glove (view project details)
4. Smart-Watch using Raspberry Pi
5. Smart bike display
6. Wearable wristband with pulse sensor

### AVR Based Electronics Projects:

1. Gesture Robot using ATMEGA 8
2. Bluetooth device Controlled Using ATmega AVR
3. Solar based mobile irrigation System
4. Bio-gas based Electrical generator
5. Solar based Industrial production Plant
6. Solar energy Based Intelligent UPS inverter with SMS feedback
7. DC motor speed control using PI controller
8. Electricity theft Detection with wireless RF or SMS monitoring
9. Electricity Meter tempering security with GSM modem
10. Electricity Theft detection
11. Traffic Light ambulance with RF accident Security
12. MISC Electronics Projects:

If you like our post “Final Year Projects for Electronics” then share this post with your friends and let them know about these interesting project and also do not forget to comment if you have any idea related to final year projects. feel free to comment down below if you find any difficulty.

In this post, we will learn How to Interface IR Sensor with Arduino. It’s is one of the most commonly used sensor and it is used for multiple purposes such as Line following Robot, Obstacle avoiding Robot, Controlling LEDs with IR Sensor, color detection, fire detection, etc.

So Today we are going to cover step by step guide on How to Interface Infrared Sensor with Arduino.

# Interfacing of IR Sensor with Arduino

### What is IR Sensor?

An Infrared sensor or commonly known as IR Sensor is an electronic device, used to sense the heat of an object and motion of an object. Basically, an IR Sensor can detect Infrared radiation that is not visible with naked eyes. A body when heated radiates infrared light which can be detected by IR Sensor.
IR Sensor is consist of two circuits, IR transmitter, and IR receiver. In the transmitter section, IR LED is used and in the Reciever section, a photodiode is used. IR LED transmit Infrared light to an object and then that IR light is bounced back and IR receiver, receives that light and convert it to the electric voltage accordingly.

Picture down below shows the IR Sensor and Operation of IR Sensor.

### IR Sensor Module:

IR Sensor module is used with Arduino to detect infrared radiations that are not visible to the human eye. It is mostly used for robot obstacle avoidance, obstacle avoidance car, line count and black and white line tracking.

Also Read: What is Arduino Micro-controller? And How to Learn Arduino

#### Specification of IR Sensor Module:

1. It has a receiving range of 2 ~ 30 cm.
2. working voltage of 3 .3 V to 5 V.
3. working current of 1.5 mA.
4. operating temperature range from -25 C to 85C.
https://www.videosprofitnetwork.com/watch.xml?key=84023bfeee863e70ba7359105d0725b0

#### IR Sensor Module Pins:

1. +5v Source: IR sensor Module require +5v to work perfectly.
2. Ground: In order to get operation from IR Sensor module we need to provide ground to the sensor module.
3. OUT Pin: OUT pin is important pin it is used to connect sensor with microcontroller‘s input or output port.

### Components required:

1. Arduino Uno
2. IR Sensor Module
3. Jumper Wires

## Let’s Interface IR Sensor with Arduino:

The connection for Interfacing of  IR Sensor with Arduino is very easy, connect VCC of a module with Arduino 5v pin, connect the ground of module with Arduino’s Ground and connect OUT pin of a module with a 4th digital pin of Arduino.

Note: do not get confused if you feel any query do comment down below we will respond you as soon as possible.

### Source code for Interfacing IR Sensor with Arduino

```/*
Interfacing of IR Sensor with arduino code
Purpose: Turns on an LED when object is detected, else off.
*/

const int IRSensor=4;

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an builtin LED connected on most Arduino boards:
pinMode(13, OUTPUT);
//Pin 4 is connected to the output of IR sensor
pinMode(IRSensor,INPUT);
}

void loop() {
{
digitalWrite(13, HIGH); // set the LED on
}
else
{
digitalWrite(13, LOW); // set the LED off
}
}```

Note: by varying sensor’s potentiometer you can ensure that the sensor is correctly working or not!

Just place an object in front of a sensor and observe the change in LED connected to pin 13 (Built-in Arduino’s LED). If the LED is high it means the sensor is working if the LED is low vary the potentiometer till the LED goes high.

Now remove the object and see if LED goes low it means the sensor is working correctly.

Read More: How to Interface Ultrasonic Sensor with Arduino

##### Keep Visiting: Studentsheart.com

Hey, friends in this tutorial we are going to learn and make an Arduino Based Radar Project, Basically, The Radar Project is very useful for finding an object and they are widely used in navigation based systems and also they are used in the security-based system.

Today we will cover that how we can make Arduino ultrasonic sensor project such as Radar System using Arduino. Its very simple, only you need few components and some coding. Don’t worry I have uploaded the circuit diagram and coding for this project below. Arduino based Radar Project is very simple and interesting project. But before starting project let me tell you about RADAR and RADAR Based Project.

RADAR stands for RADIO DETECTION AND RANGING. Radar is equipment which is used to detect objects using Radio Waves. It discovers and studies remote targets by sending a radio pulse within the direction of the target and receives the reflection of the wave.

## So what this Project Arduino Based Radar Project will perform?

This is very Simple Arduino Based Radar Project” whenever any object will come near to its range it will sense it and then it will produce output on Radar. It will indicate the presence of the object on Radar. Also, you can modify the project according to your need, you can make any type of security based system using this concept. Do whatever you want it just depends on your coding skills.
So Before Starting this Project Let me tell you what we will need to make this Project.

#### Components Required for Arduino Based Radar Project Using Ultrasonic Sensor:

https://www.videosprofitnetwork.com/watch.xml?key=84023bfeee863e70ba7359105d0725b0

• Arduino UNO
• Ultrasonic HC-SR04
• Servo Motor
• Jumper Wires

### Why are we using these Components?

Here we are using Arduino to control codes and perform the required objective. for example, here we are using Arduino to Perform Radar Project operation to do that we need other components like Ultrasonic Sensor which is usually used for measuring distance here it will measure distance and it will give that measured data to the Arduino, and also we are using Servo Motor basically, Servo Motor works on the angle principle it means its rotations is based on angles so it will give us rotation on different angles.
Here we are putting the Ultrasonic sensor on the servo motor and it will move on the particular angles and whenever ultrasonic sensor will receive the signal it will send that signal to the Arduino and the Arduino will send that data to the Processing IDE which will show the visual presence of that object on RADAR. I hope it’s quite clear now.

Connect them Like this

### Connections Part for Arduino Based Radar Project Using Ultrasonic Sensor:

Make sure you have connected all the connections like this. After connecting all the connections like this click below and download the required files for this ARDUINO BASED RADAR Project.

Files are:

Now Open your Arduino IDE if you don’t have then click above to download them. After download Arduino IDE open it and copy the code from Arduino Based Radar Project Code and paste it on the IDE. Then simply click on UPLOAD. Now open Processing IDE and paste the Processing code into it and then click on start.

Now place any object in front of Radar and see Processing is showing the detection of that object visually on the radar. if you have any confusion just follow this video then. I hope you have understood all the required things. if yes then I am satisfied otherwise just comment below and tell me what query you have.

### Arduino Code for Arduino Based Radar Project Using Ultrasonic Sensor:

```// Includes the Servo library
#include <Servo.h>.
// Defines Tirg and Echo pins of the Ultrasonic Sensor
const int trigPin = 10;
const int echoPin = 11;
// Variables for the duration and the distance
long duration;
int distance;
Servo myServo; // Creates a servo object for controlling the servo motor
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600);
myServo.attach(12); // Defines on which pin is the servo motor attached
}
void loop() {
// rotates the servo motor from 15 to 165 degrees
for(int i=15;i<=165;i++){
myServo.write(i);
delay(30);
distance = calculateDistance();// Calls a function for calculating the distance measured by the Ultrasonic sensor for each degree

Serial.print(i); // Sends the current degree into the Serial Port
Serial.print(","); // Sends addition character right next to the previous value needed later in the Processing IDE for indexing
Serial.print(distance); // Sends the distance value into the Serial Port
Serial.print("."); // Sends addition character right next to the previous value needed later in the Processing IDE for indexing
}
// Repeats the previous lines from 165 to 15 degrees
for(int i=165;i>15;i--){
myServo.write(i);
delay(30);
distance = calculateDistance();
Serial.print(i);
Serial.print(",");
Serial.print(distance);
Serial.print(".");
}
}
// Function for calculating the distance measured by the Ultrasonic sensor
int calculateDistance(){

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH); // Reads the echoPin, returns the sound wave travel time in microseconds
distance= duration*0.034/2;
return distance;
}```

## Processing Code for Arduino Based Radar Project using Ultrasonic Sensor:

```// Studentsheart.com
//Arduino Based Radar Project in 2018

import processing.serial.*; // imports library for serial communication
import java.awt.event.KeyEvent; // imports library for reading the data from the serial port
import java.io.IOException;
Serial myPort; // defines Object Serial
// defubes variables
String angle="";
String distance="";
String data="";
String noObject;
float pixsDistance;
int iAngle, iDistance;
int index1=0;
int index2=0;
PFont orcFont;
void setup() {

size (1200, 700); // ***CHANGE THIS TO YOUR SCREEN RESOLUTION***
smooth();
myPort = new Serial(this,"COM5", 9600); // starts the serial communication
myPort.bufferUntil('.'); // reads the data from the serial port up to the character '.'. So actually it reads this: angle,distance.
}
void draw() {

fill(98,245,31);
// simulating motion blur and slow fade of the moving line
noStroke();
fill(0,4);
rect(0, 0, width, height-height*0.065);

fill(98,245,31); // green color
// calls the functions for drawing the radar
drawLine();
drawObject();
drawText();
}
void serialEvent (Serial myPort) { // starts reading data from the Serial Port
// reads the data from the Serial Port up to the character '.' and puts it into the String variable "data".
data = data.substring(0,data.length()-1);

index1 = data.indexOf(","); // find the character ',' and puts it into the variable "index1"
angle= data.substring(0, index1); // read the data from position "0" to position of the variable index1 or thats the value of the angle the Arduino Board sent into the Serial Port
distance= data.substring(index1+1, data.length()); // read the data from position "index1" to the end of the data pr thats the value of the distance

// converts the String variables into Integer
iAngle = int(angle);
iDistance = int(distance);
}
pushMatrix();
translate(width/2,height-height*0.074); // moves the starting coordinats to new location
noFill();
strokeWeight(2);
stroke(98,245,31);
// draws the arc lines
arc(0,0,(width-width*0.0625),(width-width*0.0625),PI,TWO_PI);
arc(0,0,(width-width*0.27),(width-width*0.27),PI,TWO_PI);
arc(0,0,(width-width*0.479),(width-width*0.479),PI,TWO_PI);
arc(0,0,(width-width*0.687),(width-width*0.687),PI,TWO_PI);
// draws the angle lines
line(-width/2,0,width/2,0);
popMatrix();
}
void drawObject() {
pushMatrix();
translate(width/2,height-height*0.074); // moves the starting coordinats to new location
strokeWeight(9);
stroke(255,10,10); // red color
pixsDistance = iDistance*((height-height*0.1666)*0.025); // covers the distance from the sensor from cm to pixels
// limiting the range to 40 cms
if(iDistance<40){
// draws the object according to the angle and the distance
}
popMatrix();
}
void drawLine() {
pushMatrix();
strokeWeight(9);
stroke(30,250,60);
translate(width/2,height-height*0.074); // moves the starting coordinats to new location
popMatrix();
}
void drawText() { // draws the texts on the screen

pushMatrix();
if(iDistance>40) {
noObject = "Out of Range";
}
else {
noObject = "In Range";
}
fill(0,0,0);
noStroke();
rect(0, height-height*0.0648, width, height);
fill(98,245,31);
textSize(25);

text("10cm",width-width*0.3854,height-height*0.0833);
text("20cm",width-width*0.281,height-height*0.0833);
text("30cm",width-width*0.177,height-height*0.0833);
text("40cm",width-width*0.0729,height-height*0.0833);
textSize(40);
text(" StudentsHeart.com ", width-width*0.875, height-height*0.0277);
text("Angle: " + iAngle +" °", width-width*0.48, height-height*0.0277);
text("Distance: ", width-width*0.26, height-height*0.0277);
if(iDistance<40) {
text(" " + iDistance +" cm", width-width*0.225, height-height*0.0277);
}
textSize(25);
fill(98,245,60);
text("30°",0,0);
resetMatrix();
text("60°",0,0);
resetMatrix();
text("90°",0,0);
resetMatrix();
text("120°",0,0);
resetMatrix();
text("150°",0,0);
popMatrix();
}
Read More: What is the Duty Cycle?
```

#### Also, Check:

1. Latest 500+ Final Year Projects For Electronics Engineering Students
2. How to Interface IR Sensor with Arduino Step by Step GUIDE
3. Want to learn What is Arduino? How does it work?
4. Want to learn and make Arduino Based Calculator.
5. Want to learn and make Arduino Based Line Following Robot.
6. Want to learn and make IR Remote tester Project Control LED on Remote.
7. Want to learn and make Visitor Counter Using LDR and 7 Segment Display.

This is all for today I hope you guys like this project Arduino Based Radar Project using Ultrasonic Sensor if yes then comment below and share this post with your friends. Thanks for Visiting StudentsHeart.com Stay connected. Thanks!

Page 1 of 2