Internet Windows Android

Dynamic turn signals - we make running lights from the KIT set. How to make do-it-yourself dynamic turn signals (stacked) from a KIT DIY kit with AliExpress Diy dynamic turn signals diagrams

Or garlands, etc.

Once I ordered a KIT DIY kit from AliExpress - running lights on LEDs (). I was attracted by the ridiculous price of 63 rubles and the opportunity to practice soldering SMD radio elements.



This kit consists of a 20x55mm printed circuit board and, accordingly, a set of necessary radio components. The board indicates the installation locations of all components and their ratings, so there are no particular difficulties with installation.

The entire manufacturing process and the operation of the circuit can be seen in the video:

List of tools and materials
- a set of running lights on the CD4017 or K561IE8 microcircuit ();
-screwdriver;
- scissors;
-soldering iron;
-cambric;
- rechargeable cell phone battery;
-power supply unit for 12V;
-connecting wires;
- foil-plated textolite for a printed circuit board;
- microcircuits К561ТМ2;
-resistors;
- transistors KT815 (or analogs);
-LEDs.

Step one. Wiring the PCB of the kit from AliExpress.

All you need to do is solder the kit components to the board. In view of the miniature size of SMD radioelements, I used a "third hand" with a magnifying glass. First, I soldered resistors, capacitors and other circuit components except microcircuits. At the end, we solder the microcircuits and LEDs.

This circuit works from 3 to 15V. The pulse generator is assembled on a NE555 microcircuit, then the pulses are fed to a decimal counter with a decoder - microcircuit CD4017 (K561IE8), to ten outputs of which LEDs are connected through current-limiting resistors. The switching speed of the running lights is regulated by a trimmer.

Constructor diagram.


The circuit worked for me when I turned it on for the first time.

Step two... Modernization of the scheme of running lights.
Later, in the process of experiments, the CD4017 microcircuit failed. On the fast wire, I had to replace it with a domestic analogue K561IE8.
I wanted to get more interesting lighting effects of running lights. As a result, I assembled another printed circuit board with K561TM2 triggers and power keys on KT815. A pulse from each K561IE8 output is fed to the trigger input according to the "latch" principle, that is, at the trigger output, the signal remains constant until the arrival of a reset pulse from leg 11 of the CD4017 microcircuit (K561IE8). 9 channels will turn on per cycle. Power switches on KT815 transistors are designed to connect loads up to 1-1.5A. If you need to connect a more powerful load, then you need to replace the KT815, respectively, with more powerful transistors. Since I used four K561TM2 microcircuits, I got a circuit for eight channels. In this circuit, you can get 9 LED control channels, but then you need to add another K561TM2 microcircuit to the circuit by connecting one trigger (the K561TM2 microcircuit consists of two triggers), and also add one transistor switch.

Scheme after rework ..



To test the operation, I connected pieces of an LED strip with three LEDs to each of the eight channels.


Replaced the 50kOhm trimmer resistor with 470kOhm to expand the range of pulse frequency adjustment. Found in

Many motorists, in order to improve the appearance of their car, tune their "Swallow" with LED lights. One of the tuning options is a running turn signal that draws the attention of other road users to itself. The article provides instructions for installing and configuring turn signals with running lights.

[Hide]

Assembly instructions

LED lamps are semiconductor elements that glow under the influence of an electric current. The main element in them is silicon. Depending on which impurities are used, the color of the bulbs changes.

Photo gallery "Possible variants of dynamic direction indicators"

Tools and materials

To make a running turn signal with your own hands, you will need the following tools:

  • soldering iron;
  • side cutters or pliers;
  • soldering iron and soldering material;
  • tester.

From consumables you need to prepare fiberglass. It is needed for the manufacture of a printed circuit board on which a semiconductor element will be placed. The required LEDs are selected. Depending on the characteristics of the LEDs and the values ​​of the current and voltage of the on-board network, the characteristics of the protective resistors are calculated. Using the calculations, the rest of the network components are selected (video by Evgeny Zadvornov).

