Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Automatic light switch with night light function and smooth lighting control. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

The automatic lighting switch (hereinafter referred to as the device) is designed for automated control of lighting in a room. The principle of operation of the device is based on counting the number of people in the room. The maximum number of people that this device can register is 255 people, which is more than enough for practical purposes. The device is controlled by a single push button.

The device performs the following functions:

- When the first person enters the room, smoothly turns on the light to the set brightness level;
- When the last person leaves the room, smoothly turns off the light;
- The light sensor ensures that the lighting turns on only after dark (during the day the light does not turn on);
- When the button is pressed briefly (less than 1 s) with the lighting on, the light will go out smoothly after 10 s, when the lighting is off, the light will turn on smoothly;
- When the button is pressed for more than 1 s but not more than 3 s, it will switch the device to night light mode, when the last person leaves the room, the light will not turn off completely, and the brightness of the lamp will decrease to a certain minimum;
- If the button is held for a long time (more than 3 s), the device will switch to the mode of adjusting the brightness of the lamp. The brightness will cyclically decrease and increase (the button should be released at the moment of the desired brightness of the lamp).
The button is not active during the daytime.

All modes are indicated by a two-color LED:

  1. When there is sufficient light (during the day), the LED flickers red. This indicates that the device is in standby mode.
  2. When there is insufficient lighting (in the evening, at night), the LED glows green. This is the main operating mode.
  3. When switching to night light mode, the LED glows yellow.
  4. When the button is pressed briefly (light off mode), the LED lights up red, and after 10 seconds, when the light goes out, it lights up green again

In dimming mode, the LED lights up in the following combinations:

- when switching to the lighting brightness control mode, it flashes once in red, once in green;
- when exiting the brightness control mode - flashes green once, red once;
- in the mode of dimming the lighting, when the minimum brightness is reached, the LED lights up red for a short time, and when the maximum brightness is reached, it turns green.

To turn off the lighting when there are people in the room (for example, when you go to bed), you need to briefly (no more than 1 s) press and release the button. In this case, the LED will turn red and the device will enter the timer mode. After 10 seconds, the light will turn off smoothly, and the LED will turn green again, indicating the main operating mode of the device.

To switch to the night light mode, the button must be held for more than 1 s and released after the LED goes out. If at this moment you continue to hold the button, then after a couple of seconds the device will switch to the mode of adjusting the brightness of the lamp, which will be signaled by two LED flashes (1 red and 1 green), after which the brightness of the lamp will decrease or increase. The button should be released at the moment when the brightness reaches the desired level, after which the LED will again signal with two flashes (1 green and 1 red) and the device will switch to the main operating mode.

This device allows you to save not only electricity, but also extends the life of incandescent lamps, due to the fact that the lamps turn on smoothly, and not abruptly, as happens in most of these devices. This device does not cause interference on the network, because as a control element, it uses a field-effect transistor, and not a thyristor.

This device is developed on the basis of the ATMega8 microcontroller, which contributed to the low power consumption of the device itself and gives further prospects for upgrading the device by simply changing the program. The device has a galvanic isolation from the network, which increases its safety.

Principle of operation of the device

The principle of operation of the device is based on the intersection of an incoming or outgoing person with the IR rays of the motion direction sensor. When entering a room, a person first blocks one sensor, then another, and vice versa when leaving. At the same time, the controller counts the number of people entering and leaving the premises. The algorithm of the program takes into account various situations. For example, if a person, entering the room, blocked both sensors, and then, having changed his mind, went back, then the light in the room will not turn on. Those. in order for the controller to consider that one person has entered the room, the condition must be met (numbers correspond to blocked sensors, 0 - the sensor is not blocked): 0-1-12-2-0, and when leaving, 0-2-21-1 -0. This minimizes false positives 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. The IR LED is mounted on the opposite side of the box opposite the sensors so that it illuminates both sensors. It is desirable to cover the LED and sensors with darkened glass, "transparent" for IR radiation.

Automatic light switch with night light function and smooth dimming
(click to enlarge)

