Download printed circuit board diagrams for the winding winding counter. Electronic thread counter for winding machine. Operating principle of the machine

14.07.2023 Landscape design
Many household appliances and industrial automation devices of relatively recent production years have mechanical counters installed. They are products on a conveyor belt, turns of wire in winding machines, etc. In the event of a failure, finding a similar meter is not easy, and it is impossible to repair due to the lack of spare parts. The author proposes to replace the mechanical counter with an electronic one. An electronic counter, developed to replace a mechanical one, turns out to be too complex if it is built on microcircuits with a low and medium degree of integration (for example, the K176, K561 series). especially if a reverse account is needed. And in order to maintain the result when the power is turned off, it is necessary to provide a backup battery.

But you can build a counter on just one chip - a universal programmable microcontroller that includes a variety of peripheral devices and is capable of solving a very wide range of problems. Many microcontrollers have a special memory area - EEPROM. Data written into it (including during program execution), for example, the current counting result, is saved even after the power is turned off.

The proposed counter uses the Attiny2313 microcontroller from the AVR family from Almel. The device implements reverse counting, displaying the result with cancellation of insignificant

hive to quadruple led indicator, storing the result in EEPROM when the power is turned off. An analog comparator built into the microcontroller is used to timely detect a decrease in supply voltage. The counter remembers the counting result when the power is turned off, restoring it when turned on, and, similarly to a mechanical counter, is equipped with a reset button.

The counter circuit is shown in the figure. Six lines of port B (РВ2-РВ7) and five lines of port D (PDO, PD1, PD4-PD6) are used to organize dynamic indication of the counting result on the LED indicator HL1. The collector loads of phototransistors VT1 and VT2 are resistors built into the microcontroller and enabled by software that connect the corresponding pins of the microcontroller to its power supply circuit.

An increase in the counting result N by one occurs at the moment the optical connection between the emitting diode VD1 and the phototransistor VT1 is interrupted, which creates an increasing level difference at the INT0 input of the microcontroller. In this case, the level at the INT1 input must be low, i.e., the phototransistor VT2 must be illuminated by the emitting diode VD2. At the moment of a rising differential at the INT1 input and a low level at the INT0 input, the result will decrease by one. Other combinations of levels and their differences at the inputs INT0 and INT1 do not change the counting result.

Once the maximum value of 9999 is reached, counting continues from zero. Subtracting one from the zero value gives the result 9999. If counting down is not needed, you can exclude the emitting diode VD2 and phototransistor VT2 from the counter and connect the INT1 input of the microcontroller to the common wire. The count will only continue to increase.

As already mentioned, the detector of a decrease in supply voltage is the analog comparator built into the microcontroller. It compares the unstabilized voltage at the output of the rectifier (diode bridge VD3) with the stabilized voltage at the output integral stabilizer DA1. The program cyclically checks the state of the comparator. After disconnecting the meter from the network, the voltage on the rectifier filter capacitor C1 drops, and the stabilized voltage remains unchanged for some time. Resistors R2-R4 are selected as follows. that the state of the comparator in this situation is reversed. Having detected this, the program manages to write the current counting result to the EEPROM of the microcontroller even before it stops functioning due to the power being turned off. The next time you turn it on, the program will read the number written in EERROM and display it on the indicator. Counting will continue from this value.

Due to the limited number of microcontroller pins, to connect the SB1 button, which resets the counter, pin 13 was used, which serves as the inverting analog input of the comparator (AIM) and at the same time as the “digital” input of PB1. The voltage divider (resistors R4, R5) here sets the level perceived by the microcontroller as high logical. When you press the SB1 button, it will become low. This will not affect the state of the comparator, since the voltage at the AIN0 input is still greater than that at AIN1.

When the SB1 button is pressed, the program displays a minus sign in all digits of the indicator, and after releasing it, it starts counting from zero. If the meter's power is turned off while the button is pressed, the current result will not be written to the EEPROM, and the value stored there will remain the same.

The program is designed in such a way that it can be easily adapted to a meter with other indicators (for example, with common cathodes), with a different printed circuit board layout, etc. A slight correction of the program will also be required when using a quartz resonator for a frequency that differs by more than 1 MHz from the specified one.

When the source voltage is 15 V, measure the voltage at pins 12 and 13 of the microcontroller panel relative to the common wire (pin 10). The first should be in the range of 4...4.5 V, and the second should be more than 3.5 V, but less than the first. Next, the source voltage is gradually reduced. When it drops to 9... 10 V, the difference in voltage values ​​at pins 12 and 13 should become zero and then change sign.

