Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

This DIY project builds a pulse-induction metal detector around an STM32F103 “Blue Pill” board, a TL072 analog front end, an IRF740 coil driver, a rotary encoder, a buzzer and eight WS2812B LEDs. The original creator, Mirko Pavleski, reports detecting a coin at approximately 30 cm and a large metal object beyond 80 cm in air tests. Those figures are creator-reported results—not guaranteed in-ground depths—and depend on the coil, target, battery, calibration, interference and soil.

One correction is especially important: at the affected schematic connection, use PB8/B8, not PB9/B9. Verify the corrected schematic and firmware pin definitions before powering the circuit.

What you are building

The detector sends short current pulses through a search coil, interrupts the drive, and observes the coil’s decaying response. Nearby conductive or ferromagnetic objects alter that response. The STM32 samples and processes the analog signal, then drives the visual and audible indicators.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Its functional blocks are:

  • Three-cell Li-ion battery pack
  • 7805 regulator and decoupling
  • STM32F103C8/C6 controller
  • Transistor and MOSFET coil-driver stage
  • Search coil
  • TL072 analog amplifier
  • Rotary encoder with push button
  • Eight-pixel WS2812/WS2812B indicator and buzzer

The project is useful for learning pulse-induction sensing, analog signal conditioning and STM32 timing. It should not be treated as a calibrated commercial detector or as a guaranteed replacement for a field-ready instrument.

#1 Best Overall
Metal Detector Soldering Practice Kit Soldering Projects Teaching Supplies DC 3V-5V DIY Electronic DIY Kits HUAGZIMO
  • 【Product Introduction】: After installation, connect the power supply and adjust the potentiometer until it does not make any sound (when not close to metal). Place the printed board antenna close to the metal, and it should make sound at this time. After moving away from the metal, the sound should be stopped. If the sound cannot be stopped after moving away, the potentiometer should be adjusted counterclockwise slightly and tried again until it meets the requirements.
  • 【With English Installation Instructions】: This electronic kit is not a finished product, it need to be soldered by yourself. You can get detailed and clear instructions by scanning the QR code that comes with the package. If you have any questions, please contact us first for professional help.
  • 【Great Soldering Science Project】: This soldering DIY kit help you understand the basics of working with printed circuit boards and become familiar with a variety of electronic components, and practice soldering skills enjoyably for you and your kids, or students, or DIYers.
  • 【Easy to Assemble】: The connection that was clearly mapped and labeled on the board makes it easy to assemble. And you can refer the marks on PCB board to soldering each component. If it can't work after soldering, please contact us for support.
  • 【Perfect After-Sale Service】: Please read the User Manual before installing.If any components are missing, please contact us for replacements.

See the original Hackster project, its downloadable files and the creator’s demonstration video.

Pulse induction in practical terms

  1. The driver forces current through the search coil.
  2. The switching stage turns that current off.
  3. The circuit observes the coil’s decay and the analog front end amplifies the relevant change.
  4. A nearby target modifies the response through its electrical and magnetic properties.
  5. The STM32 converts the sampled response into LED and buzzer indications.

The available project descriptions do not publish enough verified firmware detail to state the exact pulse width, sampling delay, averaging count or threshold. Use the supplied sketch as the authority for those values rather than copying assumptions from another pulse-induction design.

Expected performance

The creator reports approximately 30 cm for a metal coin and more than 80 cm for a large metal object. These are air-test claims with no standardized information about target mass, orientation, repeatability, soil or interference. A large object can be detected much farther away than a small coin, so the two figures should not be compared as a universal sensitivity rating.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pulse induction can be attractive in mineralized environments and for larger targets, but this project does not provide reliable target identification, depth estimation or full automatic ground compensation. Its startup adjustment is best described as automatic sensitivity calibration.

Bill of materials