Sequence of work

Before making the turn signals, you need to choose a suitable scheme.

Then, based on the diagram, make a printed circuit board and apply markings on it to accommodate future elements.

The assembly consists of a sequence of actions:

  1. First, you should de-energize the car by disconnecting the negative terminal from the battery.
  2. Next, you need to remove the old direction indicators and carefully disassemble them.
  3. Unscrew old bulbs.
  4. The joints should be cleaned of glue, degreased, washed and allowed to dry.
  5. In place of each old element, a new running light is installed.
  6. Further, the assembly and installation of the lanterns is carried out in the reverse order.
  7. After installation, the wires are connected.

At the next stage, an additional stabilized power supply is connected to the network. Its input receives power from an intermediate relay, and the output is connected to a diode. It is better to place it in the dashboard.

When connecting the LEDs, make sure that the anode is connected to the positive of the power supply, and the cathode to the negative. If the connection is not made correctly, the semiconductor elements will not glow and may even burn out.


Features of installation and configuration of running direction indicators

You can install dynamic turn signals instead of conventional LEDs. For this, a board with LEDs and current-limiting resistors is removed and dismantled. On the repeater, you need to tear off the glass from the case. Then carefully cut out the reflector and remove it.

In place of the remote reflector, an SMD 5730 board is installed, on which the yellow LEDs are located. Since the repeater has a curved shape, the board will have to be stratified and slightly bent. For the old board, you need to cut off the part with the connector and solder it to connect the controller. Then all the components are returned to their place.

To adjust the timing of the running LED lights, a switch is soldered to the microcontroller. When a suitable speed is found, jumpers are soldered instead of a switch. When connecting two pins to ground, the minimum time between LED flashes is 20 ms. When the contacts are closed, this time will be 30 ms.


Issue price

You can make a running light turn signal from daytime running lights. Their cost is 600 rubles. As light sources in this case, you can take "pixel" RGB LEDs in the amount of 7 pieces for each running turn signal. The cost of one element is 19 rubles. To control the LEDs, you need to purchase an Arduino UNO worth 250 rubles. Thus, the total cost will be 1060 rubles.

Quite often, car owners tend to design them in a special way. One of the possible solutions to this problem is the use of LED turn signals. In addition to this application, this semiconductor element can be used in car lighting, exterior design (for example, parking lights).

Some go even further and install them inside the cabin to express more individuality. One example of this use would be at the door. When stopped, they turn on, the driver or passenger can easily leave the vehicle.

Video: DIY LED turn signals VAZ

LED types

An LED is a semiconductor radio component that, under the influence of an electric current, starts to glow. The main element in them is silicon. Depending on the type of impurity used in this semiconductor element, the LED can change its light.

The most commonly used types of such microelectronic components are:

  1. Aluminum, gallium, nitrogen are used as impurities. Depending on the concentration, the color range changes from blue to green.
  2. Based on indium, helium, phosphorus. The color can range from red to yellow.

Today, the semiconductor industry produces LEDs in all possible colors. Therefore, there are no problems with this.

One LED is unlikely to be able to illuminate the turn signal, but several will easily cope with this task

By power, they are subdivided into low-power and power ones. Power ones are designed for a current of more than 0.35 A. In turn, low-power ones work up to this value.

Possible connection schemes

The following LEDs are most commonly used today:

  1. A similar connection is used to switch a long string of LEDs (for example, around the perimeter of a car). A capacitor-type power supply is used as a voltage source. The current-limiting element in such a circuit is a capacitor. A diode bridge in combination with a filter (usually a set of resistor and capacitor) is used as an AC-to-DC converter. A protective resistor must be installed in series with the diode chain, which takes over the excess voltage.
  2. The second option is the connection of LEDs in garlands of 3-6 pieces in series. Several of these strings can be connected in parallel with each other, depending on the power source. The role of the latter in this circuit is played by a stabilized power supply with a voltage of 12-24V. In a similar scheme, a protective resistor must also be installed in series with each garland.
  3. The last, third connection option is directly. In such a circuit, only a power diode can work, which is designed for a current of more than 0.35A.