Now you can install the programmed microcontroller into the panel, connect the transformer and apply power to it mains voltage. After 1.5...2 s you need to press the SB1 button. The counter indicator will display the number 0. If nothing is displayed on the indicator, check the voltage values ​​at the AIN0.AIN1 inputs of the microcontroller again. The first must be greater than the second.





When the counter has been successfully launched, all that remains is to check the correctness of the count by alternately shading the phototransistors with a plate opaque to IR rays. For greater contrast, it is advisable to cover the indicators with a red organic glass filter.



Also, if anyone assembles a meter on Atiny2313 without quartz,
I programmed the fuses like this



ASM source
Firmware

Many household appliances and industrial automation devices of relatively recent production years have mechanical counters installed. They are products on a conveyor belt, turns of wire in winding machines, etc. In the event of a failure, finding a similar meter is not easy, and it is impossible to repair due to the lack of spare parts. The author proposes to replace the mechanical counter with an electronic one. An electronic counter, developed to replace a mechanical one, turns out to be too complex if it is built on microcircuits with a low and medium degree of integration (for example, the K176, K561 series). especially if a reverse account is needed. And in order to maintain the result when the power is turned off, it is necessary to provide a backup battery.

But you can build a counter on just one chip - a universal programmable microcontroller that includes a variety of peripheral devices and is capable of solving a very wide range of problems. Many microcontrollers have a special memory area - EEPROM. Data written into it (including during program execution), for example, the current counting result, is saved even after the power is turned off.

The proposed counter uses the Attiny2313 microcontroller from the AVR family from Almel. The device implements reverse counting, displaying the result with cancellation of insignificant

hive on a four-digit LED indicator, storing the result in EEPROM when the power is turned off. An analog comparator built into the microcontroller is used to timely detect a decrease in supply voltage. The counter remembers the counting result when the power is turned off, restoring it when turned on, and, similarly to a mechanical counter, is equipped with a reset button.

The counter circuit is shown in the figure. Six lines of port B (РВ2—РВ7) and five lines of port D (PDO, PD1, PD4—PD6) are used to organize dynamic indication of the counting result on the LED indicator HL1. The collector loads of phototransistors VT1 and VT2 are resistors built into the microcontroller and enabled by software that connect the corresponding pins of the microcontroller to its power supply circuit.

An increase in the counting result N by one occurs at the moment the optical connection between the emitting diode VD1 and the phototransistor VT1 is interrupted, which creates an increasing level difference at the INT0 input of the microcontroller. In this case, the level at the INT1 input must be low, i.e., the phototransistor VT2 must be illuminated by the emitting diode VD2. At the moment of a rising differential at the INT1 input and a low level at the INT0 input, the result will decrease by one. Other combinations of levels and their differences at the inputs INT0 and INT1 do not change the counting result.

Once the maximum value of 9999 is reached, counting continues from zero. Subtracting one from the zero value gives the result 9999. If counting down is not needed, you can exclude the emitting diode VD2 and phototransistor VT2 from the counter and connect the INT1 input of the microcontroller to the common wire. The count will only continue to increase.

As already mentioned, the detector of a decrease in supply voltage is the analog comparator built into the microcontroller. It compares the unstabilized voltage at the output of the rectifier (diode bridge VD3) with the stabilized voltage at the output of the integrated stabilizer DA1. The program cyclically checks the state of the comparator. After disconnecting the meter from the network, the voltage on the rectifier filter capacitor C1 drops, and the stabilized voltage remains unchanged for some time. Resistors R2-R4 are selected as follows. that the state of the comparator in this situation is reversed. Having detected this, the program manages to write the current counting result to the EEPROM of the microcontroller even before it stops functioning due to the power being turned off. The next time you turn it on, the program will read the number written in EERROM and display it on the indicator. Counting will continue from this value.

Due to the limited number of microcontroller pins, to connect the SB1 button, which resets the counter, pin 13 was used, which serves as the inverting analog input of the comparator (AIM) and at the same time as the “digital” input of PB1. The voltage divider (resistors R4, R5) here sets the level perceived by the microcontroller as high logical. When you press the SB1 button, it will become low. This will not affect the state of the comparator, since the voltage at the AIN0 input is still greater than that at AIN1.

