Building lighting automatic control systems. Overview of the system for automatically turning on the light in the house

Every year, automotive technology develops more and more. About a decade ago, laser headlights were considered more science fiction than car parts. And today some production cars are equipped with them ... Progress is moving around the planet by leaps and bounds. Surely, in a couple of years, a full-fledged autopilot function will appear on cars, and then the driver will be able to do his own business while driving, without being distracted by himself ...

Automatic dipped beam is very useful feature allowing less distraction for the driver

But until this happens, let's look at the systems that already make life easier for many motorists today. And most importantly - we will find out how we can on our own, if he is deprived of them.

light sensor on car

Let's start with the light sensor. This device provides automatic switching on and off of the dipped and main beam headlights and parking lights, and is also able to regulate . More recently, only cars in the most expensive versions, costing more than a million rubles, were equipped with them. But today, a similar option can be found on more affordable models. But most importantly, this system can be independently installed on almost any car model.

Advantages and disadvantages

Of course, this option has both ardent supporters and opponents. By law, you are required to turn on your dipped headlights at any time of the day if your car is not equipped. But often many drivers forget about it. And they drive without any employees at all lighting fixtures. It is for such forgetful motorists that it will be extremely useful to have a sensor in their arsenal. automatic start low beam headlights.

But there is another side of the coin. you need to be careful, as there are places with variable illumination on the road, in which the sensor can behave inappropriately and leave you without light at the most inopportune moment, which can lead to an accident.

How to install a light sensor in your car

There are many ways to equip your car with this device. But it is worth noting that if you feel insecure in matters of automotive electronics, then it is better to entrust the installation of the system to professionals. Illiterate intervention in the automotive lighting system can cause considerable problems and costs.

In addition to ready-made solutions that are produced by various companies and enterprises, there are many "handicraft" developments that differ from each other in the principles of operation and the complexity of the device. If your hands grow from where they should be, you can independently solder the circuit you need and.

For everyone else, and we are the majority, we will consider ready-made options, which are offered by brands such as Quantoom, Premier, Giordon. They are so-called advanced systems that can save the driver from having to manually adjust the light on the car when lighting conditions change. A typical light sensor set consists of a relay, a control unit, a switch, and wires. The undoubted advantages of such systems are durability, economy and the choice of manual or automatic switching mode.

Mounting such devices is quite simple. Everything is done according to the attached instructions. It is worth noting that the “peephole” of the sensor, which is advised to be placed on the mirror, must be directed inside the cabin, otherwise it may incorrectly assess the situation. All wires are also connected strictly according to the instructions.

Light sensor failure

As a rule, such devices rarely break by themselves. Provided that you opted for a quality product from a well-known brand. not worth saving. The cause of breakdowns is usually a factory defect, illiterate installation or improper use. It often happens that it takes many hours to find a malfunction, and the repair itself takes a matter of minutes.

No one is immune from breakdowns. But it is still better to prefer a more expensive and proven option to a cheap "home-made" device. No matter how tempting the offer may be.

Many manufacturers indicate some restrictions for their products, so you. As a rule, these are standard precautions: make sure that moisture does not get inside the device elements, protect them from mechanical and other influences. Also, sometimes there are recommendations not to use gas discharge lamps on cars.

Additional features

Many systems are paired with a rain sensor. Working together, these devices complement each other and significantly increase the overall performance. We will talk about what a rain sensor is and how it works in the next article.

Video on how to set the automatic low beam headlights:

But remember the main thing - no matter what options your car is equipped with, You should always be extremely careful while driving. The road is not the place to joke. And while cars are not equipped with automatic piloting systems, concentrate all your attention on the driving process and control the situation on the road.

P.S. What do you think about the use of light sensors on the car? Do you really need them? Write in the comments, it is important for us to know your opinion!

March 12, 2014 at 09:47

My implementation of automatic switching on the light in the toilet (and without Arduino)

  • DIY or DIY