The LED has only two legs for connection - anode and cathode. The anode must be connected only to the positive pole of the power supply. In turn, the cathode is negative. With another connection, this semiconductor element will not work.

Requirements for performer and instrument

When carrying out any electronic installation, a tester (for measurements), a soldering iron, tweezers, side cutters must be used (if they are not available, then you can use pliers, which can also perform this task). You will need a calculator to perform calculations and determine the required values. Among the consumables, glass fiber laminate can be distinguished (a printed circuit board is made from it - the base for fastening this semiconductor element), solder, rosin, flux for soldering and tsaponlak.

It will be difficult to make LED turn signals without a tester

Selection of the most suitable series of elements

The main parameters of any device in this series are the rated voltage. That is, the operating values ​​of these parameters, at which the LED retains its original properties. The calculation is performed according to Ohm's law for a section of the chain. Each car has a current source with specified parameters - current and voltage. On the other hand, we have the characteristics of the required LED. The difference between the first and second values ​​is the characteristics of the resistor that must be connected in series in the circuit. And knowing the parameters of the latter, the entire circuit can be assembled without much difficulty.

Let's carry out the calculation for the simplest circuit, which consists of a stabilized voltage source, an LED and a protective resistor. In other cases, the methodology remains practically the same, but only due to the larger number of elements used, the calculation becomes more complicated.

For example, in the car there is a source, the values ​​of which are respectively equal to 0.02A and 24V. Moreover, a constant voltage source (for example, a rechargeable battery). The LED needs 0.02A and 2V to come. Now we determine the value of the potential drop across the resistor:

UR = Upit-Ud,

where UR is the potential drop across the resistor, V

Usup - power supply voltage, V

Uд - nominal (working) potential drop across the diode, V

According to the formula given earlier, we get UR = 24-2 = 22V. All elements of this circuit are connected in series with each other. As a result, the current does not branch off anywhere, at any point in the circuit it will be equal to 0.02A. As a result, we get the value of the resistance of the resistor according to Ohm's law:

where R is the resistance of the resistor, Ohm

IR - current in the circuit, A

Substituting the required values, we get R = 22 / 0.02 = 1100 Ohm. Next, we determine the second most important parameter of any resistor - this is power. It is determined by the formula:

As a result, we get РR = 0.02 * 22 = 0.44W. From the existing range of resistors, we select the nearest largest values ​​- 1.1 kOhm and 0.5 W. On this, the calculation can be considered complete - the parameters of all elements of the electrical circuit are determined.

One example of using LEDs

One of the most common uses of these elements in cars is as quality. Now let's look at how to make LED turn signals from regular ones.