When the SB1 button is pressed, the program displays a minus sign in all digits of the indicator, and after releasing it, it starts counting from zero. If the meter's power is turned off while the button is pressed, the current result will not be written to the EEPROM, and the value stored there will remain the same.

The program is designed in such a way that it can be easily adapted to a meter with other indicators (for example, with common cathodes), with a different printed circuit board layout, etc. A slight correction of the program will also be required when using a quartz resonator for a frequency that differs by more than 1 MHz from the specified one.

When the source voltage is 15 V, measure the voltage at pins 12 and 13 of the microcontroller panel relative to the common wire (pin 10). The first should be in the range of 4...4.5 V, and the second should be more than 3.5 V, but less than the first. Next, the source voltage is gradually reduced. When it drops to 9... 10 V, the difference in voltage values ​​at pins 12 and 13 should become zero and then change sign.

Now you can install the programmed microcontroller into the panel, connect the transformer and apply mains voltage to it. After 1.5...2 s you need to press the SB1 button. The counter indicator will display the number 0. If nothing is displayed on the indicator, check the voltage values ​​at the AIN0.AIN1 inputs of the microcontroller again. The first must be greater than the second.





When the counter has been successfully launched, all that remains is to check the correctness of the count by alternately shading the phototransistors with a plate opaque to IR rays. For greater contrast, it is advisable to cover the indicators with a red organic glass filter.



Also, if anyone assembles a meter on Atiny2313 without quartz,
I programmed the fuses like this

In the last article I shared with you, . The thick wire was wound manually, since it was not possible to carefully lay the coil to the coil in any other way at home. With a smaller diameter of the winding wire, a more technologically advanced method can be used, which will reduce the time and effort during winding, and also, which is important, the manufacture of the transformer will not differ from the factory version. Next will be described simple design a homemade winding machine with which you can easily wind coils, chokes, power and sound transformers.

The base (bed) of the winding machine

You can make a machine for winding transformers from any durable, easily processed material. The most suitable would be: metal, plywood (wood) or plastic. Depending on what you have available and what you like to work with most, you can give preference to one material or another.

I mostly make homemade things from what I have on hand, and in this case, in the rubble of junk called “useful around the house” I found scraps of 10 mm semi-rigid plastic, which I successfully used in the design of the winder and its elements.

Initially, during development, it is necessary to make a test layout, think through the layout of the winder, and ask yourself what necessary functions the device should perform. During the prototyping process, it is easy to add and improve, adjust the dimensions, which will allow you to get the most successful option at the end.

According to the project, we have three axes:

The first axis (winder) - the winding coil of the transformer will rotate on it. At one end there will be a counter for the number of turns made, and at the other end there will be an axle rotation drive with a set of pulleys. The drive can be manual in the form of a handle attached to an axis or electric in the form of a stepper motor.

The second axis (stacker) - the lead of the wire stacker will “run” on it, and the second set of pulleys will be attached to the axis, which will be interfaced with the first set of pulleys on the first axis through a belt drive using a belt.

The third axis (reel holder) serves as a support for the reel with winding wire.

At the design stage, it is necessary to correctly space the axes between each other so that the frame of the winding transformer coil does not cling to the machine and does not touch another axis, and also select the height of the wire coil so that you can freely hang coils of different sizes. An additional axis can be provided for winding and winding wire from reel to reel.

According to the markings on the selected material for the bed, using a hacksaw for metal, we cut out parts of the base of the machine (sides, bottom, cross members), and also drill the necessary holes. Using metal corners and self-tapping screws, we fasten all the components together.




Revolution counter for counting turns

One revolution is equal to one turn - this is how I used to calculate in my head when winding a transformer on a primitive device. With the advent of a full-fledged winding machine with a counter provided, it became much easier, but the most important thing is that when winding turns, the error rate was reduced to almost zero.

The winder under consideration uses a mechanical counter UGN-1 (SO-35) from Soviet equipment. It can be replaced with a bicycle meter or a mechanical counter from an old household tape recorder, where it measured tape consumption. You can also assemble a simple meter with your own hands, having only a calculator, a reed switch, two wires and a magnet.

Disassemble the calculator into two contacts closed by the “equal” button, solder two wires, and solder a reed switch to the ends of the wires. If you bring a magnet to the reed switch, its plates inside the glass flask will close and the calculator will simulate pressing a button. Using the 1+1 addition function of the calculator, you can count the revolutions.



