Arduino wiring diagram for a running turn signal. Dynamic turn signals - we make running lights from a KIT set

Many car enthusiasts to improve appearance of their car, tune their “Swallow” with LED lights. One of the tuning options is a running turn signal, which 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 what impurities are used, the color of the bulbs changes.

Photo gallery "Possible options for 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 Supplies 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 current and voltage values ​​​​of the on-board network, the characteristics of the protective resistors are calculated. Using calculations, the rest of the network components are selected (the author of the video is Evgeny Zadvornov).

Work sequence

Before you make turn signals, you need to choose the right scheme.

Then, based on the scheme, make printed circuit board and apply markup on it to accommodate future elements.

The assembly consists of a sequence of actions:

  1. First, turn off the power to 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. Old light bulbs should be unscrewed.
  4. The joints should be cleaned of glue, degreased, washed and allowed to dry.
  5. In place of each old element, a new turn signal running fire is installed.
  6. Further assembly and installation of lamps is carried out in the reverse order.
  7. After installation, the wires are connected.

At the next stage, an additional stabilized power source is included in the network. Power is supplied to its input from an intermediate relay, and the output is connected to a diode. It is better to place it in the dashboard.

When connecting LEDs, it is necessary to ensure that the anode is connected to the plus of the power source, and the cathode to the minus. If the connection is not made correctly, the semiconductor elements will not glow and may even burn out.


Features of installation and adjustment of running direction indicators

Can install dynamic turn signals instead of conventional LEDs. To do this, they remove, dismantle the board with LEDs and current-limiting resistors. On the repeater, you need to tear off the glass from the body. The reflector should then be carefully cut out and removed.

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

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


Issue price

You can make a turn signal running fire 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.

The designer of running lights from Aliexpress is a printed circuit board and a set of radio components. All you need to do is solder the components to the board.

But from it you can get more interesting effects of running lights. For example, for car turn signals or in a stop signal or just on garlands for a holiday.


This circuit can operate in the supply voltage range of 3-15 Volts. The pulse generator is assembled on a NE555 chip, then the pulses are fed to a decimal counter with a decoder - a CD4017 (or K561IE8) chip, to the outputs of which LEDs are connected through current-limiting resistors.

The switching speed of the running lights is regulated by a tuning resistor. Add a circuit with flip-flops and output transistor switches. No programming required, etc. As a result, more interesting lighting effects running lights. You need to make 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, the signal at the trigger output remains constant until the reset pulse arrives from pin 11 of the CD4017 (K561IE8) chip. 9 channels are switched on per cycle.

Consider the creation of a running turn signal as in an Audi, using the example of a headlight from a Renault Clio car. Let's make turn signals and DRLs in one device.

What you need for this: LED strip consisting of ws2812b LEDs Arduino nano controller(can be used in any other form factor) Automotive Charger for mobile phones With USB output. Since the Arduino controller needs a voltage of 5V, we will use this charger as a voltage converter from 12V to 5V. Voltage stabilizer for 5V KR142EN5V (KREN5V) or any other imported analogue. 3 10 kΩ resistors as pull-up resistor.

Connection diagram

The arduino controller must be connected to the car's network through a 12V -> 5V converter so that the voltage to the circuit comes from turning on the "ignition". To the voltage stabilizer KREN5V you need to connect the positive wire from the current turn signal. This article discusses the connection and firmware of only one turn signal, in order to make the second turn signal, you need to similarly connect the second LED strip to any free Arduino digital output (for example, 7), and also add the code for it in the firmware according to our example.

controller firmware

To work with pixel LEDs, you will need a library . You can install it as follows: Sketch -> Include Library -> Manage Libraries. Next, in the search menu, enter the name of the library Adafruit_NeoPixel.h and click the install button. After that, insert the sketch into the program and replace the number of LEDs in the code (we use 22 diodes):

#include // include the library
Adafruit_NeoPixel strip = Adafruit_NeoPixel(22, 8, NEO_GRB + NEO_KHZ800);
int t,t1,t2,t3,t4,p2,p1 = 0;// time variable
void setup()(
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);