The procedure is as follows:

  1. The most suitable connection scheme is selected
  2. The required LED is selected
  3. Next, all other radio components of the electrical circuit are calculated
  4. Based on the calculations performed, protective resistors and other components are selected
  5. Then a list of necessary radio components is drawn up. With this list, you need to visit the nearest store of such a profile and all the necessary equipment is bought in it.
  6. All the necessary documentation is being developed (including a drawing of a printed circuit board and its assembly drawing)
  7. Then you need to make a printed circuit board for mounting radio components on it. To do this, a previously developed drawing is applied to the fiberglass board with the help of varnish. All the necessary holes are drilled for the installation of radio components. She is immersed in ferric chloride. After the pattern on the board is etched out, it gets out. It is washed with plain water. Then the protective layer is removed with a solvent. At the next stage, rinsing is carried out again with running water. And only after that it dries out. Upon completion of all the procedures performed, we receive a ready-made payment for further work. Since there are only 4 turn signals, 4 boards must also be made.
  8. At the next stage, on the basis of the diagram and the developed drawing of the board, the installation of all the elements of the circuit is carried out. At the end of the assembly, all contacts are necessarily opened with a tsaponlak (it will provide the necessary insulation and protection of the circuit in case of moisture ingress)

  1. Then you need to dismantle the old turn signals and carefully disassemble them. And so as not to damage.
  2. The old lighting element (lamp) is completely turned off and removed.
  3. The joints, where everything was previously filled with glue, must be cleaned with a file and sandpaper. Then this joint is degreased with alcohol. Then all this is washed with water and must dry.
  4. In place of the old lighting element, new ones are installed. If necessary, you can make minor structural changes that would simplify the installation process.
  5. Then the assembly is carried out in the reverse order. It is necessary to apply glue to the joint and glue the disassembled turn signal. Then it is necessary to withstand the time until the glue hardens. In the future, this turn signal is installed in the old place and the old wires are connected to it.
  6. The next step is to make changes to the. To do this, the old wires are broken and an additional stabilized power supply is wedged into it (you can purchase it separately or do it yourself). Moreover, its output is set to the LED. The input is supplied with voltage from the contact group of the intermediate relay. It is most convenient to place this element in the car dashboard. At the final stage, it is necessary to visually check the polarity of the connection. The anode must be connected without fail only to the positive pole of the power supply. In turn, the cathode is negative. With another connection, this semiconductor element will not work, and may even fail.
  7. Then it is necessary to inspect the assembled circuit and compare it with the initial version for compliance.
  8. Next, power is supplied and the operability of the circuit is checked. If everything is fine, then the editing is complete. Otherwise, it is necessary to find the cause of the malfunction and eliminate it.

Video: homemade turn signals

Conclusion

This article discusses how to make LED turn signals on your own. There is nothing difficult in this, and with sufficient qualifications and well-prepared preliminary work, it can be done without any problems. Due to such a circuit modernization, it is possible to achieve significant savings in battery life and significantly extend its service life.

  • news
  • Workshop

Mercedes-Benz E-class coupe spotted during tests. Video

The video featuring the new Mercedes-Benz E Coupe was filmed in Germany, where the car is being finalized. The video was posted on the walkoART blog, which specializes in spy footage. Although the body of the new coupe is hidden under protective camouflage, it can already be said that the car will receive a traditional appearance in the spirit of the Mercedes E-class sedan ...

Research: car exhaust is not a major air pollutant

According to the participants of the energy forum in Milan, more than half of CO2 emissions and 30% of solid particles harmful to health enter the air not at all due to the operation of internal combustion engines, but due to heating of the housing stock, La Repubblica reports. Currently, in Italy 56% of buildings are classified in the lowest ecological class G, moreover ...

New generation Ford Fiesta: already in 2018-2019

The exterior of the novelty will be made in the style of the larger Focus and Mondeo of the current generation. About this with reference to sources within the company reports OmniAuto. Based on the information received, the artist of the publication also created an image on a computer that demonstrates how such a car could look like. The headlights and radiator grille in Mondeo style are not the only thing that will be ...

Mercedes plant in Moscow region: project approved

Last week it became known that the Daimler concern and the Ministry of Industry and Trade are planning to sign a special investment contract, which involves the localization of the production of Mercedes cars in Russia. At that time, it was reported that the site where it is planned to establish production of "Mercedes" will be the Moscow region - the industrial park "Esipovo" under construction, which is located in the Solnechnogorsk region. Also...

Video of the day: electric car gains 100 km / h in 1.5 seconds

An electric car called the Grimsel was able to accelerate from standstill to 100 km / h in 1.513 seconds. The achievement was recorded on the runway of the air base in Dubendorf. The Grimsel is an experimental vehicle developed by students from the Swiss Higher Technical School of Zurich and the University of Applied Sciences Lucerne. The car is made to participate ...

Self-driving taxis to appear in Singapore