Next, we attach the homemade disk to the first axis. We glue a magnet to the disk, and attach a reed switch to the machine body or bracket. We position the reed switch so that when the disk rotates, the magnet passes next to the reed switch and closes its contacts.

Using this principle, you can replace the reed switch with a limit switch, and make the disk in the form of an eccentric. The eccentric disk, rotating with its convex part, will press on the limit switch

Coil stacker

The wire layer is used for uniform winding, turn to turn, of the winding wire onto the frame of the transformer or coil being manufactured. The winding density depends on the speed at which the axes rotate, as well as on the diameter of the selected wire. The required ratio of rotation speed of the first and second axles can be achieved using pulleys and a belt drive. When the machine's well-functioning mechanism is operating, the stacker roller simultaneously moves with a certain pitch and the wire is laid on the frame of the winding transformer. It cannot be explained in a nutshell, but upon further reading of the article everything will become clear.

The design in question uses a factory-made M6 rod with a thread pitch of 1 mm. Bearings are fixed parallel to each other into the sidewalls of the winding machine bed into pre-drilled holes for them, then a pin is inserted into them. For best sliding, lubricate the bearings. A guide roller moves on the pin, through which the wire is threaded.


You can make a guide roller for laying wire yourself, having a small piece of U-shaped aluminum profile, an elongated bushing nut that matches the thread of the stud, and a feed roller with a groove in the middle.

Holes parallel to each other are drilled in the U-shaped profile. The top pair of holes is for the roller, and the bottom pair is for the extended nut. The diameter of the upper holes in the profile walls is selected along the axis on which the roller will be fixed, and the lower ones are a millimeter larger than the diameter of the stud thread. An elongated nut is tightly adjusted to fit the distance between the walls of the profile. This structure is then screwed onto the paver pin.




The stud is secured with nuts on the sides so that it can rotate without displacement. A spare pin is left on one side so that pulleys can be screwed onto it to mate the first and second axles.

Two pulleys are connected by a belt drive

The axles in the winding machine are connected to each other by a system of pulleys of different radii. The pulleys attached to the axles rotate using a belt drive. A belt is used as a belt.

— The stacker axis pulley is 100mm;

— The pulley on the axis with the attached coil (winder) is equal to the thickness of the required wire, multiplied by 100.

For example, for 0.1 mm wire, we use a 10 mm pulley on the axis of the winder. For a diameter of 0.25 wire, a 25 mm pulley.

If possible, it is better to make pulleys with a pitch of 1 mm and select them during the winding process using this formula

The error depends on the accuracy of the diameter of the manufactured pulleys and the tension of the belt. If you use a stepper motor with a gear transmission as a drive in the design instead of a belt and precisely cut pulleys, then the error can be brought closer to zero.

Now I’ll tell you how to make a pulley with your own hands at home without turning to a turner. My set of pulleys is made of the same material as the bed of the winding machine. Using a compass, I marked out the required diameters of the pulleys and added a few millimeters on the larger side to machine the groove for the belt to the required size. Holes were drilled along the contour of the markings with a screwdriver and partitions were cut between them. So I collected the required number of blanks for the pulleys. I used an unnecessary “Assistant” meat grinder as a lathe.


I don’t remember exactly, I cut a thread on the meat grinder motor shaft, or it turned out to be suitable, but a pin was screwed through a long bushing nut. A blank with a slightly larger diameter than the required pulley was screwed onto the stud through nuts and washers. The meat grinder was turned on and all the irregularities were rounded off with a metal hacksaw/file. round shape, and a needle file was used to make a groove (groove) for the belt. During the process, the diameters of the homemade pulleys were periodically checked with calipers.


Components of a winding machine and its operating principle

The elements of the winding machine were assembled slowly. Almost everything was taken from old Soviet film equipment. Moving parts: handle, axle studs, guide roller - everything is equipped with bearings. Studs, nuts, washers and angles were purchased at a hardware store. I only had to spend money on studs, long nuts and angles. Otherwise, everything is made from available materials.

To accurately select the wire winding density, a set of several pulleys is threaded onto the stacker pin. So, in the case of loose winding, it was possible to move the belt one size and adjust the speed of rotation of the axes. During the process of winding the wire, the belt is twisted depending on the direction of the winding stroke according to the figure-of-eight shape or the direct position of the belt. You should make a couple of dozen test turns to correctly adjust the pulleys to the diameter of the wire.


