Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

DIY- PIR Based Automatic Staircase Lighting

By Ganesh Selvaraj

 

This tutorial will teach you how to make the simplest motion detecting staircase light without any additional microcontroller and programming using PIR based Sensor.

 

Required Components:

1. PIR sensor
 
2. 1K, 330 ohms Resistors
 
3. 12V SPDT Relay module or a. 12V SPDT Relay
 
                                     b. 1k, 330 ohms Resistors
                                     
                                     c. 1N4007 Diode
                                     
                                     d. BC547 Transistors
                                    
                                     e. LED
 
4. Bulb with bulb holder (Wattage and type of bulb is of your choice)
 
5. 2 pin male plug
 
6. Wires
 
7. 12V adapter
 
8. Female DC jack
 
9. Plastic box

 

About PIR Sensor

 
Passive Infrared sensors basically measure the infrared light radiated by an object present in its field. All living creatures (and objects) with a temperature above absolute zero (which is 0 Kelvin or -273oC) emit heat energy in form of radiation. The PIR sensors are tuned in such a way that they detect only the radiation emitted by human beings.

To know more about how it works, go to this link: How PIR Sensor works

Here the sensor would help in detecting the human presence moving on the stairs.
 

Remember:

PIR sensor detects the motion of human body and not the human body itself so the triggering happens only when the body is moving and not at rest.

 

Sensitivity and High Time

Some PIR sensors come with two potentiometers used to adjust the sensitivity and duration of the high pulse once a motion is detected. Make sure  that both of them are set to high since we would require the PIR to be quick and also keep the light in ON state for a longer duration (Imagine the light going OFF midway before the person ascends/descends the stairs completely. You wouldn’t want that to happen, would you?)

 

About Relays

The switches at our home need to be operated manually by hand or “mechanically triggered” in order to work. If we need to control the switch using a microcontroller or electronic circuit, we would require extra mechanical arrangements like a servo with an arm, to press the switch. Instead of building such complicated arrangements we can go with a relay. These can directly be controlled by electrical means.

 

Working of Relay

The above shown diagram is of a SPDT (Single Pole Double Throw) Relay. It consists of 5 terminals. Two of them are from the coil where the input to drive the relay is supposed to be given. The other three are NO (Normally Open), NC (Normally Closed) and COM (Common).
 
When no input is given to the coil, there is no magnetic field produced. So the “NC” and “COM” terminals are connected and the “NO” terminal is left free.

When the input is given, the current flowing through the coil produces magnetic field (Basic physics) and thus attracting the lever, which breaks the connection between “COM” à “NC” and makes a connection between “COM” à “NO” terminals.

 

Free-wheeling diode

There is a problem in connecting a relay directly to an electronic circuit. When the input power is suddenly removed to switch OFF the relay, a voltage spike occurs due to the presence of the inductive load (The coil inside the relay is an inductor right?). This voltage spike can permanently damage the electronic circuit to which the relay is connected to. And thus we require a diode.
 
A diode connected in reverse bias with respect to the input supply, will prevent the voltage spike (produced by the relay when the supply is suddenly switched OFF) from reaching the other part of the control circuit.
 
 
Note: You can buy relay modules which come with the above required circuit as an in-built arrangement. This is what it looks like:
 
I couldn’t get a single relay module so I’m using a 2 Relay module which looks like this:
 
It consists of following features:
 
– LED indicator
 
– Free-wheeling diode
 
– Amplifying circuit
 
So all we need to do is connect the output of the PIR sensor to the module’s input.

Advantages of Relay

 
1. No degradation of the switched signal.
 
2. Offers isolation between the AC supply and the Circuit.
 
3. Lower impedance and easier to interface.
 
4. Robust.

Hardware Setup

First, let’s start with wiring the light. Choose a CFL or incandescent bulb of appropriate wattage. Gather all the parts shown in the image.

Image showing different components used in staircase lighting

Fig. 1: Image showing different components used in staircase lighting

Note: 2 pin male plugs will also do the job.

Connect one long wire and one short wire to the two terminals of the male plug.

Image showing wiring of a 3-pin plug

Fig. 2: Image showing wiring of a 3-pin plug

Image showing a 3-pin plug with neutral and live wire connections

Fig. 3: Image showing a 3-pin plug with neutral and live wire connections

Open the back cap of the bulb holder and connect other end of the long wire to one terminal of the bulb holder.

Image of a Bulb Holder

Fig. 4: Image of a Bulb Holder

Image showing wiring of bulb holder with 3-pin plug

Fig. 5: Image showing wiring of bulb holder with 3-pin plug

Connect another short wire to the other terminal of the bulb holder and close the bulb cap.

Image showing wiring of bulb holder

