IR Proximity Sensor Library for Proteus
- First of all, download this IR Proximity Sensor Library for Proteus, by clicking the below button:
Download IR Proximity Sensor Library for Proteus
- It's a .zip file, which will have two folders in it i.e. Proteus Library & Proteus Simulation.
- Open Proteus Library Folder, it will have 3 files, named as:
- Place these three files in the Library folder of your Proteus software.
- After adding these library files, open your Proteus ISIS software, or restart it if it's already open.
- In the component's search box, make a search for IR Proximity.
- If you have installed the Library successfully, then you will get similar results, as shown in the below figure:
- As you can see in the above figure that we have two IR Proximity sensors.
- When it comes to functionality, both sensors are exactly the same, they just have different colors.
- Now simply place these IR Proximity Sensors in your Proteus workspace, as shown in the below figure:
- As you can see in the above figure, I have placed both of these IR Proximity sensors in my Proteus workspace.
- This sensor has 4 pins in total, which are:
- V ( Vcc ): We need to provide +5V here.
- G ( Gnd ): We need to provide Ground here.
- O ( Out ): It's an analog output signal from the sensor.
- TestPin: It's solely for simulation purposes, we don't have this pin in real IR sensor.
- As we can't actually place an obstacle in front of this sensor in Proteus simulation, that's why I have used this TestPin.
- If we change the value of TestPin from 0V to 5V then that means obstacle is coming close.
Adding Sensor's Hex File
- Lastly, we need to add the Sensor's Hex File, which we have downloaded and placed in the Library folder.
- So, in order to do that, right click on your IR sensor and then click on Edit Properties.
- You can also open the Properties Panel by double clicking on the sensor.
- Here, in the Properties Panel, you will find Sensor's Hex File Section.
- Click on the Browse button and add IRProximitySensorTEP.HEX file here, as shown in below figure:
- After adding the Sensor's Hex File, click on the OK button to close the Properties Panel.
- Our IR Proximity Sensor is now ready to simulate in Proteus ISIS.
- Let's design a small circuit, in order to understand the working of this IR Proximity Sensor.
Proteus Simulation of IR Proximity Sensor
- First of all, let's design a simple circuit, where I am attaching a variable resistor with the Test Pin & I am adding a Voltmeter at the Output pin, as shown in below figure:
- Using this variable resistance, we can change voltage on Test Pin.
- If TestPin has 0V, means we don't have any obstacle in front of the sensor.
- If TestPin has 5V, implies that something's placed right in front of the sensor.
- So, let's have a look at How output value will change, when we change the voltage on TestPin.
- At the Output Pin, I have placed an LC filter, that's also not required in real hardware implementation.
- But I have to use this filter in Proteus Simulation, as Proteus provides the Peak to Peak value and we need to convert that value into Vrms.
- So, if you are working on a real sensor then you don't need to add this inductor or capacitor.
- Now, let's run this Proteus Simulation and if you have done everything correctly, then you will get similar results:
- I have shown three different scenarios in above figure:
- In the first image, variable resistor is at 100%, thus providing 0V at TestPin. That's why, we got 0V at Output and hence no obstacle detected.
- In the second image, variable resistor is around 50%, thus providing around 2.5V at TestPin. So, we are getting around 2.5V at Output and hence obstacle detected in close range.
- In the third image, variable resistor is around 0%, thus providing around 5V at TestPin. So, we are getting around 5V at Output and hence obstacle's just in front of the sensor.
- I have placed this simulation in above zip file, so play with it and don't forget to add the Sensor's Hex File.