A base is made from wood or other material in the shape of the inside of the transformer coil and is fixed to the stud with wing nuts. You can also make universal holding corners to secure the coil. A demonstration of the operation of the winding machine is shown in the video:

[Here will be a video of the transformer winding process]





About the author:

Greetings, dear readers! My name is Max. I am convinced that almost everything can be done at home with your own hands, I am sure that everyone can do it! In my free time I like to tinker and create something new for myself and my loved ones. You will learn about this and much more in my articles!

Option 1: ATmega8 + Nokia 5110 LCD + 3V power supply

The circuit uses Atmega8-8PU (external quartz with a frequency of 8MHz), Nokia 5110 LCD and a transistor for processing pulses from a reed switch. The 3.3V voltage regulator provides power to the entire circuit.

All components were mounted on the breadboard, including connectors for: ISP programmer (USBAsp), 5110 Nokia LCD, power (5V supplied to 3.3V regulator), reed switch, reset button and a 2-pin connector used to read winding polarity machine drive motor to know whether to increase or decrease the counter.

Purpose of connectors:
J1: Power. 5V is supplied to the connector and then to the L7833 stabilizer to obtain the 3.3V voltage used by ATmega8 and LCD.
J2: LCD connector for Nokia 5110 LCD.
J3: Reed switch. Pulse input for counting by microcontroller.
J4: Polarity connector. It must be connected in parallel with the motor winding. The tracking circuit was designed for a 12-volt motor, but it can be applied to other motor voltages by adjusting the values ​​of the voltage dividers formed by R3-R4 and R5-R6. If the motor is connected to straight polarity, PD0 will have a high log. level, if the motor is connected to reverse polarity, then PD1 will have a high log. level. This information is used in the code to increment or decrement the counter.
J5: Counter reset. When you press the button, the counter will be reset.
ISP Connector: This is a 10-pin connector for the USBAsp AVR programmer.

Device diagram

Photo of the finished device


Option 2: ATmega8 + 2x16 HD44780 LCD + 5V power supply

Some of my readers have asked for a version of the counter that uses a 2x16 HD44780 display (or a smaller 1x16 variant). These displays require a 5V supply voltage, so a 3.3V stabilizer is not relevant.

Device diagram

Microcontroller configuration bits for both options: LOW - 0xFF, HIGH - 0xC9.

Archive for the article "Coil counter for winding machine"
Description:

Source code (C), firmware files for the microcontroller

File size: 111.35 KB Number of downloads: 257

It so happened that I had the urge to wind the transformer, everything would be fine, but I just didn’t have enough machine - that’s where it all started! An internet search yielded some possible options machine-tool construction, but what confused me was that the counting of turns is again done with a mechanical counter taken from a speedometer or an old tape recorder, as well as reed switches with calculators. Hm …. I had absolutely no need for mechanics, in terms of a meter, I don’t have any speedometers to disassemble, and I don’t have any extra calculators either. Yes, and as Comrade said. Serega from RadioKat: " Good electronic engineers, often bad mechanics! I may not be the best electronics engineer, but I'm certainly a lousy mechanic.

Therefore, I decided to whip up an electronic meter, and entrust the development of the entire mechanical part of the device to the family (fortunately, my father and brother are aces in mechanics).


Having assessed one place to another, I decided that 4 digits of indicators would be enough for me - that’s not a lot - not a little, but 10,000 turns. The whole mess will be controlled by a controller, but it seemed to me that my favorite ATtiny2313 and ATmega8 were absolutely not comme il faut to shove into such a worthless device, the task is simple and it needs to be solved simply. Therefore, we will use ATtiny13 - probably the most “dead” MK that is on sale today (I don’t take PICs or MCS-51 - I can only program these, but I don’t know how to write programs for them). This little girl doesn't have enough legs, so no one is stopping us from attaching shift registers to her! I decided to use a hall sensor as a speed sensor.


I sketched out a diagram:


I didn’t mention the buttons right away - but where would we be without them? As many as 4 pieces in addition to the reset (S1).

S2 - turns on the winding mode (the mode is set by default) - with each revolution of the axis with the coil it will increase the value of the number of turns by 1
S3 - winding mode, accordingly, with each revolution, it will decrease the value by 1. You can wind the maximum up to “0” - it won’t wind to minus :)
S4 - reading information stored in EEPROM.
S5 - writing the current value + mode to EEPROM.


