Pir library for proteus,pir library proteus, pir simulation in proteus, pir simulation proteus, pir proteus simulation pir proteus library, pir in proteus, pir library proteus, pir sensor library for proteus, pir proteus library
TEP , The Engineering Projects , Boxes

PIR Sensor Library for Proteus

Shares 2.5K Views
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Shares: 691
TEP , The Engineering Projects , PCBWAY

Update: Here are the latest versions of this library: PIR Sensor Library for Proteus V3.0 and PIR Sensor Library for Proteus V2.0.


Hello friends, hope you are doing well.  Today, I will share a new PIR Sensor Library for Proteus. PIR Sensor module is not available in Proteus so we can't use it in our simulations. But today, I will share a new PIR Sensor Library for Proteus which can easily simulate PIR Sensor in Proteus software. We are quite happy that we are helping engineers by sharing these new Proteus Libraries.

We all know about PIR Sensor but if you don't know then first read Interfacing of PIR Sensor with Arduino.

As a quick review, a PIR sensor is used to detect motion in the environment and is commonly known as a motion sensor. It's quite helpful in security projects where you need to detect motion. For example in some bank vault where there's no possibility of motion, you can place this sensor and can check if there's any movement. It is also used in home automation i.e. if there's no movement in some room, turn off its appliances. So, in short, the PIR sensor has numerous uses and is used quite a lot in engineering projects.

First of all, I will show you today, How to download this PIR Sensor Library for Proteus and then we will also design a small simulation in Proteus in which I will interface this PIR Sensor with Arduino UNO. You can interface it with any microcontroller i.e. PIC Microcontroller or 8051 Microcontroller. But today, I will interface it with an Arduino microcontroller. As homework, you guys interface it with a PIC Microcontroller or 8051 Microcontroller and share it in comments, it may help others. So, let's get started with the PIR Sensor Library for Proteus:

PIR Sensor Library for Proteus

  • First of all, click on the below button to download the PIR Sensor Library for Proteus:
PIR Sensor Library for Proteus
  • Once you download it, you will get three files in it, named:
    • PIRSensorTEP.LIB
    • PIRSensorTEP.IDX
    • PIRSensorTEP.HEX
  • Place all these three files in the library folder of your Proteus software.
Note:
  • Now open your Proteus software and search for PIR Sensor, you will get a total of four models in it.
  • Place these models in your Proteus workspace and it will look something as shown in the below figure:
Pir library for proteus,pir library proteus, pir simulation in proteus, pir simulation proteus, pir proteus simulation pir proteus library, pir in proteus, pir library proteus, pir sensor library for proteus, pir proteus library
  • I have added four models of this PIR Sensor in Proteus Library and you can use any of them.
  • As working is concerned they are all the same but they differ in color.
  • The first color is our normal color, which I always use for my Proteus Libraries while the second one is green, the third is pinkish and the fourth one is blue.
  • This PIR Sensor has a total of four Pins, among which one is Vcc so you need to give +5V at this pin, then there's GND which you need to ground.
  • The OUT pin is our main pin through which we will be getting our output like whether it detects the motion or not.
  • Now, obviously, we can't detect real motion in Proteus Simulation that's why I have placed a TestPin which will be working as a simulation Pin.
  • If TestPin is HIGH, it means the motion is detected and if it's LOW then it means the motion is not detected.
  • Now we have our module in Proteus so one last thing we need to do is add its functionality.
  • So, in order to do so, double-click this PIR sensor and in the Program File section give a path to the file PIRSensorTEP.HEX, which you have placed in the library folder of your Proteus software as shown in the below figure:
Pir library for proteus,pir library proteus, pir simulation in proteus, pir simulation proteus, pir proteus simulation pir proteus library, pir in proteus, pir library proteus, pir sensor library for proteus, pir proteus library
  • Now click OK and your PIR Sensor is ready to be used in the Proteus Simulation.
  • So, now let's design a simple example for this PIR Sensor which will help you in understanding this sensor.

PIR Sensor simulation in Proteus

  • Design a simple circuit in Proteus software as shown in the below figure:
Pir library for proteus,pir library proteus, pir simulation in proteus, pir simulation proteus, pir proteus simulation pir proteus library, pir in proteus, pir library proteus, pir sensor library for proteus, pir proteus library
  • Now you can see in the above figure that I have placed a PIR Sensor along with Arduino UNO and a Virtual terminal.
  • PIR Sensor is connected to Pin # 2 of Arduino UNO.
  • Now upload the below code in Arduino software and get the hex file. You should read How to get Hex File from Arduino, if you don't know already.
    #define pirPin 2

    int calibrationTime = 30;
    long unsigned int lowIn;
    long unsigned int pause = 5000;
    boolean lockLow = true;
    boolean takeLowTime;
    int PIRValue = 0;

    void setup()
    {
    Serial.begin(9600);
    pinMode(pirPin, INPUT);
    }

    void loop()
    {
    PIRSensor();
    }

   void PIRSensor()
{
     if(digitalRead(pirPin) == HIGH)
     {       
         if(lockLow)
         {    
             PIRValue = 1;
             lockLow = false;
             Serial.println("Motion detected.");
             
             
             delay(50);
         }         
         takeLowTime = true;
       }

       if(digitalRead(pirPin) == LOW)
       {       
           
           if(takeLowTime){lowIn = millis();takeLowTime = false;}
           if(!lockLow && millis() - lowIn > pause)
           {
               PIRValue = 0; 
               lockLow = true;                        
               Serial.println("Motion ended.");
               
               delay(50);
           }
       }
}
  • Now run your simulation, and click the logic button to 1, which will indicate that motion is detected and you will get something as shown in the below figure:
Pir library for proteus,pir library proteus, pir simulation in proteus, pir simulation proteus, pir proteus simulation pir proteus library, pir in proteus, pir library proteus, pir sensor library for proteus, pir proteus library
  • Now let's make the logic state to 0, which will indicate that no motion detected, as shown in below figure:
Pir library for proteus,pir library proteus, pir simulation in proteus, pir simulation proteus, pir proteus simulation pir proteus library, pir in proteus, pir library proteus, pir sensor library for proteus, pir proteus library
  • So that's how our PIR Sensor is gonna work in Proteus. I hope you are going to like this PIR Sensor Library for Proteus.
  • You can download the simulation by clicking on the below button:
Download PIR Proteus Simulation
  • Here's a YouTube video where I have explained this PIR Sensor Library for Proteus in more detail, so check it out:

That's all for today, hope you have enjoyed it and gonna use it in your projects. If you get into any trouble, ask in the comments and I will try to resolve them as soon as possible. Take care !!! :)

TEP , The Engineering Projects , Tags
Comments

Write a Comment

WordPress Google Twitter Facebook User
Robot
Comments Comments on ‘’ PIR Sensor Library for Proteus ‘’ (38)
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Sir after downloading pir sensor library i got one .rar file only and also m nt getting library folder in labcentre electrnoics I am doing one AVR based project where i need this sensor. Plz help me. Rply ASAP.
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Hi, Yeah unrar this rar file and you will get the library files and then follow the instructions in tutorial. The path of library folder is mentioned above in Note form and also make a search in your Labcenter folder for Libraries and you will get the folder. Its not that difficult. Thanks.
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
download a software of .rar file opener.....then install that software.......then by using the software open the rar file.............then whatever file you got copied to library folder of labcenter
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Most PIR sensors have 2-3 triggering modes selectable via a jumper or solder bridge - maybe it would be nice to emulate that behavior by adding 2-3 pins to simulate the jumper / modes. Trigger modes / retriggering explained here: https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/testing-a-pir Also, PIR sensor modules might have 1 pot for adjusting the cooldown period, i.e. how much time the sensor outputs a "triggered" signal (usually HIGH) before switching over (to usually LOW) - assuming no motion was detected during this period. That would also be nice to have as functionality, as currently it looks to me that once triggered it never goes back to LOW. Other than that, good job.
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
In Proteus, designing of active models is quite difficult, but I will consider your suggestion and will try to add the knob in it. Thanks for the appreciation. (Y)
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Hey, nice work and explanation about the PIR sensor. I have a problem with the virtual terminal, I can't visualize the motions with the serial port, I have made the same things that you suggest, the only difference is that I'm working on an arduino mega1280. May you help me?
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
sir, i want the blood pressure sensor in proteus but i couldn't find the library of BMP i please help me please let me know if u could suggest any link contact me here sir 02032013023.cst@rub.edu.bt
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
hello pır sensor what i make the circuit always gives an error what i have to do Unable to open HEX file '..\..\..\..\Users\zain\AppData\Local\Temp\build2551671029259847980.tmp/PIRTest.cpp.hex'. [PIR1] the last time you did it again gives the same error pırsensortep.hex what should I do
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
go to c drive. turn on the display of hidden folder.Then, You will find ProgramData folder. go to "labcenter" , then "proteas..." and then "Library"
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Hi, Yeah we have posted it recently. You can download it from this link: https://www.theengineeringprojects.com/2018/05/magnetic-reed-switch-library-for-proteus.html Thanks.
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Thanks so much for the description , virtual terminal won't pop up most times on my Proteus , is there remedy to the problem.?.
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
hello i keep getting the error Program file is too big for the microcontroller: flash size = 32768, load address = 65550, number of bytes = 2. do you know what's going wrong?
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Hi, Delete the Library files and download them again and place in the Library Folder. Now before running your simulation, don't forget to add the Hex file of PIR Sensor in its Properties section. I think it will solve the issue. Thanks.
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
hy brother .....i faced the problem during my stimulation of that PIR where i searched logic button in my proteus so there was no match contents of it.....unfortunately i got logic generator but it didn't work....so,what can i do?
Comment
Reaction 40
Reaction 700
Reaction 60
Reaction 25
Reaction 60
Hi David, thank you for sharing.
PIR is not working with my Proteus 8.15.
Several warning messages (more than 7000) like "[PIC18 EXEC] PC=0x0004. Attempt to execute illegal opcode (loaded from PC=0002). Instruction executes as a NOP. [PIR1] @0.000003000s".
I've followed all steps you showed.
Is there anything more that I need to do?
Inot even working running PIR alone.