strip.begin();
strip.show();

}
void loop() (
if (digitalRead(2) == LOW) ( //If the turn signal is off
for(int i = 0; i< 23; i++) {
strip.setPixelColor(i, strip.Color(255,255,255)); // R=255, G=255, B=255 - white color of the LED, turn on the running lights when turned on
}
strip.show();
}

if ((digitalRead(2) == HIGH) & (t == 1)) ( // check if the turn signal is on
for(int i = 0; i< 23; i++) {
strip.setPixelColor(i, strip.Color(0, 0, 0)); // extinguish all diodes
}
strip.show();
for(int k = 0; k< 3; k++){ // цикл до трех - сигнал «перестроения» , при кратковременном включении мигает 3 раза,

for(int i = 0; i< 23; i++){

if (digitalRead(2) == HIGH) (k = 0;) // if we get another positive signal while the turn signal is flashing, then reset the counter so that the turn signal flashes at least 3 more times
strip.setPixelColor(i, strip.Color(255, 69, 0)); // R=255, G=69, B=0 - LED color

delay((t4)/22);
strip.show();

}
if (digitalRead(2) == HIGH) (t4=t4+20;) // if all diodes are lit yellow, but the signal from the relay is still on, then we increase the burning time
if (digitalRead(2) == LOW) (t4=t4-20;) // if all diodes are lit yellow, but the signal from the relay is still on, then we increase the burning time

for(int i = 0; i< 23; i++){

strip.setPixelColor(i, strip.Color(0, 0, 0)); // R=0, G=0, B=0 - LED color

delay((t3)/22);
strip.show();

}
if ((digitalRead(2) == LOW)) (t3=t3+20;)
if ((digitalRead(2) == HIGH)) (t3=t3-20;)
}

if ((digitalRead(2) == HIGH) & (t == 0)) ( // check if the turn signal is on

t1 = millis(); // remember what time it turned on
for(int i = 0; i< 22; i++) {
strip.setPixelColor(i, strip.Color(255, 69, 0)); // the first time you turn on the turn signal, we light all the diodes yellow
}
strip.show();
while (digitalRead(2) == HIGH) ()
t2 = millis(); // remember what time the turn signal turned off
t4=t2-t1;

for(int i = 0; i< 22; i++) {
strip.setPixelColor(i, strip.Color(0, 0, 0)); // extinguish the diodes when the signal from the turn relay is lost
}
strip.show();
while (digitalRead(2) == LOW) (
if ((millis()-t2)>2000)(break;)
}
if ((millis()-t2)<2000) {
t3 = millis()-t2; // the time for which the turn signals go out
t = 1; // flag, we know that the time value is saved.
}
}

if (digitalRead(4) == HIGH) ( //special signals
for(int j = 0; j< 16; j++) {
for(int i = 0; i< 22; i++) {
strip.setPixelColor(i, strip.Color(255, 0, 0)); // R=255, G=0, B=0 - LED color
}
strip.show();
delay(20);
for(int i = 0; i< 22; i++){

}
strip.show();
delay(20);
}

for(int j = 0; j< 16; j++) {
for(int i = 0; i< 22; i++) {
strip.setPixelColor(i, strip.Color(0, 0, 255)); // R=0, G=0, B=255 - LED color
}
strip.show();
delay(20);
for(int i = 0; i< 22; i++){
strip.setPixelColor(i, strip.Color(0, 0, 0)); // R=0, G=0, B=0 - LED color
}
strip.show();
delay(20);
}
}

if (digitalRead(3) == HIGH) ( //strobe
for(int j = 0; j< 24; j++) {
for(int i = 0; i< 22; i++) {
strip.setPixelColor(i, strip.Color(255, 255, 255)); // R=255, G=255, B=255 - LED color
}
strip.show();

delay(15);
for(int i = 0; i< 22; i++){
strip.setPixelColor(i, strip.Color(0, 0, 0)); // R=0, G=0, B=0 - LED color
}
strip.show();
delay(15);
}
delay(500);

Do the same for the second turn signal.

Video how our headlight works

All those who saw a more or less modern and not the second time the car, and if it was still a matter of driving, have long noted for themselves one of the useful options ... People call it a lazy turn signal or a polite turn signal. Its whole essence boils down to the fact that when turning right or left, the driver only once touches the turn signal lever, while not fixing it. That is, it simply lets the turn signal indicator circuits work, but does not turn on this same switch. As a result, after the lever is released, the direction indicators work 3-4 more times, and the driver at this time can already do his own business, that is, completely surrender to the road. The option is very useful when you have to change lanes. Indeed, when the direction indicator lever is fully turned on, automatic shutdown will not occur, due to the insignificant angle of rotation of the steering wheel, which means that it will be necessary to poke back and forth with the indicator itself or constantly support it with your hand on the verge of switching on in order to simulate the operation of the direction indicator. And if there is such an option, then just touched the lever a little and forgot. In general, we think that the essence of the work has been fully revealed, but now it is worth mentioning the possible implementation of such an option on your machine.

Which electrical circuits are suitable for a courteous turn signal on Arduino

Before you go into all serious trouble about the production of a polite turn signal, you need to understand for which electrical wiring diagrams it is suitable without modifying the electrical circuit in the car.
Here we are presented with two main options, different in principle. The first is when the turn signals turn on when they are connected as a load. That is, the inclusion occurs due to the switching of the circuit of the direction indicator lamps, in which the direction indicator lever itself is located, it is he who closes the circuit, after which the operation occurs. In this case, it will not work to use our option, because when the lever opens the circuit with lamps, we immediately turn off the possibility of light indication, even if a signal comes to the lever itself, it simply will not go further.
The second option is ours, when there are control signals and there are output power signals. In this case, instead of a regular relay, you can put just the circuit that we would like to bring to your attention.

Relay power module that can be purchased on the Internet to control the power load

Sketch and diagram of a lazy (polite) turn signal on Arduino

So, the use of Arduino as a head unit as lazy turn signals can be argued, since this is also not an ideal solution, which has its drawbacks. Let's say it will be necessary to have constant power after the ignition is turned on, in order to ensure speed, it will be necessary to connect power circuits. At the same time, the strapping itself from unnecessary radio components is, in principle, useless here, because in this case you can simply program the microcontroller and use only it. But this minus is also a plus, because everyone who has it can afford to program the Arduino, and for microcontrollers you will also need a programmer.
Just writing a program will be one of the most difficult tasks. Here, a beginner will have to spend more than one hour of his free time and study the operation of algorithms, but fortunately there is the Internet and we are. So here's the sketch.

int switchPinR=8; int switchPinL=7; intledPinR=11; intledPinL=12; boolean ledOn = false; int i=0; intz=0; void setup() ( // put your setup code here, to run once: pinMode(switchPinR, INPUT); pinMode(switchPinL, INPUT); pinMode(ledPinR, OUTPUT); pinMode(ledPinL, OUTPUT); Serial.begin(9600 ); ) void loop() ( // put your main code here, to run repeatedly: //2 label: if (digitalRead(switchPinR) == HIGH && digitalRead(switchPinL) == HIGH) ( digitalWrite(ledPinR, HIGH) ; digitalWrite(ledPinL, HIGH); i=0; while (i<7) { ledOn = !ledOn; digitalWrite(ledPinR, ledOn); digitalWrite(ledPinL, ledOn); delay(400); i++; z++; if (digitalRead(switchPinL) == LOW && digitalRead(switchPinR) == LOW && z>=7) ( break; ) ) ) else ( digitalWrite(ledPinR, LOW); digitalWrite(ledPinL, LOW); z=0; ) // Loop the alarm if (digitalRead(switchPinR) == HIGH && digitalRead(switchPinL) == HIGH) (goto label;) //Right turn signal. if (digitalRead(switchPinR) == HIGH) ( digitalWrite(ledPinR, HIGH); i=0; while (i<7) { ledOn = !ledOn; digitalWrite(ledPinR, ledOn); delay(400); i++; z++; if (digitalRead(switchPinR) == LOW && z>=7) ( break; ) ) ) else ( digitalWrite(ledPinR, LOW); z=0; ) //Left turn signal. if (digitalRead(switchPinL) == HIGH) ( digitalWrite(ledPinL, HIGH); i=0; while (i<7) { ledOn = !ledOn; digitalWrite(ledPinL, ledOn); delay(400); i++; z++; if (digitalRead(switchPinL) == LOW && z>=7) ( break; ) ) ) else ( digitalWrite(ledPinL, LOW); z=0; ) ) )

In short, we can summarize that the sketch has 2 inputs and 2 outputs. At the same time, at the input of a positive, that is, a high signal level at the input (8.7), we get a certain number of blinks (z or i) at the corresponding output (11.12). In short, something like this. That is, if you want to change something in the sketch regarding the number of blinks and outputs of inputs, then pay attention to these variables. If it will be necessary to change the length of blinks, then your attention should be riveted to the delay function.
Another feature of the program is a somewhat unusual alarm output. First, the left and right pointers are worked out, then the emergency light alarm is turned on. This is due to the fact that it can turn on only if the input is high at the same time at inputs 8 and 7. And this condition will be fulfilled only for the second cycle, because pressing two buttons at the same time will not work just physically. The speed of the microcontroller will allow you to read the high output from some button faster and decide that this is still a condition for the turn signal to work, and not an alarm. Although you should not bother about it, except that saying thank you on the road will be problematic.

Features of connecting a lazy (polite) turn signal to Arduino in a car

You should not use pin 13 as an output, since every time the power is turned on and off, the indicators that will be connected to this output may flicker.
When switching from control signals to power signals, use the appropriate blocks purchased on the Internet or assembled by you. We have already talked about such blocks - modules.
When receiving signal 1 from a voltage of 12 volts, put a 10 kΩ resistor in front of the input.

That's actually all parting words when making a lazy turn signal for a car on an Arduino microcontroller, and now about the same in the video ...


Hello to all do-it-yourselfers! Today we will consider one of the many options for using a WS2812B LED strip on addressable RGB LEDs. Such tapes (as well as separately mounted WS2812B LEDs) can be used to illuminate the “Ambilight” background of computer monitors and TVs, dynamic lighting in a car, a picture, a photo frame, an aquarium, and so on. They are widely used in the design of any premises, in the form of New Year's illuminations or light shows. The use of WS2812B type LED strip makes it possible to get a large number of interesting projects.

The WS2812B LED is an RGB LED embedded in the same housing with the WS2801 chip.


The WS2812B LED itself is a SMD element designed for surface mounting. Inside, the LED consists of red light (red), green light (green) and blue light (blue) crystals in one package. With this LED, you can get a wide variety of color shades of light radiation.

The RGB LED is controlled through the Arduino microcontroller board.
I received a WS2812B LED strip from the Chinese. It is a 1 meter long segment with 144 LEDs. I have long wanted to try for different experiments. With the help of libraries for Arduino - Adafruit Neopixel and Fast led, you can get a lot of very unusual lighting effects. But then I decided to try to make dynamic turn signals for a car in the so-called “Audi style.” I haven’t put this scheme into practice yet (how will our gibbddeshniks take it?), but the effect turned out to be very attractive.

The Arduino Uno board serves as a controller for controlling the LED strip, other boards can be used - Arduino Nano, Arduino Pro mini).
Watch the whole process in the video:


List of tools and materials.
-Arduino Uno board;
- step-down board 12V \ 5V at 3A;
- resistors 100Kom-4pcs;
-resistors 47Kom-4pcs;
- resistors 500 Ohm-1pc;
-buttons (to simulate the inclusion of signals) -4pcs;
-bread board
-screwdriver;
laboratory power supply
- soldering iron;
- cambric;
-tester.
- connecting wires.

Step one. Schema assembly.


I assembled the circuit using a breadboard (bradboard). Resistors connected to the Arduino digital inputs are needed to convert the car's input signals from 12 to 5 volts. 500 ohm resistor to protect the control line of the WS2812B LED strip.
Board photo


As a converter from 12V to 5V, I used a ready-made board from Aliexpress. Any converter with suitable parameters can be used. The converter is needed for stable power supply of Arduino and LED strip WS2812B.


Step two. Arduino programming.

The digital inputs of the Arduino board No. 3,4 are used to turn on the left and right turns. Pin number 5 - turn on the brake light, pin number 6 - turn on the reverse. Pin number 8 - control signal tape WS2812B.

In the Arduino IDE, upload the sketch (link above). Two sketch options - one for the front of the car, the other for the back. Use whichever you need. At the beginning of the sketch, you can set the number of LEDs you need. You can also adjust the speed of the turn signals according to your car. You can also change the brightness of the LEDs with the strip.Color(103,31,0) parameter - change the first two digits from 0 to 255. That is, you can experiment a little.

When you press the desired button, we give a signal to enable the desired parameter. With the correct assembly of the circuit, it usually starts working immediately.

Photo in progress.






A good experiment turned out with this weekend design. It was interesting