IR sensor interfacing with arduino nano in proteus

IR sensor interfacing with arduino nano in proteus 

In this article we will learn how to interfacing IR sensor with arduino nano in proteus.
In the last post we will learn how to interfacing arduino with seven segment single digit display. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.

Components which we use in IR sensor interfacing with arduino nano in proteus are listed below.

  1. IR sensor (2Pcs)
  2. Arduino nano
  3. LCD display
  4. Resister (330 Ω)
  5. Connecting wires (As req.)
  6. LED’s (Red,Green,Yellow)

Diagram of IR sensor interfacing with arduino nano in proteus:

IR sensor interfacing with arduino nano in proteus
IR sensor interfacing with arduino nano in proteus

Construction of IR sensor interfacing with arduino nano in proteus:

Connect D7 point of arduino to RS point of LCD.

Connect D6 point of arduino to E point of LCD.

Connect D5 point of arduino to D4 point of LCD.

Connect D4 point of arduino to D5 point of LCD.

Connect D3 point of arduino to D6 point of LCD.

Connect D2 point of arduino to D7 point of LCD.

Connect full LED and occupied LED’s common point with each other, then connect the remaining point of full LED to D12 point of arduino through 330 Ω resistor.

Now connect remaining point of occupied LED to D13 point of arduino through 330 Ω resistor.

Now connect the empty LED’s one point with the common GND point of IR sensors, and the other point connect with D10 point of arduino through 330 Ω resister.

Now connect the VCC point’s of IN sensor and OUT sensor with each other.

Connect GND points of both sensors with each other.

Connect out point of IN sensor with D9 point of arduino.

Connect out point of OUT sensor with D11 point of arduino.

After all this dress up the wires clean and tidy.

Working of IR sensor interfacing with arduino nano in proteus:

This project helps to counting people at different department like, hotels, schools, party clubs, ware houses, home, and etc….

Using of this project u can count how many people are entering in the hotel and how many exit the hotel. According to this you can calculate how many people’s are still in hotel and different departments where you use this project. It is very help full and easy to use.

Application of IR sensor interfacing with arduino nano in proteus:

  1. Object detection and proximity sensing
  2. Line following robots
  3. Obstacle avoidance in robots
  4. Security system
  5. Gesture recognition
  6. Automatic lighting systems
  7. Remote control systems
  8. Temperature measurements
  9. Infrared communications
  • Automotive applications

Advantages of IR sensor interfacing with arduino nano in proteus:

  1. Cost-effective testing
  2. Time efficiency
  3. Safety and risk reduction
  4. Easy of experimentation
  5. Real-time visualization
  6. Learning and education

Code Programing of IR sensor interfacing with arduino nano in proteus:

#include <LiquidCrystal.h>

LiquidCrystal lcd(7,6,5,4,3,2);
int addSensor = 9; // IR sensor for addition
int subtractSensor = 11; // IR sensor for subtraction

int irState = 0;
int addCount = 0; // Count for addition
int subtractCount = 0; // Count for subtraction
int totalCount = 0; // Total count (addCount – subtractCount)
int sensorState;
int previoussensorState = 0;

const int emptyPin = 10; // LED pin for “Empty” indicator
const int fullPin = 12; // LED pin for “Full” indicator
const int occupiedPin = 13;

void setup(){
pinMode(addSensor, INPUT);
pinMode(subtractSensor, INPUT);

pinMode(emptyPin, OUTPUT);
pinMode(fullPin, OUTPUT);
pinMode(occupiedPin, OUTPUT);
lcd.begin(16, 2);
lcd.print(“IRsensor:State”);

}

void loop(){
sensorState = digitalRead(addSensor);

if (sensorState == 1 && previoussensorState == 0) {
if (totalCount < 10) {
addCount++;
totalCount = min(addCount – subtractCount,10);

updateDisplay(totalCount);
delay(300);

}
}

previoussensorState = sensorState;

sensorState = digitalRead(subtractSensor);
if (sensorState == 1 && previoussensorState == 0) {
subtractCount++;
totalCount = addCount – subtractCount;
lcd.clear();
lcd.begin(16, 2);
lcd.print(“IRsensor:State”);
updateDisplay(totalCount);
delay(300); // Add delay after detecting subtraction
}

previoussensorState = sensorState;

digitalWrite(emptyPin, totalCount <= 0);
digitalWrite(fullPin, totalCount >= 10);
digitalWrite(occupiedPin, totalCount > 0 && totalCount < 10);

delay(100);
}

void updateDisplay(int count) {
lcd.setCursor(0, 1);
lcd.print(“Count: “);
lcd.print(count); // Update LCD count
}