Part Role Important qualification
STM32F103C8T6 board Controller and ADC Generic Blue Pill boards differ in bootloader, regulator, oscillator and MCU marking.
STM32F103C6 Reported lower-cost alternative Check memory, package, pinout, clock and board quality before treating it as interchangeable.
TL072 Analog amplifier Its input and output range is not automatically rail-to-rail, especially from a single low-voltage supply.
Three BC847 or similar transistors Driver and signal stages Confirm package orientation and transistor pinout.
IRF740 Coil switching MOSFET Do not assume it is a logic-level MOSFET for direct 3.3 V drive. Check gate voltage, heating and switching behavior.
7805 5 V linear regulator Provide suitable capacitors and check dissipation from a charged three-cell pack.
Rotary encoder with push button Sensitivity and menu control Confirm the encoder’s A/B/button wiring against the actual sketch.
WS2812/WS2812B, eight pixels Visual indication Use a stable supply; LED switching noise can affect the analog section.
Buzzer or 8 Ω, 0.25 W speaker Audio indication Use the driver arrangement shown in the source design rather than connecting a speaker directly to an MCU pin.
Three Li-ion cells in series Approximately 12 V nominal supply A fully charged pack is higher than 12 V and requires proper 3-series charging and protection.
Resistors and capacitors Biasing, filtering and decoupling Follow the schematic values and placement.

Wind the search coil

The project describes two coil arrangements:

  • Single coil: 0.7 mm wire, approximately 20 cm diameter and 25 turns.
  • Test arrangement: two series-connected coils, approximately 12 cm and 23 cm in diameter, with 20 turns each.

These are the creator’s tested configurations, not universal optimum dimensions. Coil inductance, resistance, turn spacing, cable length and mechanical movement all affect the detector.

Rank #2
Ximimark 2Pcs Metal Detector Kit Electronic Soldering Practice Kit Non-Contact Sensor Board Module Electronic Part Metal Detector DIY DC 3V-5V 60mm
  • Buzzer start to ring and the red light indicator is on when the metal is close to the metal detector.
  • To adjust the potentiometer to affect the detection distance, the detection distance of the machine is less than 5 cm.
  • Multipurpose - Metal detector non contact module can be used in game entertainment, car detection, elevator floor control, equipment location detection.
  • Designed for Beginners:Special design for electronics starter to learn to solder electronics components. Soldering
  • Warm Reminder :DIY electronic components kit requires buyer to assemble and welding, If you don't have any soldering experience, please read the soldering instructions and use soldering tools carefully to avoid safety problem
  1. Use a rigid, nonmetallic former.
  2. Keep every turn evenly placed and mechanically secure.
  3. Avoid metal screws, staples, brackets and conductive tape near the coil.
  4. Keep the cable short where practical and prevent it from flexing.
  5. Check continuity and measure the finished coil before connecting power.
  6. Do not change diameter, turn count and wire gauge simultaneously while troubleshooting.

Critical schematic correction: PB8, not PB9

Use B8/PB8 where the corrected schematic specifies it. The project documentation identifies PB9/B9 as an error in the original schematic. A wrong connection can cause the firmware and hardware to disagree, producing failed operation or misleading troubleshooting symptoms.

Do not rely on a text-only wiring list. Compare the corrected schematic, the board labels and the firmware definitions. “B8” and “PB8” are two common ways of naming the same STM32 port pin, while the Blue Pill’s printed labels may use a shorter format. Perform a continuity check before installing the controller.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The indexed project pages do not expose a complete, verified pin table. For exact connections, use the schematic image and the downloadable metalloiskatel_2.zip archive from the project files page.

Building and powering the circuit

Keep the pulsed-current driver physically separated from the sensitive analog input wiring. Use short returns, solid decoupling and a deliberate ground layout. The MOSFET switching node can inject sharp transients into the amplifier and ADC through supply and ground impedance.

The creator describes three Li-ion cells in series as an approximately 12 V source. That is nominal voltage, not a fixed 12 V rail. A charged 3S pack can produce substantially more, increasing 7805 heat, coil-driver stress and transient amplitude.

