Computers and modern gadgets

One option for using solid-state light sources for decorative purposes is LED running lights. There are a lot of ways to make this simple device. Let's look at some of them.

The simplest circuit of 12 volt running lights

On the Internet, the most common one is a simple “old-fashioned” circuit using a meter and a generator (Figure 1).

Picture 1

The operation of the circuit is extremely simple and clear. The generator is built on the basis of a pulse timer, and the counter performs its main function - it counts pulses and produces the corresponding logical levels at its outputs. LEDs are connected to the outputs, which light up when a logical one appears and, accordingly, go out at zero, thereby creating the effect of running lights. The switching speed depends on the frequency of the generator, which in turn depends on the values ​​of resistor R1 and capacitor C1.

The names of the microcircuits are Soviet, but they have easily accessible imported analogues. If you need to increase , then to increase the current you need to connect them through buffer transistors, because The meter outputs themselves have a fairly modest load capacity.

Connecting the “brains”

To obtain more complex effects, the circuit must be built on a microcontroller (hereinafter referred to as MK). Although there are many circuits of running lights on a microcontroller on the Internet, built on ordinary logic, implementing different sequences of LED lighting, their use is unjustified and impractical these days.

The schemes turn out to be more cumbersome and expensive. The MK allows you to flexibly control individual LEDs or their groups, store many lighting effect programs in memory and, if necessary, alternate them according to a predetermined sequence or by an external command (for example, from a button). In this case, the circuit turns out to be very compact and quite cheap.

Let's consider the basic principle of constructing a circuit of running lights on LEDs using a microcontroller.

For example, let's take the ATtiny2313 chip - an 8-bit MK costing about $1. The simplest circuit can be implemented by directly connecting LEDs to the I/O pins (Figure 2). These MK pins are capable of providing a current of up to 20 mA, which is more than enough for indicator LEDs.

The required current value is set by resistors connected in series with the diodes. The current value is calculated using the formula I=(U power -U LED)/R. The MK power supply and reset circuits are not shown in the figure so as not to clutter the circuit. These circuits are standard and are performed in accordance with the manufacturer's recommendations in the Data Sheet. If it is necessary to precisely set time intervals (the duration of ignition of individual LEDs or a complete cycle), you can use a quartz resonator connected to pins 4 and 5 of the MK.

If there is no such need, you can get by with a built-in RC generator, assign the freed pins as standard outputs and connect a couple more LEDs. The maximum number of LEDs that can be connected to this MK is 17 (Figure 2 shows an option for connecting 10 LEDs). But it is better to leave one or two outputs for the control buttons, so that you can switch the running fire modes.

Figure 2

That's all for hardware. Then everything depends on the software. The algorithm can be anything. For example, you can store several modes in memory and set the repetition interval for each, or connect two buttons: one to switch modes, the other to adjust the speed. Writing such a program is a fairly simple task even for a person who has never worked with a microcontroller before, but if you are too lazy or don’t have time to study programming, and really want to “revive” a running fire on LEDs, you can always download ready-made software.

The homemade LED running lights circuit presented in this article is based on a fairly popular one. Up to 12 programs of various lighting effects are stored in the program memory, which can be selected as desired. This includes running fire, running shadow, growing fire, and so on.

This automatic lighting effects machine allows you to control thirteen LEDs, which are connected through current-limiting resistors directly to the ports of the ATtiny2313 microcontroller. As mentioned above, 11 different independent combinations of light patterns are hardwired into the microcontroller’s memory, and it is also possible to sequentially cycle through all 11 combinations once, this There will already be a 12th program.

Button SA3 allows you to switch between programs.

Using the SA1 and SA2 buttons, you can control the speed of movement of the lights or the flickering frequency of each LED (from constant glow to light flickering). It all depends on what position the SA4 switch is in. When the switch SA4 is in the upper position according to the diagram, the speed of the running lights is regulated, and in the lower position the flickering frequency is adjusted.

When installing LEDs in a line, you should follow the same order as numbered in the diagram from HL1 to HL11.

The ATtiny2313 microcontroller is clocked from an internal oscillator with a frequency of 8 MHz.

Video of work: LED running lights

(1.1 Mb, downloaded: 3,657)

Creating a strip of running LEDs is an excellent option for using a light source for decorative purposes. Making a running fire with your own hands is quite simple, especially since in the end the product can have different effects, including fading of light and alternating operation of the elements.

ATtiny2313 microcontroller for running lights

This device belongs to the AVR series of microcontrollers from the Atmel brand. It is under his control that a running light strip is most often made, since the performance characteristics of the model are quite high. Microcontrollers are easy to program, multifunctional and support the implementation of various electronic devices.

ATtiny2313 is made according to a simple design, where the output and input ports have identical meanings. Selecting a program (one of 12) on such a microcontroller is very easy, because it is not overloaded with unnecessary options. The model is available in two packages - SOIC and PDIP, and each option has identical characteristics:

  • 8-bit general registers in the amount of 32 pieces;
  • capabilities of 120 operations per clock cycle;
  • 2 kB flash memory inside the system with support for 10 thousand erase and write cycles;
  • 128 byte in-system EEPROM with support for 100 thousand cycles;
  • 128 bytes of built-in RAM;
  • 4 PWM channels;
  • 8 and 16 bit counter-timer;
  • built-in generator;
  • convenient interface for various purposes and other functions.

