Friday, July 27, 2018

AUTOMATIC ROOM LIGHT CONTROLLER BY USING PIR SENSOR

First let’s explain the working principle. The module actually consists of a Pyroelectric sensor which generates energy when exposed to heat.

That means when a human or animal body will get in the range of the sensor it will detect a movement because the human or animal body emits heat energy in a form of infrared radiation. That’s where the name of the sensor comes from, a Passive Infra-Red sensor. And the term “passive” means that sensor is not using any energy for detecting purposes, it just works by detecting the energy given off by the other objects.

The HC-SR501 PIR Sensor Module


The module has just three pins, a Ground and a VCC for powering the module and an output pin which gives high logic level if an object is detected. Also it has two potentiometers. One for adjusting the sensitivity of the sensor and the other for adjusting the time the output signal stays high when object is detected. This time can be adjusted from 0.3 seconds up to 5 minutes.
PIR Sensor Pinout
The module has three more pins with a jumper between two of them. These pins are for selecting the trigger modes. The first one is called “non-repeatable trigger” and works like this: when the sensor output is high and the delay time is over, the output will automatically change from high to low level. The other mode called “repeatable trigger” will keep the output high all the time until the detected object is present in sensor’s range.

Components needed for this tutorial


You can get the components from any of the sites below:
*Please note: These are affiliate links. I may make a commission if you buy the components through these links.
I would appreciate your support in this way!

Circuit Schematic


As an example for this tutorial I will make a circuit that will turn on a high voltage lamp when the sensor will detect an object. Here’s the circuit schematics. The output pin of the sensor will be connected to pin number 8 on the Arduino Board and when an object will be detected the pin number 7 will activate the relay module and the high voltage lamp will turn on.
PIR-Sensor-Circuit-Schematics_bb
For more details how the relay module works, you can check my Arduino Relay Tutorial. (Keep in minds that we use high voltage in the example, so you should be very caution, because I don’t take any responsibility of your actions)

Source Code


Here’s the Arduino Code for this example. It’s quite simple. We just need to define the PIR Sensor pin as input and the relay pin as output. Using the digitalRead() function we will read the output of the sensor and if its high or if an object is detected it will activate the relay. For activating the relay module we will send a logic low as the relay input pin works inversely.
  1. /* Arduini PIR Motion Sensor Tutorial
  2. *
  3. * by Dejan Nedelkovski, www.HowToMechatronics.com
  4. *
  5. */
  6. int pirSensor = 8;
  7. int relayInput = 7;
  8. void setup() {
  9. pinMode(pirSensor, INPUT);
  10. pinMode(relayInput, OUTPUT);
  11. }
  12. void loop() {
  13. int sensorValue = digitalRead(pirSensor);
  14. if (sensorValue == 1) {
  15. digitalWrite(relayInput, LOW); // The Relay Input works Inversly
  16. }
  17. }
The demonstration of the example can be seen at the end of the video attached above. Note that after powering the sensor module it needs about 20 – 60 seconds to “warm-up” in order to function properly. Now when you will put your hand in front of the sensor the relay will activate the lamp. But note that even if you move your hand constantly the lamp will turn off after the adjusted delay time is over because the PIR sensor is in “non-repeatable trigger” mode. If you change the sensor with the jumper to the “repeatable trigger” mode and you constantly move the hand, the lamp will be constantly on as well and it will turn off after the movement is gone and the set delay time is over
.

Sunday, February 4, 2018

SIMPLE LED LIGHT USING 9 VOLT STEPDOWN TRANSFORMER

hai friends this is my first blog

 Today we do how to grown an led light  by using 9 volt step down transformer

components requirement:

9 volt stepdown transformer         -1

 1 watt led light                             -3
1k ohm resister                              -3


I m taking 9 volt tansformer for my old electronic device .you  also take old cell phone charger or any other 9 or 6 volt adapter

this is 9-0-9 tansformer so Red and Black wire is input wire (230 volt ac)
And out their are three wire 1 and 3 pin can be short and centre pin is negative
So 15 volt 2200microfaran

AUTOMATIC ROOM LIGHT CONTROLLER BY USING PIR SENSOR

First let’s explain the working principle. The module actually consists of a Pyroelectric sensor which generates energy when exposed to hea...