Naturally, we must remember to press the winding button if we are going to wind the turns, otherwise they will flatten. It was possible to install 3 hall sensors or a valcoder instead of 1 and change the controller program so that it itself chooses the direction of rotation, but I think in in this case it's too much.


Now not much according to the scheme:
As you can see, there is nothing supernatural in it. All this disgrace is powered by 5V, the current consumes something in the region of 85mA.


From the TLE4905L hall sensor (you can try plugging in another one, I chose based on the principle of “whatever is cheaper and available”), the signal is sent to the controller, an interrupt is generated and the current value changes, depending on the selected mode. The controller sends information to shift registers, from which it, in turn, is sent to seven-segment indicators or to the keyboard. I used seven-segment anodes with a common cathode, I immediately had a quartet in one case, but no one bothers those who want to screw on 2 double or 4 single anodes connected in parallel. The dot on the indicators is not used; therefore, the H (dp) pin hangs in the air. The indicators operate in dynamic mode, so the resistance in R3-R9 is less than the calculated value. Drivers for indicators are assembled on transistors VT1-VT4. It was possible to use specialized microcircuits like ULN2803, but I decided on transistors, for the simple reason that I had accumulated them - “like dirt”, some of them are older than me.


Buttons S2-S4 - a la matrix keyboard. The “outputs” of the buttons hang on the same conductors as the register inputs, the fact is that after sending data from the controller to the registers, there can be a signal of any level at the SHcp and Ds inputs, and this will not affect the contents of the registers in any way. The “inputs” of the buttons hang on the outputs of the registers, the transfer of information occurs approximately as follows: first, the controller sends information to the registers for subsequent transfer to the indicators, then sends information to scan the buttons. Resistors R14-R15 are necessary to prevent “fighting” between the legs of the registers/controller. Sending information to the display and to scan the keyboard occurs at a high frequency (the internal generator in the Tini13 is set to 9.6 MHz), accordingly, no matter how quickly we try to press and release the button, during the time of pressing there will be many operations and, accordingly, the zero from the button will run towards the meeting one from the controller. Well, such an unpleasant thing as the rattling of the button contacts again.


Using resistors R16-R17, we pull our keyboard to the + power supply, so that during idle time, a 1 and not a Z state would come from the keyboard outputs to the controller inputs, which would lead to false positives. It was possible to do without these resistors; there are quite enough internal pull-up resistors in the MK, but I couldn’t bring myself to remove them - God protects the careful.


According to the scheme, that seems to be all; for those interested, I provide a list of components. Let me make a reservation right away that the denominations may differ in one direction or another.

IC1 is an ATtiny13 microcontroller, can be used with the letter V. The pinout for the SOIC version is the same as in the diagram. If anyone has a desire to use QFN/MLF in the case, the datasheet will be in their hands.
IC2-IC3 - 8-bit shift registers with a latch at the output - 74HC595, on the breadboard I used in DIP packages on the board in the finished device in SOIC. The pinout is the same.
IC4 is a digital unipolar hall sensor TLE4905L. The wiring according to the datasheet is R2 - 1k2, C2-C3 by 4n7. When installing the sensor on the machine, check which side of the magnet it responds to.
C1, C4 and C5 are power supply filtering capacitors, I installed 100n each, they should be installed as close as possible to the supply pins of the microcircuits.
R1 - with a resistor we pull the reset leg to the power supply, 300 Ohm - and so on. I bet 1k.
R3-R9 - current-limiting resistors for indicators. 33 Ohm - 100 Ohm, the higher the resistance, the correspondingly dimmer the light will be.
R10-R13 - limit the current in the transistor base circuits. On the breadboard there were 510 Ohms, and I screwed 430 Ohms into the board.
VT1-VT4 - KT315 with any letter indices, can be replaced with KT3102, KT503 and analogues.
R14-R15, as written above, to prevent “fighting”, I think you can set it from 1k and higher, but do not raise it above 4k7. With R16-R17 equal to 300 Ohms, the total resistance of series-connected resistors should not exceed 5k; during my experiments, with increasing resistance above 5k, false button responses appeared.


After checking the operation of the meter on the breadboard, it is time to assemble the piece of hardware into a “complete device”.


