How to make a nitrate tester with your own hands?

The problem of testing a newly installed local network is always relevant. Once upon a time I came across a piece of hardware called “Rapport II”, which, generally speaking, is a tester for CCTV systems, but it can also dial twisted pair cables. That piece of hardware died a long time ago, but the impression remains: when testing a twisted pair cable, it showed not just polarity reversal and uncoupling, but an exact crimping pattern! For example, for a crossover it looked like 1 → 3, 2 → 6, 3 → 1, and so on. But to pay about 800 non-Russian rubles for a device in which I will actually use only one function? Excuse me! How does it work, maybe it’s easier to do it yourself? Google in hand, and... complete disappointment. The search output consists of 80% of LED flashers on a shift register / AVR / PIC / your own version, and 20% of thoughtful discussions of forum gurus on the topic “buy %name_cool_hardware_for_100499.99_evergreen% and don’t worry.” Therefore, I want to offer the habra community my solution to this problem in DIY style. If anyone is interested, please see the cut below (be careful, there are a lot of photos!).

Hardware

Operating principle: the response part is a set of resistances of various values. Let's measure them. Knowing their ratings and the wiring of the mating part, we can find out exactly how the cable is crossed. Below is a diagram of the device (all illustrations are clickable). Specific resistance values ​​were chosen based on availability in the store rather than deliberately, although a piece of the Fibonacci series was obtained.


Rice. 1. Tester circuit


Rice.
2. Scheme of the response part The heart of the circuit is the ATMega16 microcontroller. Why him? The “AVR vs PIC” debate is a typical holivar, so I’ll simply say: let AVR be my arbitrariness. And of their entire line, Mega16 is the cheapest crystal, having an on-board ADC for 8 channels. I frankly didn’t want to complicate the circuit with analog signal switches. An important plus: this model can be bought even in my castle, where there is one electronic components store in the whole city with prices at 150-500% of Moscow.

Port A of the microcontroller is the ADC inputs, on port B we have an ISP and a couple of service functions, port C is used to generate test signals, and port D is for communicating with the user via an HD44780-compatible display.

We power the circuit from a Krona battery, through a stabilizer LP2950, ​​DA1 according to the circuit. Why not PWM, but a regular linear stabilizer, albeit a low-dropout one? The current consumption is small, I carried out all the testing and debugging of the circuit on one battery, I already launched a couple of real objects with fifty ports each - until it ran out. But high-frequency interference, which is a companion to any PWM, can reduce the accuracy of the ADC. Again, I don’t want to complicate the scheme. Why LP2950? He was in the store.

We will protect the input circuits using suppressors VD1.1 - VD1.8, I took 1.5KE6.8CA. Of course, they won’t save you from getting into 220V, but they can quite easily extinguish 60V from some telephone line.

The VD2 - R4 chain is used to detect low battery. The zener diode drops 5.1V. Thus, when the battery voltage drops below 6V, a log will appear on PB2. 0. A Schmitt trigger would have been needed here, but there was none.

We display information using an HD44780-compatible display; I came across WH-1604A-YYH-CT#. The connection diagram is typical and does not require any explanation. It is worth mentioning only the resistance value R5, which sets the brightness of the backlight. The higher the rating, the longer the battery will live - the rest of the circuit consumes less than 5 mA, the main consumer is the display backlight. But if you overdo it, you won't be able to see anything on the screen in the dark. I settled on 100 ohms.

Software part

To write the program, I used the AVR Studio 4 environment, C language. Below I will describe the algorithm of work, but I will not show the code, and there are reasons for this.
First of all, it's kind of creepy (the picture of the horse vomiting rainbows). Secondly, since this is DIY, then it’s not a sin to write the implementation of the algorithms described below yourself - otherwise, what kind of DIY is this? Well, thirdly, if you don’t want to write, then compiled .hex is present in applications. I don’t see any point in describing standard procedures such as working with an ADC, implementing exchange with an HD44780-compatible display, and similar obvious things. Everything was said long ago before me.

The tester's work is divided into several stages, which are repeated cyclically.

Stage 1: Initial checks

  • Let's check if any active equipment is connected to the line. We transfer all control lines (port C, let me remind you) to the Hi-Z state, measure the voltage on all lines. They should be near zero. Otherwise, we understand that anything is connected on the other side of the wire, but not our counterpart, and there is no point in continuing further. But it makes sense to inform the user that “there is voltage on the line!”
  • Let's check the signal level on PB2. If there is 0, then the battery is discharged. We will report the problem to the user, if everything is OK, move on.

Stage 2. Checking the integrity of the lines and the presence of short circuits

For each of the 8 lines we do the following. We supply +5V to it from port C, keeping all other lines of the port in a high-impedance state, and measure the voltage on the remaining lines. If all lines have near-zero values, the line under study is broken. If +5V also appears on one of the lines, this is a short circuit. Normally, we will see some intermediate values.

Stage 3. Determining the cross-connection scheme

Now we get to the most interesting part.
Having weeded out all obviously faulty lines (broken and shorted wires), we proceed to measuring the resistance of the remaining lines (let their number be N, 0 <= N <= 8). Let's introduce the notation: Rxy is the resistance between lines x and y. Rx is the value of the resistance connected to line x. It is clear that Rxy = Rx + Ry By measuring the resistance between the lines, we obtain a system of linear equations. By comparing the obtained values ​​of R1... RN with the reference ones, we will find out the cross-connection scheme.

Resistance is easy to calculate. Let's apply a high level to line X, a low level to line Y, and leave the other lines of port C in Hi-Z. In the circuit (see Fig. 3), the voltage drop across the known resistance formed by the parallel connection of R1.Y and R2.Y according to the circuit is U1, and at the unknown Rxy it drops (U2 - U1). This means Rxy = (R1 || R2) * (U2 - U1) / U1. Rice. 3. Resistance measurement principle

If N < 3, we are powerless. We can make only one measurement of the resistance between them, while we have 2 unknowns - the resistance connected to each of them. A system in which the number of equations is less than the number of unknowns has an infinite number of solutions. The user will have to show the question marks on these lines - they seem to be working, but it is not possible to figure out the cross-connection scheme.

When N = 3 we have only one possible option. By measuring all available resistances R12, R13, R23, we get the system: R1 + R2 = R12 R1 + R3 = R13 R2 + R3 = R23 It is easy to show that: R1 = 1/2 * (R12+ R13 - R23) R2 = R12 - R1 R3 = R13 - R1.

When b o

At higher values ​​of N, we can compose a system of equations in many ways, taking measurements of various resistances Rxy. At first glance, there is no difference in how to choose which resistances to measure. However, the devil is in the details. Using the example of N = 8, I will explain what I mean. In the first implementation of the algorithm, I made measurements like this: R1 + R2 = R12 R1 + R3 = R13 ... R1 + R8 = R18 R2 + R3 = R23 Adding the first two equations and subtracting the last, we get the same thing 2R1 = R12 + R13 - R23, and we will find all other resistances from equations 1 - 7, where R1 is already known.

The problem lies in the fact that with some types of cross-connection, the value of R1 turned out to be large (15 kOhm and above), and the error in measuring resistance increases with its increase. As a result, it turned out that small resistances relative to R1 with a nominal value of 1-2 kOhm were measured with an error of 70-80%! Obviously, to ensure good accuracy, we should compose the system so that in place of R1 there is another unknown, the smallest of all. To do this, we will have to perform all possible measurements (it’s good that there are not many of them, in the worst case 28). In fact, we got an 8 x 8 matrix, symmetrical about the main diagonal (clearly, Rxy = Ryx). Let us choose the minimum one from all the results, let it be Rij = Ri + Rj. In line i we find Rik, such that Rik > Rij, but less than other elements of the line. We get: Ri + Rj = Rij Ri + Rk = Rik Rj + Rk = Rjk We solve and find the smallest among Ri, Rj, Rk (let’s assume it turned out to be Ri). the remaining unknowns Rx are found from Rx = Rix - Ri.

Stage 4. Determining the break point, if any

Smart and expensive hardware measures the distance to the break point using TDR.
Difficult, expensive, cool. Our capabilities are much more modest, and it’s not very often that we need to know the position of a cliff down to centimeters - usually an understanding in the style of “right next to me”, “at the other end”, “in the middle where the wall was recently hollowed out” is more than enough. So - measuring the cable capacitance. We convert all lines of port C, except the one connected in the core where there is a break, to Hi-Z. We apply +5V to the core, charging it. Let's measure the voltage on it, this will be our initial U0. Convert all lines to Hi-Z. The cable discharge begins through resistor R2.X with a resistance of 1 MOhm. After waiting 1 ms, we measure the voltage on this line U.

We must not forget that the circuits on the board, connector, etc. also have their own capacity, so the device needs to be calibrated on a couple of pieces of cable of different lengths. I got 1710 pF at zero length, and the cable capacitance was 35 pF / m. Practice has shown that even if it lies, it’s not much, by 10 percent. A situation like “where did you miss the contact, in the closet on the patch panel or in the socket? solved instantly.

Probes and testers

Homemade device for testing zener diodes
It is not always possible to determine the rated voltage of a zener diode by its marking, especially when disassembling faulty equipment. Here is a description of the circuit of a simple device, with the help of which you can quickly determine the stabilization voltage of the zener diode, as well as generally understand ...

2 2253 0

Probe for checking LEDs and their bars

When repairing the LED backlight of an LCD TV screen, a special power supply with adjustable output voltage is required. Instead, I propose a simple probe based on a 230 V, 15 W incandescent lamp from a refrigerator. If you connect at least one lamp in series with such a lamp...

1 1212 0

Testing transistors with short leads, adapter circuit board

It is almost impossible to measure the transfer coefficient of the base current of transistors with digital multimeters of popular models if the length of the leads of these transistors is not sufficient to insert them into the sockets of the device socket. But today radio amateurs often use just such...

0 819 0

Diagram of a homemade device for testing varistors and zener diodes

Schematic diagram of a simple homemade device for testing zener diodes and varistors. The device is an improved combined version of the design [1, 2]. In addition to testing varistors and zener diodes, this device can also be used to check the performance of...

1 1634 0

Probe circuit with 8X8 oscilloscope indicator

Schematic diagram of a homemade oscilloscope indicator for simple checks, contains a display of 8X8 LEDs. Service and laboratory oscilloscopes produced in the 70s and 80s, available to most radio amateurs, have high accuracy and sufficient functionality. But they are too...

2 2021 0

Hidden wiring finder powered by a charged capacitor

A diagram of a homemade device for searching hidden electrical wiring of a 220 V AC network. It differs from many similar ones in that it does not require its own power source or any other devices or measuring instruments. When creating this simple device there was...

1 1334 0

Logic probe based on op-amp and LEDs

Circuit of a homemade logic probe, which can be used to determine logical levels, high-resistance state and the presence of pulse sequences in circuits on TTL and CMOS chips with a power supply from 5 to 15V. Indication on two LEDs - HL1 lights up when the logic level is high, HL2 ...

1 998 0

Zener diode operating voltage tester and determiner

Diagram of a homemade multimeter attachment to determine the serviceability and voltage of zener diodes. Now the Russian radio amateur has access to the element base of a wide variety of companies and countries of origin. On the one hand, this is good, but on the other, it can be very difficult to find the right one, even a short one...

1 1845 0

Probe circuit, low frequency generator (10 Hz - 10 kHz)

Circuit of a homemade generator of low-frequency rectangular pulses, the frequency and amplitude of which can be adjusted within a wide range. The figure shows a diagram of such a generator. The frequency of the pulses it generates can be smoothly adjusted from 10 Hz to 10 kHz, and the amplitude from logical ...

1 1411 0

Tester for online testing of galvanic cells

Nowadays, the market is filled with a wide variety of batteries: expensive, cheap, good and not so good, fresh and not quite. To be specific, we will further refer to the word “battery” as a 1.5 V galvanic cell of standard sizes from AAA to D; other types will be considered in this article...

1 1916 0

1 …

Rating
( 2 ratings, average 4.5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]