Hello!
Articles about the implementation of the Smart Home appear and appear on Habré. most main problem(well, or just for me) turns on / off the light in the bathroom. It seems that the thing is not tricky - but how many options there are. After reading articles, including, and, I thought, "But everything could be easier."

This worm sharpened me for about six months. And so, when it became freer with work, I matured.
I will say that I like to do both programming and radio engineering since school. Microcontrollers gave real joy - all at once. And the Arduino is not here, not because I hate it, it is redundant for this task, or because I want to be different from everyone else, I just haven’t got to it yet (or it to me).
Let's go back to our sheep (well, either to our light, or to our toilet). For me personally, drawing a technical specification in my head (yes, drawing it, when you still can’t even formulate it, let alone write it down on paper) is much more difficult than implementing it later. After weeks of thinking, this is what I ended up with:

  • the light should turn on when I open the door (I go in for example);
  • the light should turn on when I close the door (I went into the bathroom with open door and closed it behind him)
  • the light should turn on when I go in without touching the door (I looked in to wash my hands);
  • auto turn off the light after a certain time;
  • the light should not turn off when I'm inside and don't even move.
It seems like everything is logical and simple, but I did not find a beautiful solution in any of the articles I came across. The simplest is a motion sensor. It turns on the light when someone is there and turns it off after a while. For my purposes, he lacks only a reed switch in a couple - to keep track of whether the door is open or closed.
I don't understand why manufacturers haven't gotten around to this yet. Or have they reached, but not reached me?
The algorithm is simple:
  • if the motion sensor is triggered, turn on the light;
  • if the state of the reed switch has changed (the door opened/closed) - turn on the light;
  • if the motion sensor is triggered closed door(reed switch closed) - do not turn off the light until the door is opened;
  • Well, turn off the light after a while.
Now the TK is clear, I need:
  • Motion Sensor;
  • reed switch;
  • MK to manage this mess.
The cheapest DD (infrared), some kind of reed switch, ATTiny2313, was bought.

We disassemble the motion sensor, we see inside:


control board with infrared receiver and mirror in the middle and:


PSU and relay. I was lucky, the DD has everything you need: a relay, a transistor for matching, the rest of the harness (even a diode). When the sensor is triggered, a TTL signal is generated, it is enough to intercept it, and transmit the signal from my MK instead.
I drew a diagram in ISIS (if done, it’s beautiful)

Scheme


in BASCOM-AVR wrote the following program:

The code

$regfile = "attiny2313.dat"
$crystal = 4000000
$hwstack = 40
$swstack = 16
$framesize = 32

Config Port = Output
Config Portb = Output
Config Portd = Output
ConfigPortd.2 = Input
ConfigPortd.3 = Input
Config Int0 = Rising
Config Int1 = Change
Enable Interrupts
Enable Int0
Enable Int1
Config Debounce = 300
On Int0 Dd
On Int1 Gerkon
Dim Timecount As Integer
Dim Timelock As Bit

timecount = 0
timelock = 0
Portb.0 = 0
Portb.1 = 0

Do
If Timecount< 200 Then
Portb.0 = 1
Else
Portb.0 = 0
End if
If TimeLock = 0 Then
timecount = timecount + 1
End if
If Timecount > 250 Then
timecount = 250
End if
Waitms 100
loop

Dd:
Disable Interrupts
timecount = 0
If Pind.3 = 1 Then
timelock = 1
End if
Enable Interrupts
return

Gercon:
Disable Interrupts
timecount = 0
If Pind.4 = 0 Then
timelock = 0
End if
Enable Interrupts
return


I made an emulation, it seems like everything works (after debugging, of course). I assembled the layout and checked it (assembling such layouts is not so difficult, the main thing is to start):


We cut roads in DD and connect according to the inflamed imagination of the circuit diagram:


Checked - earned. Automatic shutdown after about 1 min 20 sec (not for some reason, it just happened right away, but it suited me), the rest of the work is according to a pre-thought-out logic.
I'll make a digression here. The fact is that I have been soldering since the days when the MP39 and MP42 transistors were in use. Much has been soldered and written. When the scheme I have developed (and even more so the program) starts working the first time, I feel discomfort, it rarely happens to me. A couple of hours were killed for testing, I did not find any bugs, it continued to work.
Assembled into a working version (LUT was not useful):

With the help of adhesive tape and someone's mother, I insulated all this and fixed it in the case. As a result, the resulting copy does not differ externally from the original one, even the connection diagram has not changed (except that a couple of wires for the reed switch have been added):

The main thing is to check the performance after each step, we swam - we know.
I'll skip the installation and other platitudes.
The wife took it without enthusiasm and called it "garbage" (nonsense, she will appreciate it - but where should she go).
Budget:
- DD - 250 rubles. (can't find cheaper)
- reed switch - 38 rubles,
- ATTiny2313 - 140 rubles. (The price is horse, but you still wanted it yesterday).

Behind constructive criticism thanks in advance.

In order to facilitate the work of a person and to save electricity, again because of the forgetfulness of a person, all kinds of automatic machines are used in practice. In particular circuit breakers outdoor lighting. At the heart of their work, photo optics and comparators are used to reduce the cost of the circuit. The disadvantages are obvious: the photodetector must be installed in a certain place, protected from natural precipitation, dust and extraneous light. Because of this, it is necessary to place the device in adverse conditions (outdoors) and carefully seal and insulate, invent protection from extraneous light and protect the photodetector. This device automatic lighting control is devoid of these shortcomings. It can be placed directly in the electrical panel next to the contactor (magnetic starter, switch). Power is supplied from the same network. The operation of the device is based on the mathematical calculation of astronomical phenomena, such as sunrise and sunset. In the book of J. Meeus "Astronomical formulas for calculators" (M., "Mir" 1988), very precise formulas for astronomical calculations were published. In 1989, O. Montenbrook and T. Pfleger in the book "Astronomy with a Personal Computer" laid out the basics of using mathematical formulas for machine languages high level Pascal and C.

Scheme of the module for automatic control of external lighting

What is a modern controller is a microcomputer. Why not apply this research to AVR microcontrollers. The choice fell on Atmega8 due to relative cheapness. Thanks to help yuriji from the site kazus.ru managed to return to Atmega8. A familiar programmer helped shorten and optimize the code. Suggested the idea of ​​a compact menu. As a result, the code occupied 97.3% of the memory of the MK. Due to the lack of a cheap indicator, a more expensive one was used. WH1602D firms winstar, Russified. If you use another LCD, you only need to include a standard file from the CodeVisionAVR library #include . Another forum member daddy just strongly recommended to use watch quartz, then supported it and yuriji and after it turned out that with quartz the clock error is 6 seconds per day, the program was slightly corrected. It should be noted that this did not lead to a change in the design of the printed circuit board, but led to a decrease in the current consumption, since the frequency of the microcontroller was lowered to 1 MHz from the internal RC generator. In order to reduce the cost of the product in the future, it was decided to make the indication on a four-digit LED indicator. All the necessary files and the drawing of the board in the proteus are in the archive.

First, we print the printed circuit board pattern on the substrate from decorative film"Racal" straight from the program Proteus via laser printer and transfer the pattern to the foil fiberglass using an iron.


Due to the fact that I was in a hurry, I spoiled the drawing a little. I had to correct it with zapon varnish. Further, as usual - we poison in ferric chloride.


We solder the radio components to printed circuit board. The board of the automatic lighting control device is assembled without batteries from industrial network 220 volt.


Download the source and open it in the program CodeVisionAVR. If you have a demo version - do not try to compile the program again (there are restrictions on the size of the code). In the figure, the combination fuse for the timer variant with watch quartz.


To program the MK, I used a USB programmer PROTTOSS Laboratory- AVR910 USB Programmer


After flashing the device, a welcome screen will appear. We press the "OK" button. Let's move on to setting the latitude. Values ​​can be added (subtracted) using the buttons " + " and " - ". After setting the desired value, proceed with the "OK" button to the setting next parameter etc. Upon completion of the settings, the program will switch to the operating mode.

This is only part of the path traveled, first RTC on PC8573, then without RTC at all, or rather, its own in MK. Was on LCD, and then on LED. At first, the lighting turned on/off at sunset/sunrise, but it is more comfortable in civil twilight. When there was a transfer to summer / winter time in Russia, the time transfer function was added on the last Sunday of October and March, etc. Sincerely, specially for the site radio circuits , Yu.Gradov.

Discuss the article AUTOMATIC LIGHTING CONTROL

With recent rule changes traffic on the territory of the Russian Federation, the driver is obliged to turn on the dipped headlights both when driving in the dark and during the daytime. Otherwise, the traffic police have the right to fine the driver.

Although the amount of the fine is not the largest, the very fact that a car can be detained for violating traffic rules, after which the driver will be fined a certain amount for such an offense, is unacceptable for most responsible motorists for a number of reasons.

Naturally, in the current situation, many car owners are faced with the fact that the human factor in practice turned out to be main reason, according to which a car without the lights on is stopped and fined. In simple words, often drivers simply forget to turn on the headlights.

To avoid such mistakes, the best option is to turn on the dipped beam when the engine is started, that is, automatically. However, not all vehicles have a similar function, which is implemented regularly. In this article, we will look at how to modify the car so that the headlights turn on at the same time as starting.

Read in this article

Automatic headlights: scheme, available options, advantages

It is quite logical that it is the automatic switching on of the dipped beam that is the very option that allows you not to be afraid of a situation when the driver forgot to turn on the light before the trip. At the same time, many imported cars have an automatic switch-on device, but it is triggered only under certain conditions (changes in lighting, a signal from a rain sensor, etc.)

However, according to traffic rules in the Russian Federation, the light must be turned on all the time, regardless of whether it is dark or light outside. Some owners, in order not to forget to turn on the light, are forced to leave the car in the parking lot with the headlights on during daylight hours, thereby.

As you can see, the problem is very relevant. To solve the problem, the most rational way out of this situation is such a system for automatically turning on the low beam, which will work regardless of the degree of illumination and other conditions, and also work without the participation of the driver.

In other words, the headlights should turn on in parallel with the start of the internal combustion engine. You can also implement turning off the light after the engine is turned off. By the way, for cars that do not even have a standard light sensor (domestic cars, old or budget new foreign cars), which is triggered in the event of a change in illumination, the always-on dipped beam will increase safety when driving through tunnels, under bridges, etc.

So, the demand for such systems led to the fact that various enterprises that specialize in the production of electrical equipment began to manufacture turnkey solutions for cars (for example, Skybrake M5, AvtoSvet AS, Pharaoh, etc.) You can also note and a large number of circuits and devices that enthusiasts and experienced motorists create on their own.

If the desire to put on the car homemade devices no, then the factory solutions will be the best option. However, the functionality may be somewhat limited. The main thing is that both in the first and in the second case, such solutions make it possible to implement automatic switching on of the headlights, the light turns on synchronously at the moment the ignition is turned on or the engine is started.

At the same time, we note again that different schemes differ in functionality. For example, you can make it so that only headlights are on during the day, and dimensions are connected at night, etc.

Schemes for automatically switching on headlights when starting the engine

Let's look at some of the most popular solutions. The main task for auto-turning on the headlights is to supply power to it. This power can be taken from the ignition. However, it should be remembered that there are often other devices in the car that are powered by the ignition switch. This can be difficult.

For example, if the radio turns on after the first turn of the key in the lock, the headlights can also work at that very moment. These aspects need to be taken into account separately. It turns out that the engine is turned off, and the low beam is already on.

To avoid such nuances, such a scheme is considered optimal, by means of which the supply occurs through the button (relay) at the moment of closing contact group in the ignition lock when starting the engine. Turning off the headlights, respectively, will occur when the circuit is opened and the engine stops.

Note that many drivers believe that such a scheme leads to the fact that the load on the electrical circuit increases. In practice, a properly executed connection minimizes or eliminates such loads.

To implement the automatic switching on of lighting devices according to the simplest scheme with your own hands, you need to purchase:

  • standard relay (five-pin),
  • wiring and diodes;

More complex and at the same time more convenient is the scheme when, in simple terms, the headlights are powered by the parking brake or oil pressure sensor. For the successful implementation of such a solution, you will need to have 2 transistors, wiring, a relay and a K561TP1 chip or similar.

Let's start with the first diagram. When installing the best way the button to turn off the stove, which is located on the switch block, is suitable. All work boils down to removing the size switch, then the “+” wire and the key block are disconnected, through which the dipped headlights are switched on.

The connection itself is made using double wire which connects to the relay. In the “+” wire, which goes to the stove switch, another wire is inserted, which is also connected to the relay. Next, a wire is pulled to the relay, through which power is supplied to the headlights themselves. Another ground wire is thrown at the body. This completes the connection.

It remains only to either solder all the connections, or carefully insulate all the "twisting". The result is a system for turning on the dipped beam at the moment the ignition is turned on.

The disadvantages include the fact that winter period the load on the battery at the time of starting will be higher, the car will warm up with the headlights on and consume additional fuel, etc.

  • To get rid of the shortcomings, you can use the following scheme. Improvements will make it possible to turn off the light after the vehicle stops, and regardless of the inclusion of the ignition itself. To do this, the connection is made to the parking brake or to. As mentioned above, it is based on a microcircuit, and the connection is made through a “handbrake” or an oil pressure sensor.

In the case of the sensor, after turning off the internal combustion engine, the pressure drops. This leads to the fact that the contacts of the oil pressure sensor open, the capacitor is energized, the voltage goes through the transistors to the relay and the headlights turn off.

Also, after stopping the internal combustion engine, power from the sensor is supplied to the diode lamp, which is installed on the instrument panel. Also, the capacitor in the headlight control circuit will begin to discharge and the relay will not be energized.

Although this scheme allows you to "bypass" the ignition switch, it is also not without some disadvantages. If the pressure in the lubrication system is “floating” or decreasing, the sensor may be triggered when driving in neutral or idling. In this case, the headlights will blink.

We also add that the headlights can be turned on both automatically and manually. This opportunity is implemented by creating a parallel connection and choosing the desired resistance on the chip itself. By the way, the decision to connect to an oil pressure sensor is not popular, since the circuit is complex, additional wiring is needed, and the requirements for the quality of connections are increasing.

  • It is easier to implement the connection to the parking brake. To do this, you need to add an additional relay to the general list of parts, which is powered by the parking brake button.

This method allows you to achieve the following:

  1. as soon as the driver starts to raise the handbrake, the headlights turn off;
  2. if you start lowering the handbrake, the headlights turn on immediately;

As you can see, self-made solutions can have more advantages than regular ones. Functionality is also expanding, the cost is often more attractive. In other words, it is quite possible to assemble an inexpensive circuit for automatically turning on the dipped headlights.

It is important to understand that in order to assemble a circuit with your own hands, you need certain experience and skills. If you are not confident in your abilities, it is better to seek the help of a professional auto electrician. If the work is carried out independently, the tie-in points are optimally located in the interior space, and not under the hood. This approach will avoid contact oxidation, reduce the risk of moisture and short circuit etc.

If we talk about what is better, soldering or twisting wires, a correctly made twist in some cases will be better than soldering in relation to a car. The fact is that the vehicle is subject to various vibrations, and soldering is less resistant to vibration loads.

As for relays, wires, fuses, etc., the relay must be securely fastened, the wiring must be laid so that the wires do not lie in the "tightness". In places where the wires are bent and at the points where the wire touches the metal parts of the body, additional insulating heat shrinkage must be present. Otherwise, the wire may fray and begin to close.

It is also strongly not recommended to use ordinary jumpers instead of relays, connect bypassing fuses, etc. Ignoring these recommendations can not only cause equipment problems, but also short circuits or fires.

Read also

How does the engine start button work? Available Options and solutions for self installation starter buttons. How to install the engine start button yourself.

  • Why does the head unit (radio) turn off in the car when the engine is started. The main reasons for turning off the car radio, possible malfunctions.


  • Rest in a house outside the city becomes comfortable and brings pleasure only when the tasks of maintaining the house and the plot are minimized. Often, the owners are forced to irrigate the plantings, control the provision of ventilation and heating at home, turn on the lighting of the site, etc. Of course, such a "vacation" was standard for our grandparents, but today there are completely different times and standards of life, which increasingly exclude the transformation of staying outside the city into work that takes a lot of time and effort.

    This much-needed functionality today can be completely delegated, and not to hired workers, but to modern multifunctional modular electrical equipment that allows you to perform all processes on suburban area in automatic mode, i.e. without human intervention. Its installation is quick and easy in already existing systems power supply and thus eliminates the need for complex repairs.

    There can be many processes, but in this article we will focus on automatic switching on after dark of street lighting.

    Although there are many simple ways turning on street lighting, it is difficult to argue with the fact that it is much more convenient when the lighting is turned on and off without human intervention at all, i.e. in automatic mode.

    Contemporary modular equipment allows not only programming for the timely inclusion of equipment, but also creating different combinations light zones (say, at one time the illumination of several lawns will turn on, a little later - the lamps on the remaining lawns and near the entrance).

    The issue of turning on the lighting in automatic mode becomes especially relevant in the autumn and winter months, when the sun sets very early and the owners of suburban real estate are forced to return home after dark.

    There are many devices on the market today that allow you to solve the problem of switching on lighting in automatic mode. So, if it is necessary to light street lamps after dark, it is best to use twilight relays (photorelay). In the evening, if the light level drops below a certain level, the relay will work and the lighting will turn on.

    Lamps that are installed for safety purposes near gates, garage doors or the entrance to the house can be connected through Motion Sensor. For these purposes, it is most often used to detect the presence and movement of a person in its area of ​​​​action. When installing motion sensors, you need to choose the correct location for it, taking into account its sensitivity.

    To solve an important control problem street lighting you can choose to astronomical relay.

    To organize lighting at the entrance to the house or the entrance to the site, you can opt for time relay with off-delay function. Such a device is controlled from a push-button switch and turns off through set time load (lamps in the yard or in the garden).

    The delay time for switching on the load is set on the front panel of the relay, and can be adjusted depending on the device. In some time relays (timers), it is possible to program not only the time intervals for turning on and off the outdoor lighting, but also to distribute them by day of the week.

    Very interesting and useful effects can be obtained by combining Various types lighting control devices. So, for example, a motion sensor can be connected together with a timer. Thanks to this, it is possible to make it so that 2 20 W bulbs turn on automatically according to the timer, and when a person approaches, the motion sensor is triggered and 2 100 W bulbs turn on.

    A huge number of possibilities for controlling outdoor lighting can be obtained using equipment for building systems home automation ( , etc.) . Modern technologies and help you create the most comfortable and convenient schemes outdoor lighting control that suits your level of cost and complexity.

    All devices listed in the article - photo relays, timers, motion sensors can be integrated into one system that can be controlled using a remote control remote control or fully automatic. More details about the possibilities of controlling street lighting and spotlights using the X10 home automation system will be discussed in the following articles.

    What else to read