Rank #3
Sale
Gbnryg Metal Detector for Adults Professional.
  • 5 Custom Detection Modes:Tailored for outdoor prospecting, this detector offers five practical modes to seek coins, relics and jewelry. You can activate full‑metal scan, junk‑metal rejection, custom memory storage, jewelry detection and pinpoint positioning. Powered by high‑end processing chip and ground balance system, it can detect targets buried as deep as 12 inches for stable field performance. Note: jewelry mode works best for high‑purity metals; low‑purity alloys may yield weak signals.
  • Oversized Backlit Display & Tool‑Free Assembly:Designed for beginners and seasoned hobbyists alike, the enlarged backlit LCD screen delivers sharp readouts even in dim surroundings. Soft silicone grips support relaxed single‑hand operation. The telescopic shaft enables quick assembly and disassembly within 30 seconds, convenient to stow away when your treasure‑hunting trip ends.
  • Flexible Adjustable Design for All Users:Telescoping from 24 to 52 inches, this detector suits adults and kids for family recreation or hobby prospecting. Compact folded size simplifies carrying and storage. 5‑grade sensitivity adapts to varied ground conditions, and the supportive arm rest reduces fatigue during long‑time outdoor exploration.
  • IP68 Waterproof Search Coil for Multi‑Terrain Use:Equipped with wide‑coverage IP68 waterproof search coil, it works steadily on beaches, river edges and moist soil. The large‑area coil boosts scanning efficiency for wider ground coverage. Important reminder: only the search coil is submersible; the main control unit cannot be submerged in water.
  • Full Accessory Kit for Outdoor Prospecting:Every set includes premium headphones, foldable digging tool and storage carry bag. Ready‑to‑go kit fits outdoor camping, field exploration and gifting purposes. Responsive after‑sales support is available to resolve your product‑related concerns.
  • Use matched cells and a suitable 3-series battery-management and charging system.
  • Never charge loose cells in an improvised series arrangement.
  • Insulate exposed terminals and disconnect the battery before changing coil wiring.
  • Check 7805 and IRF740 temperatures during initial operation.
  • Verify that the MOSFET receives adequate gate voltage; do not assume a 3.3 V GPIO fully switches the IRF740.
  • Confirm that the TL072 supply arrangement keeps its input and output signals within a useful range.
  • Test with the WS2812B disconnected if LED activity causes instability.

Programming the STM32 with Arduino IDE

The original project uses an Arduino-compatible STM32 workflow, but its 2023 pages do not establish the exact current package version, menu labels or upload method for every 2026 installation. Treat the following as a setup plan, then confirm the labels shown by the current STM32 board package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Bootloader-based route

  1. Identify the exact board: STM32F103C8T6 or the reported C6 alternative.
  2. Install the appropriate STM32 Arduino board support package.
  3. Select the matching board and processor variant.
  4. Confirm that the board has the required Arduino bootloader and that its boot configuration is correct.
  5. Select the upload interface specified by the installed core and board.
  6. Upload a minimal LED or serial test first.
  7. Only after that test succeeds, load the detector sketch from the project archive.
  8. If uploading stops working, restore the correct boot configuration or use a hardware programmer.

ST-LINK recovery route

An ST-LINK programmer is a practical alternative when the bootloader is missing, corrupted or unreliable. It is also useful for recovery, but the original project does not document an ST-LINK procedure, so do not present that route as part of the creator’s verified original workflow. Confirm voltage levels and the target’s programming connections before attaching it.

An STM32 running Arduino code is convenient for an Arduino user, but it is not electrically identical to an AVR Arduino. Pin mappings, timers, boot process, voltage levels and peripheral behavior remain different.

First power-up and calibration

  1. Place the coil well away from metal, tools, benches and battery hardware.
  2. Keep the coil motionless during startup.
  3. If possible, use a current-limited supply for the first test.
  4. Confirm that the LEDs, buzzer and encoder respond as expected.
  5. Check regulator and MOSFET temperature.
  6. Allow the detector to complete its automatic startup sensitivity adjustment.
  7. Only then bring a known target toward the coil.

Metal near the coil, movement during calibration, switching noise or an incorrectly wired PB8 connection can make the detector appear unstable from the beginning.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Controls and operating behavior