During the test, six modified Audi Q5s capable of autonomous driving will appear on the roads of Singapore. Last year, such cars smoothly traveled from San Francisco to New York, Bloomberg reports. In Singapore, the drones will move along three specially prepared routes equipped with the necessary infrastructure. The length of each route will be 6.4 ...

Citroen is preparing a flying carpet suspension

Citroen's Advanced Comfort Lab, based on the C4 Cactus production crossover, is by far the most visible innovation in the chubby chairs, which look more like home furniture than car seats. The secret of the chairs is in the padding of several layers of viscoelastic polyurethane foam, which is usually used by manufacturers ...

Suzuki SX4 underwent restyling (photo)

From now on, in Europe, the car is offered only with turbocharged engines: petrol liter (112 hp) and 1.4-liter (140 hp) units, as well as a 1.6-liter turbodiesel developing 120 horsepower. Before the modernization, the car was also offered with a 1.6-liter 120-horsepower naturally aspirated gasoline engine, but this unit will be retained in Russia. In addition, after ...

Mileage Magadan-Lisbon: there is a world record

They traveled across Eurasia from Magadan to Lisbon in 6 days, 9 hours 38 minutes and 12 seconds. This race was organized not only for the sake of minutes and seconds. He carried a cultural, charitable and even, one might say, scientific mission. Firstly, 10 euro cents from each kilometer traveled was transferred to the organization ...

The iconic Toyota SUV will sink into oblivion

The complete cessation of production of the car, which has so far been produced for the markets of Australia and the Middle East, is scheduled for August 2016, according to Motoring. For the first time the production Toyota FJ Cruiser was shown in 2005 at the International Auto Show in New York. From the moment of the start of sales until today, the car has been equipped with a four-liter gasoline ...

HOW to order a car from Japan, a car from Japan in Samara.

How to order a car from Japan Japanese cars are the best sellers all over the world. These machines are valued for their reliability, quality, maneuverability and trouble-free repair. Today car owners want to be sure that the car came directly from Japan, and ...

What car to choose for a family man

A family car should be safe, roomy and comfortable. In addition, family cars should be easy to use. Varieties of family cars As a rule, most people associate the concept of "family car" with a 6-7-seat model. Station wagon. This model has 5 doors and 3 ...

Rating of reliable cars 2018-2019

Reliability is by far the most important requirement for a car. Design, tuning, any "bells and whistles" - all these ultra-fashionable tricks in their degree of importance inevitably fade when it comes to the reliability of the vehicle. The car should serve its owner, and not cause him problems with its ...

HOW to choose and buy a car, Buying and selling.

How to choose and buy a car The choice of cars, both new and used, on the market is huge. And not to get lost in this abundance will help common sense and a practical approach to choosing a car. Do not give in to the first desire to buy the car you like, carefully study everything ...

What did the stars ride in the 20th century and today?

It has long been understood by everyone that a car is not just a means of transportation, but an indicator of status in society. By car, you can easily determine what class its owner belongs to. This applies to both the common man and pop stars. ...

The cheapest car in the world - TOP-52018-2019

Crises and the financial situation are not very conducive to buying a new car, especially in 2017. Only everyone has to drive, and not everyone is ready to buy a car on the secondary market. There are individual reasons for this - who is not allowed to travel by origin ...

How to choose a car brand When choosing a car, you need to study all the pros and cons of the car. Look for information on popular automotive sites where car owners share their experiences and professionals test new items. Having collected all the necessary information, you can make a decision in ...

2018-2019: rating of CASCO insurance companies

Each car owner strives to protect himself from emergencies associated with road accidents or other damage to his vehicle. One of the options is the conclusion of a CASCO agreement. However, in conditions when there are dozens of firms providing services in the insurance market ...

Which sedan to choose: Almera, Polo Sedan or Solaris