The microcontroller has two types in accordance with energy parameters:

  • the classic ATtiny2313 model has a voltage from 2.7 to 5.5 V and a current of up to 300 μA at a frequency of 1 MHz in activity mode;
  • the ATtiny2313A (4313) variant has characteristics of 1.8-5.5 V and 190 μA at the same frequency.

In standby mode, the device has a power consumption of no more than 1 µA.

As already indicated, the microcontroller memory is equipped with 11 combinations of light circuits, and the ability to select all combinations of LEDs sequentially is the 12th program.

Scheme of running lights and the principle of its operation

The created LED running lights circuit is based on placing the microcontroller in the center. All its output ports are connected to LEDs:

  • port B or PB0-PB7 is used entirely to control the glow;
  • three pins from port D (PD4-PD6) are used as much as possible;
  • PA0 and PA1 also work, since they are free due to the implemented internal oscillator.

Pin No. 1 - PA2 or Reset - is not an active link in the circuit, so resistor R1 is connected to the ATtiny2313 power circuit. The positive part of the 5 V supply goes to pin No. 20 - VCC, and the negative part - No. 10 (GND). Polar capacitor C1 is installed to prevent failures and suppress interference in the operation of the MK.

Considering that each pin has a low load capacity, it is advisable to install LEDs with a rating of up to 20 mA on them.

Both classic smd3258 and high-brightness LEDs in a DIP package are suitable. There should be 13 of them in total. The current limiting function is assigned to resistors R6-R18.

The operation of the circuit is controlled through switch SA1, buttons SB1-SB3 and digital inputs PD0-PD3, which are connected through resistors R2, R3, R6 and R7. This design allows you to turn on the LEDs blinking in 11 different modes by setting a specific program with the SB3 button. And using switch SA1, the flashing speed is changed. For this:

  1. SA1 is moved to the closed position.
  2. The speed is changed using the SB1 (acceleration) and SB2 (deceleration) buttons.

Please note that when you open the switch with these buttons, the brightness of the LEDs changes from barely noticeable flickering to maximum power.

Assembly options

There are two accessible and relatively simple options for assembling running lights: on a printed circuit board or a breadboard. In both cases, it is advisable to take the circuit in a PDIP package on a DIP-20 socket as a basis. In this case, it is necessary that the remaining components are also in DIP packages.

When assembling on a breadboard, a 50x50 mm model with a pitch of 2.5 mm will be sufficient. LEDs can be placed not only on the board itself, but also on an external line, connecting them to the circuit using flexible wires.

A miniature printed circuit board is a more practical option for those cases when LED running lights are made with your own hands for further active use.

For example, when they are installed on a bicycle or car. In this case, you will need the following components:

  • one-sided textolite 55×55 mm;
  • capacitor 100 uF-6.3V;
  • DD1 – Attine 2313;
  • resistor 10 kOhm-0.25 W±5% (R1);
  • 17 resistors 1 kOhm-0.25 W±5% (R2-R18);
  • 13 LEDs with a diameter of 3 mm (color is not important);
  • 3 buttons KLS7-TS6601 or equivalent (SB1-SB3);
  • slide switch ESP1010 (SA1).

Radio amateurs with practical experience in assembling printed circuit boards are better off using Attine2313 SOIC with SMD resistors for this circuit. Due to this, the overall dimensions of the circuit will be reduced by almost half. You can also install super-bright SMD LEDs as a separate unit.

This 12 volt running lights circuit is widely known on the network, as it has a very simple and understandable design. The mode generator is a pulse timer, and the counter, counting them, supplies the corresponding logical levels to the outputs. The LED element connected to each output lights up at a logical one and goes out at zero. The effect of running lights is created by sequential flickering. The “running” speed is set by a generator, the operation of which is controlled by the nominal parameters of capacitor C1 and resistor R1.

The brightness of LEDs is enhanced by increasing the supplied current, but for this they must be connected through buffer transistors. The fact is that the counter outputs do not have a high load capacity.

This old diagram shows Soviet designations for components and microcircuits, but nowadays it is not difficult to find foreign-made analogues corresponding to them.

Firmware

Here we will talk about how to make running lights on LEDs with your own hands. The device circuit is simple and is implemented on so-called hard logic logic chips - TTL series chips. The device itself includes three microcircuits.

The circuit consists of four main nodes:

    square pulse generator;

    counter;

    decoder;

    display devices (16 LEDs).

Here is a schematic diagram of the device.

The device works as follows. After power is applied, LEDs HL1 - HL16 begin to light up and go out sequentially. Visually, this looks like a light moving from left to right (or vice versa). This effect is called “running fire”.

Rectangular pulse generator implemented on a microcircuit K155LA3. Only 3 2I-NOT elements of this microcircuit are used. Rectangular pulses are taken from the 8th pin. Their frequency is low. This allows visible switching of the LEDs to be realized.

