Pulse PI-AR metal detector based on STM32f1

Pulse PI-AR metal detector based on stm32f103c8t6 microcontroller. The name is taken from the words PI – pulse principle of operation, AR – abbreviated from ARM microcontroller. The software is developed in the Arduino environment. Metal detector parameters, coin detection by air, 25 mm to 25 cm, large objects up to 200 cm. The schematic diagram is shown in Fig.

Pulse metal detector STM32f1

The principle of operation is the same as for all pulse metal detectors. A short current pulse is applied to the L1 search coil, (120 μs in this case) inducing eddy currents in the target. With a sharp interruption of the pulse, an EMF of self-induction occurs in the coil and these eddy currents increase the decay time of the self-induction pulse, then the signal is amplified by the analog part and recorded by the microcontroller. The figures show oscillograms, the first without metal in the field of view of the coil, the second with metal. The first channel of the oscilloscope, the output from the coil through the limiting circuit R5, D1, D2. The second channel is an input to the microcontroller contact (A0).

oscillogram without metal

Pulse metal detector STM32f1

The pulse to the L1 coil is fed through the T1 transistor, which is controlled by the B9 circuit (contact of the STM32 board), R6, T2, R1, R2. Resistor R5 and diodes D1, D2 limit the self-induction voltage of the L1 coil to 2 volts. The analog part is made on an operational amplifier DA1 (TL072) and a transistor T3, the latter serves to amplify and match the levels with a 3.3 volt microcontroller. Then the signal goes to the input (A0) of the STM32F103C8T6 microcontroller, where the timer is captured from (1) to (0) and after processing the signal, the value is displayed on the indicator. This microcontroller was chosen because of its speed, which is very important in this case (I didn’t want to complicate the analog part, when it can be processed digitally), and the support of this board in ARDUINO. The indication is made on a ready-made WS2812B module of eight LEDs and a buzzer with a supply voltage of 5 volts. Control is carried out using an encoder (setting the sensitivity, brightness, turning off and on the buzzer, increasing, decreasing the detection depth and expanding the display scale.)

Making a coil

The coil is wound with a 0.7 mm wire, on a mandrel 200 mm, 25 turns, then tightly twisted with a thread. The coil body is made of 5 mm thick PVC sheet and glued with PVC pipe glue. 

  coil body manufacturing

Pulse metal detector STM32f1

Pulse metal detector STM32f1

The rod

The rod is made of PVC pipes connected with glue. These pipes have good rigidity compared to those that are soldered, well, and are lighter in weight.

   Pulse metal detector STM32f1

Software

In the ARDUINO environment, you need to download the library for STM32 boards, then install support for 32-bit CORTEX M3 boards in the board manager. Then select the Generic STM32F103C series board. Select a programmer (I used the ST-LINK programmer). The sketch for the firmware is attached in the archive. Everything is commented in the sketch so that everything should be clear.

Power supply

As a power source, I used a POWER-BANK 10 Ah and a DC-DC step-up converter. Since the POWER-BANK did not want to work with it, (the protection worked) I soldered the wires directly to the batteries, the output turned out to be 3.7 – 4.2 volts. In this case must be used EXTREMELY CAREFULLY !!!  from a short circuit, batteries can explode and prevent a discharge below 2.7 volts (you cannot do this !!!, you need to put additional protection). Further, we set a voltage of 12 volts at the output of the DC converter. At the moment of power-up (while the microcontroller is initializing), the T1 transistor was open and the DC converter did not start, for this, a resistor R4 was added.

Pulse metal detector STM32f1

Pulse metal detector STM32f1

DC – DC boost converter MT3608.

Pulse metal detector STM32f1

Pulse metal detector STM32f1

Here I put a power filter (just in case).

Pulse metal detector STM32f1

Current consumption at the time of operation is 80 milliamperes.

Pulse metal detector STM32f1

PCB making 

To manufacture the block itself, we need a ready-made board with an STM32F103C8T6 microcontroller, an encoder, a 5-volt buzzer, an LED module of 8 WS2812B LEDs in the form of a strip or circle, and radio elements indicated in the list.

Pulse metal detector STM32f1

The printed circuit board is made in Sprint-Layout software .

Pulse metal detector STM32f1

Pulse metal detector STM32f1

Pulse metal detector STM32f1

Pulse metal detector STM32f1

Assembled. Here, instead of R7, R8 and R10, R11 put trimmer resistors to adjust for maximum sensitivity.

Pulse metal detector STM32f1

Customization

A properly assembled circuit does not need adjustment. Instead of R10, R11 put a 10 kΩ trimmer resistor, the best option is R10 – 3 kΩ, R11 – 7 kΩ. Instead of R7 and R8, I also put a 100 kΩ trimmer resistor. The best option is R7 – 18 kOhm, R8 – 82 kOhm. All adjustments were made at a supply voltage of 12 volts. Connectors for connecting the coil and power supply should be set more powerful, such as in the photo will not work (affects the sensitivity and false alarms), but it is better to solder on a straight line. I redid it in this photo.

Pulse metal detector STM32f1

Working with the metal detector

When turning on the power, the search coil must be moved away from metal objects as the sensitivity is automatically adjusted. Further, the sensitivity of the metal detector is adjusted manually by rotating the encoder knob. There is also a menu mode. The first press on the encoder knob, we enter the LED brightness adjustment mode. The second press, the mode of turning on, turning off the buzzer. The third press, the mode of adjusting the depth of target detection, decrease or increase the pulse duration per coil, from 120 to 50 μs (default 120 μs). The fourth press, we enter the adjustment mode for large or small objects, expand the display scale (by default at the minimum, more sensitive). The fifth press, exit the menu mode and auto-adjust the sensitivity (move away from the metal). 

Complete metal detector.

Pulse metal detector STM32f1

Video demo

List of radioelements

DesignationType ofDenominationQuantityNote
T1MOSFET transistor
IRF740
1
T2, T3, T4Bipolar transistor
BC547
3
VR1Linear regulator
L7805AB
1
IC1MK STM32
STM32F103C8
1
R1Resistor6.8 kΩ1smd 1206
R2Resistor
20 ohm
1smd 1206
R3Resistor
390 Ohm
12W
R4Resistor
10 kΩ
1smd 1206
R5Resistor
620 Ohm
21W
R6, R13Resistor3.9 kΩ1smd 1206
R7Resistor
18 kΩ
1smd 1206
R8Resistor
82 k Ohm
1smd 1206
R9Resistor
1 mΩ
1smd 1206
R10Resistor3.6 kΩ1smd 1206
R11Resistor7.5 kΩ1smd 1206
R12Resistor
1 kΩ
2smd 1206
R14Resistor1001smd 1206
C1, C5, C6Capacitor100n3smd 1206
C2Capacitor3300 uf125 in
C3Capacitor1 uf116 in
C4Capacitor10 uf1
C7Capacitor2200 uf110 in
C8Capacitor1000 uf110 in
VD1, VD2Diode1N48412
DA1Operational amplifierTL 0721

Attached files:

error: Content is protected !!