Fig. 6: Image showing wiring of bulb holder

Plug in the bulb and this is what you would have now.

Image showing complete wiring of staircase light

Fig. 7: Image showing complete wiring of staircase light

Note: The actual length of the wires depends on the distance between a) Plug point, b) Where you want the light to be put and c) Where the sensor is being placed at your home. Choose appropriately.

Now you are done with the AC part of the circuit. Arrange the remaining part as per the circuit diagram.
 
Next, connect the wires coming from the bulb holder and the plug to COMMON and NORMALLY OPEN terminals of the relay.

Image showing Relay Module used for automatic switching of staircase light

Fig. 8: Image showing Relay Module used for automatic switching of staircase light

Testing

Once you are done with testing on breadboard, start soldering on PCB.

Take some male headers and solder them onto a small PCB, followed by the wires coming from PIR sensor and the power supply wires.

Image showing male header soldered on a PCB to connect PIR Sensor

Fig. 9: Image showing male header soldered on a PCB to connect PIR Sensor

Image showing PIR Sensor connected to PCB Layout

Fig. 10: Image showing PIR Sensor connected to PCB Layout

Image showing wiring for power supply to the PIR sensor

Fig. 11: Image showing wiring for power supply to the PIR sensor

Find an appropriate enclosure to accommodate the PIR sensor and relay module. Remember that the PIR sensor’s lens should be out.

Image of box used to package PIR sensor and Relay Module

Fig. 12: Image of box used to package PIR sensor and Relay Module

Mark the area to be cut for letting out the sensor’s lens out of the box.

Image of box used to package PIR sensor and Relay Module

Fig. 13: Image showing marking by a pen on the box to make a cut-out for assembling PIR sensor

Try fitting it normally and if it doesn’t stay fit, use hot glue to stick the sensor.
 

Image showing PIR Sensor assembled on the box

Fig. 14: Image showing PIR Sensor assembled on the box

Place the relay module/ your own made relay circuit into the box and mark the place where it should be placed.

Image showing placement of Relay module inside the box

Fig. 15: Image showing placement of Relay module inside the box

Use nuts and bolts to fix the relay into the box. Then mark and cut the place where the screw terminals are visible. This is to let in the AC wires for connecting to the relay terminals.

Image showing Relay Module securely assembled inside the box

Fig. 16: Image showing Relay Module securely assembled inside the box

Image showing marking by a pen on the box to make a cut-out for connections with Relay Module

Fig. 17: Image showing marking by a pen on the box to make a cut-out for connections with Relay Module

Image showing cut-out made on the box for wire connections with the Relay Module

Fig. 18: Image showing cut-out made on the box for wire connections with the Relay Module

Also make a hole at the bottom (opposite to the relay board) to let out the DC power supply wire.

Image showing hole drilled for power supply in the box

Fig. 19: Image showing hole drilled for power supply in the box

Place everything inside the box neatly, connect all the wires and pull out the power supply wires through the hole.

Image showing complete wiring of PIR Sensor and Relay Module inside the box

Fig. 20: Image showing complete wiring of PIR Sensor and Relay Module inside the box

Solder the female DC jack to the power supply wires. Be very careful with the polarity.

Image showing female DC jack connected to PIR Sensor Module

Fig. 21: Image showing female DC jack connected to PIR Sensor Module

Now connect the AC wires to the relay terminals through the holes. Plug in the 12V adapter to the DC jack.

Image showing complete wiring of Staircase Light with PIR Sensor based Relay Driver Module

Fig. 22: Image showing complete wiring of Staircase Light with PIR Sensor based Relay Driver Module 

That’s it! You are ready with your device. Now place the device at a place such that the motion sensor gets triggered whenever someone ascend or descends the stairs.

For example, the staircase at my home is at right angle and so I placed the sensor and light near the bend so that the sensor covers maximum distance. Have a look at it:

Image showing installment of Staircase Light and PIR Sensor based Module on staircases of a house

Fig. 23: Image showing installment of Staircase Light and PIR Sensor based Module on staircases of a house

Project Source Code

###

//Program to 

###

 


Project Video

 


Filed Under: Electronic Projects
Tagged With: pir sensor
 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Electrical Lenght of Microstrip Transmission Lines
  • How to Draw/Display a BMP or PNG on 3.2" TFT Display with inbuilt ILI9341 IC
  • file edit
  • Making a ducted soldering fan?
  • 74HC595 creating Fake output

RSS Electro-Tech-Online.com Discussions

  • DIY bluetooth speaker
  • Turn CD4029 on/off with TTP223
  • Need a ducted soldering fan for solder smoke extraction
  • Question about ultrasonic mist maker
  • Power failure relay options
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering