ElectricianExp.com
Back

Homemade motion sensors to turn on lights

Published: February 11, 2021
2
6233

The motion sensor can be purchased in the store. But if you have some free time, a little skills and knowledge, such a sensor can be made by yourself. It will save some finances and provide a pleasant pastime for technical creativity.

What kind of sensor you can make yourself

There are several types of motion sensors, and each type can, in principle, be made by yourself. But ultrasonic and radiofrequency sensors are difficult to make, require special skills and devices for adjustment. Therefore it is easier to make sensors of capacitive and infrared type.

Tools and materials

To make a motion detector will require:

  • soldering iron and consumables;
  • connecting wires;
  • Small locksmith's tools;
  • multimeter.

You will also need a breadboard for making the sensor. And it's also a good idea to have an oscilloscope to monitor the performance of the device based on the RF generator.

Capacitive sensor

These sensors react to changes in electrical capacitance. The misnomer "volumetric transducer" is often used on the Internet, in the home, and even in technical documentation. This notion arose because of the incorrect association between geometric capacitance and volume. In fact, the sensor responds to the electrical capacitance of the space. Volume, as a geometric parameter, plays no role here.

Homemade motion sensors for switching on the light
The sensor circuit on a single chip.

The motion sensor is realistic to make with your own hands. A simple capacitive relay can be assembled on just one chip. To build the sensor a Schmitt trigger K561TL1 is used. The antenna is a wire or pin several tens of centimeters long, or other conductive structure of similar dimensions (metal mesh, etc.). When a person approaches, the capacitance between the pin and the floor increases, and the voltage on the pins 1,2 of the chip increases. When the threshold is reached, the trigger "flips out", the transistor through the buffer element D1/2 opens and supplies power to the load. It can be a low-voltage relay.

The disadvantage of such simple sensors is insufficient sensitivity. For its activation, a person must be at a distance of a few tens or even a few centimeters from the antenna. Circuits with HF generator are more sensitive, but they are more complicated. Winding parts can also be a problem. In most cases, you will have to make them yourself.

Home-made Trigger Sensors for Lighting
Detector circuit based on an HF oscillator.

The advantage of this circuit is the ability to use a ready-made transformer from the CT1-A transistor receiver. It is part of the generator circuit (inductive "three-point") on the transistor VT1. Using resistor R1 adjust the depth of feedback, achieving the appearance of oscillations. The oscillations in the generator are transformed into winding III, rectified by diode VD1. The rectified voltage opens transistor VT2, it supplies a positive potential to the control electrode of the thyristor. The thyristor, when opened, powers the relay K1, the contacts of which can be used to connect the alarm system.

The antenna is a piece of wire about 0.5 meter long. When a person approaches (at a distance of 1.5-2 meters), the capacitance, introduced by his body into the circuit of the generator, disrupts the oscillations. Voltage on the winding III disappears, the transistor closes, the thyristor turns off, the relay is de-energized.

Read also

Design and principle of operation of motion detectors

 

Assembly of the detector

A printed circuit board can be made to assemble a homemade detector. For example, using the LUT method. The technology is not complicated, it is easy to master. But if making a sensor is a one-time thing, there is no point in wasting time on experiments. The best solution is to use a breadboard.

Makeshift Light On Motion Sensors
A breadboard mounting plate.

This is a board with metalized holes with a standard pitch, into which you can solder electronic components. The connection to the circuit is made by soldering the conductors to the corresponding points.

Makeshift Light On Motion Sensors
Connections on the breadboard.

You can also use a breadboard, but the reliability of the connections is much lower. This is a better option for experimenting and honing the art of circuitry.

Checking the health of the electronic components

First of all it is necessary to examine the selected parts. If they have not been used, there are no traces of soldering and no mechanical damage, then the further check does not make much sense. There is a 99 percent chance that the components are serviceable.. Otherwise, it is a good idea to check the components:

  • resistors are tested with a multimeter - it should show the nominal resistance (taking into account the accuracy class of the resistor);
  • winding parts are tested for the absence of breaks;
  • capacitors of small capacity can be checked with a tester only for the absence of short circuit;
  • High-capacitance capacitors can be checked with an arrow multimeter in resistance test mode - the arrow should jerk to the right and then slowly return to zero (to the left);
  • diodes can be checked with a tester in the diode check mode - in one position the resistance should be infinite, in the other position the multimeter will show some value (depending on the type of diode);
  • bipolar transistors are tested in the same mode as two diodes - between base and collector and between base and emitter.