In their myths, the ancient Greeks talked about a creature with the head of a lion, the body of a goat and a snake instead of a tail. “The winged Chimera was born as a tiny creature. At the same time, she sparkled with the beauty of Argus and terrified the Satyr with the ugliness. It was a monster of monsters. " The word ...

  • Discussion
  • In contact with

I said last year "Gop" - it's time to jump :)
Rather, make the promised review of the running turn signals.
I ordered 1 meter of black tape WS2812B (144 LEDs) in a silicone tube, when ordering I chose "Black 1m 144led IP67" (perhaps someone will like the white color of the substrate, there is such a choice).

A little caveat

I received a tape welded from two half-meter pieces. The downside of this is the vulnerable spot of the solder (contacts may be broken over time) and the increased gap between the LEDs.
Before buying, check with the seller for this moment

Contact wires were soldered to the tape on both sides for serial connection of several pieces, since I did not need this, then I sealed off the wires on one side, sealed everything with a neutral sealant and wound a little more black electrical tape.



Attached to glass with double-sided transparent adhesive tape, for example.

Installation details

He degreased the surfaces, first glued adhesive tape to the tube (I will call it that, even though the cross-section is rectangular), cut off the protruding excess of a wider tape, pushed the edges of the tube into the slots between the ceiling and the upper parts of the decorative panels of the rear pillars (I hid the contact wires with a connector behind one panel ), centered it and began to press it against the glass, slowly pulling out the protective layer of the tape.
Unfortunately, there is no video - there were no free hands for shooting, and everyone's cars are different.
If something is not clear - ask in the comments.
The summer heat test was successful - nothing came off or floated.
The only negative is that the angle of inclination of the glass is shallow, the LEDs shine more upward. On a sunny day it is difficult to see, but since these are duplicate signals, then

Now let's move on to the electronic stuffing.
I have used, but not so long ago discovered

For about the same cost, we get more buns

The sketch without any special alterations will work on Wemos when programming in the Arduino IDE, and if you implement a small web server, then when connected to it via Wi-Fi, you can change the values ​​of variables such as the delay time between flashes, the amount of deceleration during emergency braking etc.
Here in the future, if someone is interested in implementing a project on the ESP8266, I can post an example for changing the settings via the web interface, saving them to EEPROM, and then reading them.
The web server can be launched, for example, through a turned on turn signal and pressing the brake pedal when the ignition is turned on (in the setup procedure, interrogate the state of the corresponding inputs).

For the implementation of the flashing mode with sharp braking, was purchased
The sketch tracks the level of deceleration when the brake pedal is pressed, if it exceeds 0.5G (sharp deceleration, but without squealing brakes), then a flashing mode is turned on for a few seconds to attract additional attention.
Control signals to the Arduino inputs from the "plus" of stops, turn signals and reverse are fed through galvanic isolators - optocouplers with current-limiting resistors, which ultimately form a LOW level at the Arduino inputs (they are constantly attracted to positive through 10kOhm resistors).
Power supply - 5 volts via a DC-DC buck converter.
The whole thing is folded as a sandwich and packed in a suitable box, on which an arrow marked the direction of installation for the correct orientation of the gravity sensor

Scheme and photo



The rating of the pull-up (to positive) resistors is standard - 10 kOhm, the optocoupler current limiting resistors are 1 kOhm. I dropped the optocouplers from the old boards, two got PC123, two - PC817.


In the first photo you can see two additional conclusions, I made them for the turn signals. Since in my car, when the steering column lever is turned on, a short to ground occurs, I connected the wires to the lever block and the Arduino inputs. If the steering column lever commutes plus or take the signal from the "+" bulbs of the left / right turn signals, then connect them through a galvanic isolation.



Well, now the sketch itself (Arduino IDE)