With an incandescent lamp power of up to 60 W, the field-effect transistor can not be installed on a radiator, with a higher power it must be installed on a radiator with an area of ​​​​about 25-30 sq. cm. With known good parts, the device starts working immediately. Trimmer resistor R13 adjust the illumination at which the lighting is turned on. Pin 23 of the microcontroller (DAY_OUT) is used to connect similar devices without a light sensor to it. Those. log 0 is set on this output during the day, and log 1 at night.

All questions and suggestions are accepted by e-mail: shemavr [dog] yandex.ru. Enter "Question" in the Subject field. To order a "stitched" microcontroller, send an application to the same mailbox with the subject "order" (controllers are sent so far only within Ukraine). We are looking for enterprises for cooperation (Ukraine).

The firmware of the microcontroller is presented with a demo version of the program: download.

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

Fuse programming: the following fuses should be programmed in the MK (reset to zero): BOOTSZ0, BOOTSZ1, CKOPT.

Author: Karavansky Alexander; Publication: cxem.net

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

The threat of space debris to the Earth's magnetic field 01.05.2024

More and more often we hear about an increase in the amount of space debris surrounding our planet. However, it is not only active satellites and spacecraft that contribute to this problem, but also debris from old missions. The growing number of satellites launched by companies like SpaceX creates not only opportunities for the development of the Internet, but also serious threats to space security. Experts are now turning their attention to the potential implications for the Earth's magnetic field. Dr. Jonathan McDowell of the Harvard-Smithsonian Center for Astrophysics emphasizes that companies are rapidly deploying satellite constellations, and the number of satellites could grow to 100 in the next decade. The rapid development of these cosmic armadas of satellites can lead to contamination of the Earth's plasma environment with dangerous debris and a threat to the stability of the magnetosphere. Metal debris from used rockets can disrupt the ionosphere and magnetosphere. Both of these systems play a key role in protecting the atmosphere and maintaining ... >>

Solidification of bulk substances 30.04.2024

There are quite a few mysteries in the world of science, and one of them is the strange behavior of bulk materials. They may behave like a solid but suddenly turn into a flowing liquid. This phenomenon has attracted the attention of many researchers, and we may finally be getting closer to solving this mystery. Imagine sand in an hourglass. It usually flows freely, but in some cases its particles begin to get stuck, turning from a liquid to a solid. This transition has important implications for many areas, from drug production to construction. Researchers from the USA have attempted to describe this phenomenon and come closer to understanding it. In the study, the scientists conducted simulations in the laboratory using data from bags of polystyrene beads. They found that the vibrations within these sets had specific frequencies, meaning that only certain types of vibrations could travel through the material. Received ... >>

Random news from the Archive

Sharks are less likely to attack people 15.02.2019

In 2018, 66 unprovoked shark attacks on humans were recorded worldwide, the lowest since 2008, when 55 attacks were recorded. Another 34 attacks last year were human-instigated, nine shark attacks on boats, and one attack on a diver in a public aquarium.

In terms of geography, 32 of the 66 unprovoked attacks in 2018 took place off the coast of the United States (half of them in Florida), another 20 in Australia, three each in Brazil and Egypt, two in South Africa, one each in Bahamas, Galapagos Islands, Costa Rica, New Caledonia, New Zealand and Thailand.

More than half of the victims (53%) were involved in surfing and related sports during the attack, 11% were diving, and another 30% were just swimming. On average, over the past ten years, shark incidents have killed six people a year worldwide.

The Florida Museum of Natural History has kept shark attack statistics in the International Shark Attack File for over 60 years. Over time, the number of attacks continues to grow. So, until the end of the 1980s, the number of attacks in a decade never exceeded 300, and during the 2010s it already exceeded 700. The peak year was 2015, when sharks attacked people for no apparent reason 98 times.

Other interesting news:

▪ xCORE-Audio sound processors

▪ Graffiti Wall Cleaner

▪ Artificial retina based on organic chips

▪ My own battery

▪ Coupe-crossover Lynk&Co 05+

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site The most important scientific discoveries. Article selection

▪ article Korolenko Vladimir Galaktionovich. Famous aphorisms

▪ article How the tsetse fly was exterminated on the island of Zanzibar? Detailed answer

▪ article Window decorator. Job description

▪ article Microwave field detector. Encyclopedia of radio electronics and electrical engineering

▪ article Strange funnel. Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024