Makeshift Light On Motion Sensors
Equivalent circuit of bipolar transistor test.

Important! Field-effect transistors with p-n junction (KP305 etc.) are tested in the same way (gate-source, gate-source), but between the drain and source the multimeter will show some resistance (for bipolar - infinity).

Microcircuits cannot be checked with a multimeter.

Marking and cutting the board

Next you have to place all the components on the board to optimize the future connections. To do this, you have to place them in one corner or near one side. Then draw lines, remove the elements and cut off the excess. It is possible not to do this, but then the board will take more space and will require a larger case (and you will need it if the detector will be installed outdoors).

Makeshift Light On Motion Sensors
Placing and marking the elements.

The edges of the board must be filed. It will not affect the performance, but it looks better.

Makeshift Light On Motion Sensors
An edge that is not filed does work, but looks bad.

Then the parts are inserted back, soldered into the holes and connected with wires according to the schematic.

The video shows how to make a motion sensor to turn on the light from an arduino module.

Infrared sensor and arduino

It is possible to make a good motion sensor on the Arduino platform. The electronic "builder" includes a PIR sensor module HC-SR501. It includes an infrared detector that reacts remotely to temperature changes, with a controller.

Makeshift Light On Motion Sensors
Arduino infrared sensor controller.

The module is fully compatible with the main board and connects to it with three wires.

Makeshift Light On Motion Sensors
Connection of the detector to the board.
IR module outputGNDVCCOUT
Arduino Uno board outputGND+5 V2

To make the system work, you have to load the following sketch into the Arduino:

Home-made motion sensors to turn on the lights
The sketch to control the IR sensor.

First you set the constants that determine the pin assignment of the main board:

const int IRPin=2

The constant IRPin means the pin number for the input from the sensor, it is assigned a value of 2.

const int OUTpin=3

The OUTpin constant signifies the pin number for the output to the executive relay, it has the value 3.

The void setup() section is set:

  • Serial.begin(9600) - exchange rate with computer;
  • pinMode(IRPin, INPUT) - pin 2 is assigned as input;
  • pinMode(OUTpin, OUTPUT) - pin 3 is assigned as the output.

In the void loop section the constant val constant is assigned to the value of the input from the sensor (zero or one). Then, depending on the value of the constant, high or low level appears on the output 3.

Functionality check and adjustment of the sensors

Before switching on the assembled sensor for the first time, the assembly must be checked carefully. If no errors are found, you can apply voltage. Within a few seconds after turning on the power it should be checked that there is no local overheating and smoke. If the "smog test" is passed, you can check the sensors for proper operation. Schmitt triggers and Arduino sensors do not require adjustment. It is only necessary to simulate the presence of the object near the sensor (bringing a hand) and monitor the change in the signal output. The detector based on HF generator requires setting the moment of beginning of oscillation with potentiometer P1. You can control the onset of oscillations with an oscilloscope or by a click of a relay.

Read also

Diagram for connecting a motion sensor to an LED spotlight

 

Connecting the load

If the sensor is functional, you can connect a load to it. It can be the input of another electronic device (a buzzer), but often the detector is required to control the lighting. The problem is that the load capacity of the output of the homemade sensor does not allow you to connect even low-power lights directly. Therefore you will definitely need an intermediate switch in the form of a relay.

Makeshift Light On Motion Sensors
Connecting the sensor through a repeater relay.

Before you connect the starter, you must make sure that the contacts of the sensor output relay allow switching voltage of 220 volts. Otherwise you will have to put an additional relay.

Makeshift Light On Motion Sensors
Connecting the Arduino via a transistor switch, an intermediate relay and a repeater relay.

The output of the Arduino is so low-power that it can't drive a relay or a starter directly. You will need an additional relay with a transistor switch.

If all the assembly and adjustment steps went well, you can install the sensor permanently, make the final connection and enjoy the clearly working automatics.

Comments:
  • Andrew
    Reply to the post

    I'm not sure I can do it, I like making things, but it's not that easy, but I'll give it a try for sure!

  • Alexander
    Reply to the post

    What is the ST-1A radio receiver. I can`t find anything on it. I need the coil's coil data.

Tips for reading

How to repair LED light fixture with your own hands