#include #include // some general comments // I turned off one edge LED at a time. they shone on the decorative panels of the racks // seen in the example of this for loop (int i = 1; i<143; i++) //если отключать не нужно, заменяем на for (int i=0; i<144; i++) //задний ход и аварийка у меня не используются, т.к. в первом случае яркость никакая, во втором надо подключать входы к лампам поворотников //поворотники и стоп-сигнал одновременно не включаются, чтобы это реализовать, нужно переписывать соответствующий код скетча (делить ленту на три секции, подбирать тайминги миганий, менять диапазон переменных циклов). //Дерзайте - все в ваших руках // Пин для подключения управляющего сигнала светодной ленты const int PinLS = 2; //Пины для подключения датчиков //если более удобно будет подключать контакты в другом порядке - просто поменяйте значения переменных const int buttonPinL = 3; const int buttonPinR = 4; const int buttonPinS = 6; const int buttonPinD = 5; //начальные статусы входов (подтянуты к плюсу) int buttonStateS = HIGH; int buttonStateD = HIGH; int buttonStateL = HIGH; int buttonStateR = HIGH; // пауза pause_pov1 (в миллисекундах) нужна, чтобы синхронизировать циклы "пробегания" полоски и включения лампочки поворотника // такое может быть, если используется меньше половины светодиодов // в моем случае паузы нет (pause_pov1 = 0) int pause_pov1 = 1; // этой паузой регулируем длительность состояния, когда все светодиоды выключены //я определял опытным путем - включал поворотник, засекал по отдельности время ста мыргов лампочкой и ста беганий полоски, разницу делил на 100, на полученное время увеличивал или уменьшал значение переменной (в зависимости от того, отставали или убегали вперед лампочки) int pause_pov2 = 62; // переменная для получения значения ускорения int ix; Adafruit_NeoPixel strip = Adafruit_NeoPixel(144, PinLS, NEO_GRB + NEO_KHZ800); Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); void setup() { pinMode(buttonPinS, INPUT); pinMode(buttonPinD, INPUT); pinMode(buttonPinL, INPUT); pinMode(buttonPinR, INPUT); strip.begin(); // гасим ленту for (int i=0; i<144; i++) strip.setPixelColor(i, strip.Color(0,0,0)); strip.show(); accel.begin(); // ограничиваем измеряемый диапазон четырьмя G (этого хватит с большим запасом) accel.setRange(ADXL345_RANGE_4_G); accel.setDataRate(ADXL345_DATARATE_100_HZ); } void loop() { // СТОПЫ: если включены - высший приоритет //Чтобы сделать меняющуюся по ширине полоску в зависимости от интенсивности торможения //(уточнение - никакой светомузыки, ширина полосы после нажатия на тормоз не меняется!) //от плавного торможения до тапки в пол. //Добавляем еще одну переменную, например, ix2, //присваиваем ей значение ix с коэффициентом умножения, //заодно инвертируем и округляем до целого //ix = event.acceleration.x; //ix2 = -round(ix*10); //ограничиваем для плавного торможения в пробках //(чтобы не менялась при каждом продвижении на 5 метров) //if (ix2<10) ix2 = 0; //и для резкого торможения. //Реальный диапазон изменения переменной ix - от 0 до -5 //для максимальной ширины полосы при G равном или большем 0.5 //if (ix2 >50) ix2 = 50; // then change the loops in the STOP block for (int i = 1; i<143; i++) на for (int i=51-ix2; i<93+ix2; i++) //Получаем минимальную ширину полоски ~30 см (для стояния в пробке) и максимальную для резкого торможения //конец комментария buttonStateS = digitalRead(buttonPinS); if (buttonStateS == LOW) { sensors_event_t event; accel.getEvent(&event); ix = event.acceleration.x; // проверка резкого торможения - мигающий режим // значение 5 - это 0,5G, минус - торможение if (ix < -5) { for (int is=0; is<15; is++) { for (int i=1; i<143; i++) strip.setPixelColor(i, strip.Color(240,0,0)); strip.show(); delay(10 + is*10); for (int i=1; i<143; i++) strip.setPixelColor(i, strip.Color(0,0,0)); strip.show(); delay(10 + is*3); buttonStateS = digitalRead(buttonPinS); if (buttonStateS == HIGH) return; } } // помигали - и хватит, включаем постоянный режим, если педаль тормоза еще нажата // или если не было резкого торможения и предыдущее условие не сработало if (buttonStateS == LOW) { for (int i=1; i<143; i++) strip.setPixelColor(i, strip.Color(200,0,0)); strip.show(); while(buttonStateS == LOW){ buttonStateS = digitalRead(buttonPinS); delay(50); } // плавно гасим for (int is=0; is<20; is++) { for (int i=1; i<143; i++) strip.setPixelColor(i, strip.Color(190 - is*10,0,0)); strip.show(); delay(10); } // СТОПЫ конец } } else // если СТОПЫ выключены { // ЗАДНИЙ ХОД: если включен - средний приоритет buttonStateD = digitalRead(buttonPinD); if (buttonStateD == LOW) { for (int i=1; i<37; i++) strip.setPixelColor(i, strip.Color(63,63,63)); for (int i=107; i<143; i++) strip.setPixelColor(i, strip.Color(63,63,63)); strip.show(); while(buttonStateD == LOW){ buttonStateD = digitalRead(buttonPinD); delay(50); } //плавно гасим for (int is=0; is<16; is++) { for (int i=1; i<37; i++) strip.setPixelColor(i, strip.Color(60 - is*4,60 - is*4,60 - is*4)); for (int i=107; i<143; i++) strip.setPixelColor(i, strip.Color(60 - is*4,60 - is*4,60 - is*4)); strip.show(); delay(10); } } buttonStateL = digitalRead(buttonPinL); buttonStateR = digitalRead(buttonPinR); // если включена аварийка if (buttonStateL == LOW && buttonStateR == LOW) { for (int il=0; il<71; il++) { strip.setPixelColor(71-il, strip.Color(63,31,0)); strip.setPixelColor(il+72, strip.Color(63,31,0)); strip.show(); delay(pause_pov1); } for (int il=0; il<71; il++) { strip.setPixelColor(71-il, strip.Color(0,0,0)); strip.setPixelColor(il+72, strip.Color(0,0,0)); strip.show(); delay(pause_pov1); } delay(pause_pov2); } // если включен ЛЕВЫЙ ПОВОРОТНИК if (buttonStateL == LOW && buttonStateR == HIGH) { for (int il=0; il<71; il++) { strip.setPixelColor(il+72, strip.Color(220,120,0)); strip.show(); delay(pause_pov1); } for (int il=0; il<71; il++) { strip.setPixelColor(il+72, strip.Color(0,0,0)); strip.show(); delay(pause_pov1); } delay(pause_pov2); } // если включен ПРАВЫЙ ПОВОРОТНИК if (buttonStateL == HIGH && buttonStateR == LOW) { for (int il=0; il<71; il++) { strip.setPixelColor(71-il, strip.Color(220,120,0)); strip.show(); delay(pause_pov1); } for (int il=0; il<71; il++) { strip.setPixelColor(71-il, strip.Color(0,0,0)); strip.show(); delay(pause_pov1); } delay(pause_pov2); } //правый поворотник конец } //конец условия else Стоп // задержка для следующего опроса датчиков delay(10); }

I tried to comment on it as much as possible, but if I have any questions, I will try to add comments (therefore, I place it in the text of the review, and not in the attached file). By the way, this also applies to other points of the review - I will also supplement it if there are significant questions in the comments.

And finally, a demonstration of work (for the video I used a sketch with a demo mode).

Upd. The sketch with the demo mode was made specially to fit everything into one short video.
The brake light flashes only when braking suddenly (as described above), when smoothly and standing in traffic jams, it simply lights up, without irritating the drivers behind.
The brightness in the dark is not excessive. the lights are directed more upward than backward due to the tilt of the glass.
Standard lights work as usual, this strip duplicates them.

I plan to buy +97 Add to favourites I liked the review +89 +191