In fact, the generator based on elements DD1.1 - DD1.3 sets the rate of switching of the LEDs, and, consequently, the speed of the “running fire”. If desired, the switching speed can be adjusted by changing the values ​​of resistor R1 and C1.

It is worth warning that with other ratings of R1 and C1, generation may be disrupted - the generator will not work. So, for example, the generator refused to work with a resistance of resistor R1 equal to 1 kOhm. Therefore, the values ​​of C1 and R1 can be changed only within certain limits. If the generator does not start, one of the LEDs HL1 - HL16 will be constantly lit.

The counter on the DD2 chip is necessary to count the pulses coming from the generator and supply the binary code to the K155ID3 decoder. According to the diagram, pins 1 and 12 of the counter chip K155IE5 connected. In this case, the microcircuit will count the input C1(pin 14) pulses and output at the outputs (1, 2, 4, 8) a parallel binary code corresponding to the number of received pulses from 0 to 15. That is, at the outputs (1, 2, 4, 8) the K155IE5 microcircuits sequentially replace each other friend 16 code combinations (0000, 0001, 0010, 0011, 0100, etc.). Next, the decoder is put into operation.

Chip feature K155ID3 is that it converts a four-bit binary code into a logical zero voltage, which appears at one of the 16 corresponding outputs (1-11, 13-17). I think this explanation is not clear to everyone. Let's try to figure it out.

If you pay attention to the image of the K155ID3 microcircuit, you will notice that it has 16 outputs. As you know, 16 combinations can be encoded in a four-digit binary code. It won't work anymore. Recall that using four-digit binary code you can encode decimal digits from 0 to 15 (16 digits in total).

This can be easily verified by raising 2 (the base of the number system) to the power of 4 (the number of digits or digits in the code). We get 2 4 = 16 possible combinations. Thus, when a binary code in the range from 0000 before 1111 at the exits 0 - 15 a logical zero will appear (the LED will light up). That is, the microcircuit converts the binary number into a logical zero at the output, which corresponds to the binary number. In fact, this is such a special decoder from binary to decimal.

Why does the LED light up? The output is logical zero. The diagram shows that the anodes of all LEDs are connected to the power supply plus, and the cathodes to the outputs of the K155ID3 microcircuit. If the output is “0”, then for the LED it is like a minus power supply and through it p-n current flows through the junction - the LED lights up. If the output is logical one “1”, then no current will flow through the LED.

If everything that has been written is still not clear to you, then do not be upset. Just assemble the proposed circuit, for example, on a solderless breadboard and enjoy the operation of the device. The circuit has been tested and works properly.

If you already have a stabilized power supply (for example, like this one), then the integrated stabilizer DA1 ( KR142EN5A) and strapping elements (C2, C3, C4) do not need to be installed in the circuit.

All values ​​of elements (capacitors and resistors) may vary ±20%. This will not affect the operation of the device. LEDs HL1 - HL16 can be of any color (red, blue, green) with an operating voltage of 3 volts. You can, for example, use bright red LEDs with a diameter of 10 millimeters. “Running fire” with such LEDs will look very impressive.

Currently, there are a lot of schemes with running lights on the Internet. In our article we will look at the simplest circuit, assembled on two popular microcircuits: the 555 timer and the CD4017 counter.

We will assemble according to this diagram (click on it to enlarge):

The scheme is not very complicated as it seems at first glance. So, to assemble it, we need:

1) three resistors with a nominal value: 22 KiloOhm, 500 KiloOhm and 330 Ohm

2) NE555 chip

3) CD4017 chip

4) 1 microfarad capacitor

5) 10 Soviet or Chinese LEDs at 3 Volts

Pinout 555


Currently, most microcircuits are produced in the so-called DIP package. DIP from English – Dual In-line Package, which literally means “double-row assembly”. The pins of the microcircuits in the DIP package are located in opposite directions from each other. The pin spacing is generally 2.54mm, but there are also exceptions. Depending on how many pins the microcircuit has, the housing for this microcircuit is called. For example, the 555 chip has 8 pins, hence its package is called DIP-8.

I marked the so-called “keys” in red circles. These are special marks with which you can find out the beginning of the marking of the microcircuit pins


The first pin is located right next to the key. Counting goes counterclockwise


This means that on the NE555N chip the pins are numbered as follows:


The same applies to the CD4017 chip, which is manufactured in a DIP-16 package.


The pins are numbered from the lower left corner.

Assembling the device

We collect our running lights. On the breadboard they look something like this:


And here is the circuit in action:

The whole circuit works in this way: a rectangular pulse generator is assembled on a 555 timer. The pulse repetition rate depends on resistor R2 and capacitor C1. Next, these rectangular pulses are counted by the CD4017 counter chip and, depending on the number of rectangular pulses, outputs signals to its outputs. When the counter in the chip overflows, everything starts all over again. The LEDs blink in a circle as long as there is voltage on the circuit.

Keep in mind that there are a lot of analogues of the 555 and CD4017 microcircuits. There are even Soviet analogues. For the 555 timer it is KR1006VI1, and for the counter chip K561IE8.

If you notice an error, select a piece of text and press Ctrl+Enter
SHARE:
Computers and modern gadgets