The documented controls include rotary-encoder sensitivity adjustment and a push-button menu. Reported menu functions include LED brightness, buzzer on/off, large- versus small-object adjustment and exit to normal operation. The source descriptions contain a duplicated “second press” in their menu explanation, so do not publish a definitive button sequence without checking the actual code in the archive.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Comidox 37/Set Sensor Assortment Kit 37 in 1 Sensor Module Starter Kit for Arduino MCU Educ(Infrared/Temperature/Avoid Obstacle/Buzzer Sensor etc)
  • One set contains 37 different sensor modules that give you a comprehensive understanding of the basics of Arduino and sensors.
  • A complete set of the most common and practical electronic components of the Arduino is the perfect choice for electronics enthusiasts.
  • Arduino enthusiasts can easily control and use these modules.
  • Including temperature sensors, water level sensors, pressure sensors,,infrared receiver modules, etc., to meet your different needs.
  • Whether you are learning Arduino or other controllers, sensors are a must, because we have to control the data, such as photoresistors, temperature sensors, infrared receiver modules, etc. are often used. This time, we put the sensors that most learners need in a suit, so that everyone can get 37 sensors at a time, which is convenient for everyone to use and learn.

After any major wiring, coil or supply change, repeat calibration away from metal. The sensitivity control changes the operating threshold or related behavior; it does not compensate for a mechanically unstable coil, a damaged driver or excessive analog noise.

Use a repeatable performance test

  1. Choose an outdoor or otherwise low-interference location.
  2. Calibrate at a fixed height with no metal near the coil.
  3. Use known targets: a coin, steel object, aluminum object and a larger ferrous object.
  4. Measure distance consistently from the coil plane or center.
  5. Approach each target in multiple orientations.
  6. Record whether the response is visual, audible or both.
  7. Repeat each distance several times.
  8. Record coil geometry, battery condition, soil and nearby electrical equipment.
  9. Separate air tests from in-ground tests.

This procedure will produce a useful result for your build without turning the creator’s 30 cm and 80 cm claims into specifications.

Troubleshooting

No upload or an apparently bricked board

  • Recheck the selected board and processor variant.
  • Confirm bootloader presence, boot configuration and upload interface.
  • Upload a minimal test program before the detector sketch.
  • Check serial-interface voltage compatibility.
  • Use ST-LINK as a recovery path if the bootloader is unavailable or corrupted.

Continuous alarm or unstable calibration

  • Remove all metal from the coil area and recalibrate.
  • Keep the coil still during startup.
  • Check battery voltage sag and regulator behavior.
  • Inspect supply decoupling and analog ground routing.
  • Shorten or shield sensitive wiring where appropriate.
  • Disconnect the WS2812B module temporarily.
  • Look for MOSFET switching noise, solder bridges and oscillation.

Poor sensitivity

  1. Confirm coil continuity, diameter, turn count and wire gauge.
  2. Verify the corrected PB8/B8 connection.
  3. Compare firmware pin definitions with the schematic.
  4. Confirm that the intended switching node drives the coil.
  5. Check MOSFET gate voltage, drain behavior and heating.
  6. Check TL072 supply voltage and signal swing.
  7. Repeat calibration away from metal.
  8. Compare against a known target at a fixed distance.

Excessive heat

Check the 7805’s input voltage and load current, especially with a charged 3S battery. Check the IRF740’s gate drive and switching losses. Disconnect power before changing the circuit; this is a pulsed-current system, not a harmless GPIO experiment.

Is this project worth building?

Build it if your goal is to learn about pulse-induction detection, STM32 firmware, analog amplification, coil construction and noise control. The inexpensive controller, encoder, LEDs and buzzer make it a useful experimental platform.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a commercial detector instead if you need a weatherproof enclosure, calibrated coils, target discrimination, reliable depth claims, ergonomic field use or predictable support. This project’s documentation is spread across several mirrors, contains a documented schematic correction and does not provide a fully maintained current Arduino setup guide.

For the original files and project context, use the Hackster page, Hackaday project page and file archive. Check the license attached to the exact code and schematic files before redistributing modified material.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.