I laid out the board in SL, and most likely it wasn’t laid out optimally - I adjusted it to fit the existing parts, I was too lazy to go to the market to buy others. In general, I spread it out and printed it on transparent single-sided Lomond film for black and white laser printers. Printed in negative, in 2 copies. Negative - because I was going to make the PP using film photoresist, and it, in turn, is NEGATIVE. And in 2 copies - so that when combined, you get the most opaque layer of toner. I also have no desire for an aerosol can TRANSPARENT 21 buy.


We combine the photomasks, exposing them “to the light” so that the holes line up perfectly, and secure them with a regular stapler - this procedure must be approached responsibly, the quality of the future board largely depends on it.


Now we need to prepare the foil PCB. Someone rubs it with fine sandpaper, someone with an eraser, and I, in Lately, I prefer the following options:
1. If the copper is not too dirty with oxides, just wipe it with a swab dipped in ammonia - oh, stinking garbage, I’ll tell you, I don’t like this activity, but it’s quick. Ideally, the copper will not shine after this, but the alcohol will wash away the oxides and the board will be etched.
2. If the copper is quite dirty, I polish it with a felt wheel. I hang it on the drill and voila. There is no need to be particularly zealous here; I do not use GOI paste; for subsequent etching, only a felt circle is enough. Fast and efficient.
In general, we prepared it - I can’t post a photo, the infection shines like a mirror and nothing is visible in the photo, I’m also a lousy photographer.


Well, okay, then we will roll the photoresist.
I must admit that my photoresist is past its expiration date and the dog refuses to stick to the board, so I have to warm the board up first. I heat it with a hairdryer, but you can also use an iron. It would be nice, of course, to have a laminator for these purposes, but:
- the dough I feel sorry for him now
- when I didn’t mind the dough, I was just stupidly lazy :)


We roll the photoresist onto the hot board, not forgetting to remove the protective film. We try to do this as carefully as possible so that there are no air bubbles between the board and the photoresist. Fighting them later is a separate ass. If bubbles do appear, I pierce them with a needle.
You can roll in any lighting and not engage in crap, remembering amateur photographers, the main thing in our business is the absence of sunlight and other sources of ultraviolet radiation.
After knurling, I heat the board with a hot iron through a newspaper, this cures punctured bubbles, and the photoresist sticks tightly.


Next, we put the template on the board, here the board is double-sided, so the template will be on both sides of the board. We place this “sandwich” on a sheet of plexiglass and press it with the second sheet on top. 2 sheets are needed so that after one side is exposed, you can carefully turn the board over without moving the photomask.
Let's light it from the other side. I use this lamp:

I illuminate from a distance of about 150mm for 7 minutes (distance and time are selected experimentally).



Next, prepare a weak alkaline solution - a teaspoon of soda ash per half liter of water. Water temperature is not important. Stir until all the soda dissolves. This solution is not dangerous for your hands; it feels like soapy water to the touch.


We remove the protective film from our board and throw it into the solution, after which we actively begin to rub it with a brush - but do not press too hard so as not to tear off the tracks. You can, of course, not rub it, but then there is an option to wash off the photoresist:
- for a long time
- everything will be washed away
but neither one nor the other suits us, therefore three.
we get something similar:

We rinse the board with water, do not pour out the solution - we will need it later. If during the development of the board some tracks have peeled off or air bubbles have spoiled the tracks, you need to retouch these places with tsapon varnish or a special marker. Next we etch the board. I use ferric chloride.


After etching, we rinse the board again with water and throw it back into the alkaline solution to wash off the no longer needed photoresist. An hour is enough.


Next we fool around. For small circuit boards or very jewelry ones, I use Rose alloy; for circuit boards, I simply smear the tin on the board with a soldering iron with a flat tip. In this case, it makes sense to coat the board with flux; I use regular alcohol-rosin.

It may seem to some that the paths did not come out very smooth - the paths came out smooth :) this is the cost of the tinning method with a soldering iron, the tin does not lie evenly.

In the finished version there is no reset button - well, I had nowhere to stick it on the board, so there is not enough space, and if the MK freezes, then I will turn off the power and turn it on again. A diode also appeared in the power circuit - protection against polarity reversal. As for the rest of the parts, I used only those that were on hand, which is why there are both SMD and regular cases.


We attach a sensor to the stationary part of the machine, and install a magnet on the rotation axis so that when rotating it passes 3-5 mm from the sensor. Well, let's use it :)


That's all for sure now, thank you all for your attention, and comrades GP1 And Avreal for assistance in development.