PIR Sensor without Microcontroller | Burglar AlarmSharath
Great to see you all after a long time. Just came up with a simple tutorial on how to use the PIR Sensor without any microcontroller. It will also help you understand the importance of a transistors specifically. We are in the place we hold billions of transistors in our hand (saying about a Smartphone), but it all comes from the single transistor that was demonstrated in 1947. So lets look into it.
In the past, we already learnt about how to use a PIR Sensor with an Arduino. So now we will see how to use a PIR Sensor without any microcontrollers.
- PIR Sensor
- 9V Battery/Adapter
- 9V Battery Snap Connector
- 7805 Voltage Regulator
- BC547 NPN Transistor
- 1K Ohm Resistor
- 5V Buzzer
- Jumper Wires
What is a transistor?
A transistor is a semiconductor device used to control flow of large current between Emitter and Collector by a small base current. A transistor can used as an amplifier, oscillator or a switch. In our case we will be using it as switch. There are two types of transistors available NPN and PNP Transistors. Depending upon applications, we can use the type of transistor.
An NPN transistor gets triggered by Positive current on base and PNP Transistor gets triggered by a Negative Current in the Base. So if your sensor output is HIGH when there is detection, we will use NPN Transistor.
Some basic digital sensors, output is HIGH in normal condition. But when something detected, the output will be LOW. In this case an PNP Transistor will work. If you note, the name PNP – the middle denotes the Base that is negative, so when you use negative (LOW) applied to base, the transistor passes current between Emitter and Collector.
The Pin details for NPN and PNP Transistor are given below
As we mentioned, we will be using an NPN Transistor, as the PIR Output a HIGH Signal when motion is detected. So when motion detection, the base of the transistor gets a positive signal, hence the current starts flow from Collector to Emitter. We used a resistor to limit the current flow through the resistor.
After making the circuit diagram, In the PIR Sensor there will be two potentiometers available.
Sensitivity Pin – The first one is Sensitivity. How sensitive the Sensor needs to be detected.
Hold the potentiometer facing towards you. The first pin is Sensitivity and Second is Delay Adjustment.
Delay Pin – The Second one is Time Delay. How long the PIR Needs to be turned ON (the Detected State). Make this towards zero position as its minimum time delay will be 3seconds to max 5 minutes. This is very important or else you can’t get the sensor triggered in the middle of the delay. After the delay ends, the sensor backs to its normal position.
PIR Sensor takes some time to warm up. So you may get some issues at starting. Once the time delay and sensitivity is calibrated, it will work normal.
1) Isn’t pir sensors voltage 5v to 20v? If we connect without a 5 volt regulator, may the circuit burn? And is it safer this way with regulator? Is regulator need heat sink?
2) What should we do if we want to connect a piezo alarm that uses 9V input voltage?
3) If we want an LED to light up, should we put it after the resistor of 1k ohm?
1. The PIR can work up to 20V without regulator, However, the OUT pin is 3.3V TTL Logic only. If you use 7805 which is a fixed linear voltage regulator, it emits the heat as its voltage conversion from 20V to 5V (almost 15Volts as Heat). So heatsink may require for Linear regulator.
2. The circuit given is to trigger an High voltage with a 3.3V logic using a transistor, so you can power as shown in the circuit diagram itself.
3. For lighting an LED, you need a resistor for current limiting, you can use 100ohm or 220 Ohm resistor separately from OUT Pin. 1K will be too low and we can’t see LED Glows.