Metal detector ATTINY2313 microcontroller
The “Zabava” (Metal detector on the ATTINY2313-20 microcontroller) uses the “frequency meter” principle. The metal detector operates in dynamic mode (it reacts to metal only when the sensor moves). There is a sensitivity adjustment. It distinguishes between ferrous and non-ferrous metals.
Technical specifications:
- Supply voltage – 9V
- Current consumption – 17-20 mA
- Detection distance (in air):
- Coin diameter 25 mm – 11-12 cm
- Copper plaque (5 x 8 cm) – 21 cm
- Aluminum lid (diameter 20 cm) – 35 cm
The firmware can be downloaded here .
Microcircuits:
- IC1 – K561LE5 (CD4001A)
- IC2 – ATTINY2313-20
- IC3-78L05
Resistors:
- R1 – 4.7k
- R2 – 10k
- R3 – 1k
- R4 – 1k
- R5 – 470оМ
- R6 – 1k trimmer
- R7 – 100oM
- R8 – 10k variable
Capacitors:
- C1, C2 – 47000 pF
- C3 – 3300 pF
- C4, C5 – 27 pF
- C6 – 100uF 16V electrolytic
- C7 – 470uF 16V electrolytic
- C8, C9 – 0.1 μF
Socket for microcontroller:
- Twenty-pin socket.
Quartz resonator:
- ZQ – 20 MHz.
“RESET” button:
- S1 – Any non-latching button.
Power switch:
- S2 – MTS-1.
Coil L1:
- The coil diameter is approximately 16 centimeters.
- Number of turns – 80.
- The wire diameter is approximately 0.3 mm.
Headphones:
- Low impedance, for player.
Headphone jack:
- External, soldered to a wire about thirty centimeters long.
Battery connector:
- Connector for a crown-type battery.
Battery:
- Battery or accumulator of the “crown” type, 9 volts.
The wire connecting the board and the coil is shielded, two-wire, approximately 1 meter long.
Double-sided, foil-coated fiberglass, 50 x 75 mm.
The power switch I use is called “MTS-1” but you can use any suitable one.
Capacitors C1, C2, C3 should have the lowest possible temperature coefficient (TKE). You can see about temperature coefficients here ( http://radiokot.ru/articles/11/ ).
The printed circuit board can be made using the technology described at: http://sdelai-sam.su/index.html#a1 The dimensions of the printed circuit board are 48mm by 75mm. Don’t forget to connect the negative bus and the lower screen layer with a jumper.
Here zabava file that you can download the printed circuit board in the format of the program “Dip Trace”.
Mirror image of the board design (for printing).
Finished board.
Mounting metal detector parts on a microcontroller
I solder the parts from the track side so as not to drill holes. Before installation, I carefully bend the ends of the leads of all the parts to increase the soldered surfaces and tin them.
Do not overheat the terminals of the components, the contact of the soldering iron with the terminal is no more than one second. This applies not only to microcircuits and transistors, but also to capacitors, switches, and headphone jacks. To ensure that the terminals are soldered well, clean them with a knife or sandpaper beforehand. The quartz resonator body must be “seized” with solder to the board or secured in some other way.
I use an external headphone jack, on a thirty-centimeter-long wire, because headphone wires are often short. Headphones, low-impedance, for a player. The board and the search coil are connected by a two-wire shielded cable, about one meter long.
The microcontroller is inserted into the socket. Carefully insert the microcontroller, if it is inserted incorrectly and the power is turned on, then most likely it will fail.
I tried to set C1, C2 with a nominal value of 4700 pF, in this version the influence of the soil is significantly weakened, and the detection distance of objects made of non-ferrous metals remains the same.
Assembly diagram.
Assembling a metal detector As a metal detector rod, you can use various handles for brushes, mops, etc. Including telescopic ones. It is desirable that the lower part of the rod is not metal.
To attach the coil, I make a structure – a ring, from steel wire with a diameter of 4 mm. As a template for forming the structure, I use a paint can with a diameter of 16 cm.
At one end of this structure I bend an “eye”. Through this eye the ring will be attached to the rod with a screw, and the output of the coil screen will be fixed there. For better contact, the eye needs to be cleaned with a file.
I insulate the other end with two layers of electrical tape to prevent the formation of a closed loop if a metal rod is used.
After the steel wire ring is attached to the rod, I use electrical tape to attach the coil to the ring. The more layers, the better.
I connect the finished board to the coil with a two-wire shielded cable one meter long. I solder the cable shield to the common bus on the board and to the output of the coil shield.
I carefully insulate the coil terminals, preventing short circuits between themselves and the screen terminal.
I attach the cable connecting the coil and the board to the rod in several places with electrical tape. It should not be too tight, but it should not dangle either.
Setting up a metal detector
During setup, there should be no metal objects near the coil and metal detector.
I set the variable resistor R4 and the trimmer R2 to the middle position. Resistor R5 to any extreme position. I connect the headphones and the battery, turn on the power.
I start to slowly rotate R5, a signal should be heard in the headphones, the frequency and volume of which should change as R5 rotates, I find a position of the resistor at which the signal volume is maximum, with further rotation the volume decreases, then the signal disappears. I leave R5 in this position.
Next, I slowly rotate the variable resistor R4, a low-frequency signal should appear in the headphones. Now, if you bring a metal object to the coil, the frequency of the signal should change. The volume of the signal can be adjusted with resistor R2.
If the signal frequency changes spontaneously and quickly, the main reasons may be the following:
- The coil turns were too tight during manufacturing, or the coil was deformed after manufacturing. To check, you need to make and connect another coil, it is possible without insulation and screen.
- The cause of frequency instability may be capacitors C1, C2, C3, resistors R1, R4, R5, R6. After tuning, it is advisable to replace resistors R5 and R6 with one constant resistor. Capacitors and resistors should have the lowest possible temperature coefficients (TKE, TKS). You can see about temperature coefficients here ( http://radiokot.ru/articles/11/ ).
- Poor contact in the power connector, or a poor quality switch.
The setup consists of setting the volume of the signal in the headphones using R6.
After turning on the power of the metal detector, you must always press the “reset” button. Before starting work, you need to tune in to the ground in the search area. Set the maximum sensitivity with resistor R8 (rotate clockwise until it stops). Bring the search coil to the ground at a distance of 1 – 2 cm (there should be no metal objects nearby) and, slightly shaking it, slowly decrease the sensitivity (rotate the regulator counterclockwise), until the signals from the ground in the headphones disappear.
When searching, the coil should be moved above the ground at a speed of approximately 0.5 m/sec, trying to maintain the distance from the ground to the coil the same all the time. In most cases, when a metal object is detected, the metal detector gives a double signal.
If the first signal was high frequency and the second was low frequency, then the object found is non-ferrous metal or iron with a large surface area. If the first signal is low frequency and the second is high frequency, then the find is a small iron object.
To determine the exact location of a non-ferrous metal object, you need to raise the coil above the ground, then lower it vertically to the ground at the supposed location of the object. If a low-frequency signal sounds when lowering, then there is no non-ferrous metal under the coil. If the coil is lowered exactly above the non-ferrous metal, then a high-frequency signal will sound. In the same way, you can examine pits, as well as areas heavily littered with small iron objects, rust, coals, etc.
At maximum sensitivity, the metal detector may constantly give false signals. This is due to unstable operation of the search generator, the reason may be in C1 and C2, in the coil or in the fragile design of the rod and sensor.
If false signals occur at sensitivity levels at which the metal detector previously worked normally, this means the battery is low.
ARCHIVE: Download from server