Select your language

Automatic light switch (hereinafter the device is designed for automated control of lighting in the room. The principle of operation of the device is based on counting the number of people in the room. The maximum number of people, which registers the device - 255 people, which is more than enough for practical purposes. Device management is performed using a single button without fixation.

The device performs the following functions:

- At the entrance of the first man into the room smoothly turns on the light to the preset brightness level;
When the last person from the room seamlessly turns off the light;
Light sensor ensures that lighting is switched on only after dark (during the day light not included);
- Briefly press (less than 1) when the light, the light gradually turns off after 10 s, when you turn off the light, the light gradually turns on;
- When you click on the button for more than 1 but no more than 3 seconds will put the device icon in the notification area, at the exit of the last person from the room, the light turns off completely, and the brightness of the lamp is reduced to a minimum;
- Holding down the button (more than 3 seconds) the device will switch to the mode of regulating the brightness of the lamp. The brightness will cyclically decrease and increase (the button should be released at the time of the desired brightness of the lamp).
The button has no effect in the daytime.

All the modes are indicated using two-color LEDs:

  • With sufficient illumination (day) the led blinks in red. This indicates that the device is in standby mode.
  • In low light (evening, night), the led glows green. It is the primary operating mode.
  • When the mode led nightlight glows yellow.
  • Briefly press the button (the light is turned off), the led glows red and after 10 s, when the light is out again, lights green

    In the mode of regulating the brightness led lights in the following combinations:

    when the transition to the regime of dimming lighting - flashes once in red, once green;
    - when you exit the screen brightness control - flashes once green, once red;
    - in the mode of regulation of the brightness when the minimum brightness, the led briefly lights up red, and when it reaches maximum brightness green.

    To turn off lighting in areas where there are people (for example, when you go to sleep) need short-term (not more than 1 sec.) press and release the button. When this led will light red and the unit will enter the timer mode. 10 with the light gradually turns off and the led will become steady green to indicate that the primary mode of operation of the device.

    To switch to nightlight mode, the button you need to hold more than 1 sec. and release after the led turns off. If at this point to continue to hold the button, then after a few seconds the device will switch to the mode of regulating the brightness of the lamp, what will signal two flashes of the led (1 red and 1 green), then the brightness of the lamp will decrease or increase. The button should be released when the brightness reaches the desired level, after which the led will again show two flashes (1 green and 1 red) and the device goes back to its normal mode of operation.

    This device allows you to save not only electricity, but also extends the life of incandescent lamps, due to the fact that the lights turn on gradually, not abruptly, as in most such devices. This device does not create interference in the network, because the quality control is applied in this field-effect transistor, instead of the thyristor.

    This device is designed based on microcontroller ATMega8, which contributed to the small energy consumption of the device itself and gives future prospects for upgrading the device by simply changing the program. The device has a galvanic separation from the network, which increases its security.

    The principle of operation of the device

    The principle of operation of the device based on crossing going in or out person infrared rays sensor. Upon entering the room the person will override the first one sensor, then the other, but Vice versa. Wherein the controller counts the number of people that entered and exited from the room. In the algorithm of the program included a variety of situations. For example, if people enter a room, blocked both the sensor, and then changed his mind, came back out, the light in the room turns on. I.e. to ensure that the controller felt that I entered the room, one person must satisfy the condition (the numbers correspond to the overlapped sensors, 0 - the sensor is not blocked): 0-1-12-2-0, and when 0-2-21-1-0. This minimizes false triggering of the device.

    The sensors are assembled on the basis of TSOP1736, and are mounted in the door frame at a height of 70-80 cm from the floor at a distance of 3-4 cm from each other. IR led mounted on the opposite side of the box opposite the sensors so that it covered both sensors. Preferably, the led and sensors to cover tinted glass, which are transparent for infrared radiation.

    (click to enlarge)

    With the power of incandescent bulbs up to 60 watts MOSFET can not be installed on a heatsink, with more power it should be installed on the radiator with an area of about 25-30 sq. cm With known-good parts, the device begins to work immediately. A trimming resistor R13 set the illumination at which the lights are on. The output 23 of the microcontroller (DAY_OUT) is used to connect to similar devices without the light sensor. Ie concluded this day set log 0, and at night - the log 1.

    All questions and requests are accepted by e-mail: shemavr [dog] yandex.ru. In the Subject field to indicate "Question". To order "stitched" microcontroller application directed to the same Inbox with the subject "order" (the controllers are sent while only in Ukraine). Looking for companies for cooperation (Ukraine).

    Microcontroller firmware presented with the demo version: download.

    In the demo version some limitations on the operation of the device, namely:
    - number of people registered by the device is limited to two;
    - turned off the day, i.e. the light will turn on during the day;
    - to adjust the brightness of the lights can only be on 1/4 of the maximum.
    In the working version of the program, these restrictions are removed.

    Programming the fuse bits: the MC should program the following fuse bits (reset to zero) : BOOTSZ0, BOOTSZ1, CKOPT.

    Author: Karavan Alexander; Publication: www.cxem.net