Spirit Pi 5 is a pulse induction (PI) detector built on the proven Clone PI-W circuit. An Arduino Nano times the pulses, and your phone is the screen and the speaker over Bluetooth. This page shows how to build it, load the firmware, set it up in the app, and what to check when something goes wrong.
The firmware and the app are new and are still being tested on real coils. If something doesn't work as described here, write to me and I'll fix it in the next update.
Have an earlier Spirit Pi? The same app screen works with it: see the earlier Spirit Pi instructions.

A pulse induction detector sends a short, strong current pulse through the coil and then listens to how fast the magnetic field dies away. Metal under the coil keeps the field alive a little longer. The detector measures that "tail" a few microseconds after each pulse, 200 times a second.
Spirit Pi 5 uses two boards based on the Clone PI-W circuit (4066 version): the analog board (coil driver, preamplifier, sample switch and integrator) and the Nano board (the Arduino Nano and the connectors). Join them pad to pad: T0–T3, U_ADC, U_REF, +12V and GND. The drawing and the table show which Nano pin each signal reaches.
Click a schematic to open it full size.
The files of my two boards: EasyEDA projects (analog and Nano boards), the toner-transfer sheets as PNG and as A4 PDF (print at 100 %, actual size), layer PDFs and parts lists. The battery meter below is not on the boards.
| Nano | Board / module | What it does |
|---|---|---|
| D7 | T0 | Coil pulse (HIGH = MOSFET on). Recommended: 10 kΩ from D7 to GND, so the MOSFET stays off while the Nano boots (my board works without it). |
| D8 | T1 | Preamp gain switch. |
| D9 | T2 | Sample switch (4066). |
| D10 | T3 | Integrator reset. |
| A0 | U_ADC | Signal from the analog board. |
| AREF | U_REF | ADC reference from the TL431 (about 4.57 V). |
| A7 | 12k / 3k | Battery voltage ÷ 5. Optional: battery meter (see below). |
| VIN · GND | +12 V · GND | Power, common ground for board, Nano and module. |
| D1 (TX) | RXD | Direct on my board, and it works. Recommended: 1 kΩ in series and 2 kΩ from RXD to GND. The module's RX is a 3.3 V input and the divider protects it from the Nano's 5 V. |
| D0 (RX) | TXD | Direct. |
| 5V · GND | VCC · GND | Module power. |
| D6 | BC547 | Speaker (optional). |
| A1, A2, A3 | buttons board | Optional, 5 buttons (table below). |
| D2–D5, D11–D13 | LEDs | Optional 7-LED bar graph. |
| A4 | STATE | Optional (HC-05 only): tells the Nano a phone is connected. |
analogRead() to it.The boards don't measure the battery voltage, and the detector works fine without it: the app shows "—" instead of the battery. If you want to see the battery level and get a warning when it runs low, add three parts to the Nano board:
BATT_WIRED 1 and write your Uref in VREF_MV (see Load the firmware). Then set the battery range in the app (step 8 of Set up the app).For using the detector without the phone. It has no PCB: build it on perfboard following the buttons board schematic above (5 buttons, 7 resistors). If you connect it, set BUTTONS_WIRED 1 in the sketch (without the board, A1–A3 float and would read false presses).
| Button | Input | Function |
|---|---|---|
| UP | A3 | Threshold + |
| DOWN | A3 (20 kΩ) | Threshold − |
| RIGHT | A1 (20 kΩ) | Volume + |
| LEFT | A1 | Volume − |
| OK | A2 | Balance. Hold 3 s: factory settings |
Download the firmware, unzip it and open spirit_pi_5/spirit_pi_5.ino in the Arduino IDE. Both files must stay in the spirit_pi_5 folder.
VREF_MV: measure Uref on the AREF pin with the multimeter and write it in millivolts (for example 4570). Only the battery meter uses it.BATT_WIRED: 1 only if you fitted the optional battery meter on A7.BUTTONS_WIRED: 1 only if you fitted the buttons.BT_STATE_WIRED: 1 only if the HC-05 STATE pin goes to A4.BT_BAUD: 38400. Leave it unless your module runs at another speed.Choose Tools › Board › Arduino AVR Boards › Arduino Nano, processor ATmega328P (or ATmega328P (Old Bootloader) if the upload fails on a clone). Unplug the Bluetooth module and upload.
Open the Serial Monitor at 38400 baud. You should see <I/SP5/1.2/2>, a <C/…> line and then about 50 <D/…> lines a second. Type ? and press Enter: it answers again with I and C.
New modules usually run at 9600 baud. Set them once with a USB-serial adapter or an Arduino sketch that passes the serial through:
AT+UART=38400,0,0.AT+BAUD6.The pairing PIN is usually 1234 or 0000.
Without the coil, power the board from 12 V. Check 5 V after the 78L05 and Uref ≈ 4.5–4.6 V on AREF. Write the exact Uref in VREF_MV if you haven't yet.
On D7 you should see a 120 µs pulse 200 times a second. D8, D9 and D10 switch just after it. With the default settings the sample (D9 LOW) starts about 17 µs after the end of the pulse and lasts 26 µs.
Connect the coil and power up again. In the Serial Monitor the first number of the <D/…> lines (the signal) should stay steady and drop when you bring a coin close to the coil. If it sits at 0 or at about 8180, the signal is saturated: see the troubleshooting section.
Install Spirit PI and choose Settings › Choose metal detector version › Spirit Pi. The same screen works with Spirit Pi 5 and with the earlier Spirit Pi: the app recognises which one is connected.
Turn the detector on and open Settings › Set bluetooth module. Tap Search, tap your HC-05 to pair it (PIN 1234 or 0000), then tap it in the paired list to use it.
Back on the detector screen, tap the connect button (left of the bottom bar). The status bar shows Connected · firmware 1.2 and the app balances automatically for one second: keep the coil still and away from metal. Tap Balance again whenever you change place or settings.
The number on the right of the bar is the threshold, selected by default. Use + and − (hold to repeat). Raise it if it beeps on nothing; lower it to reach deeper. Default: 40.
Tap the profile name in the middle of the bar (Original). The panel that opens has four starting points, Original, Coins, Depth and Mineralized ground, and every pulse setting with a slider. Changes go to the detector at once; Save keeps them in the detector after you switch it off.
You can also tap the Delay or Frequency tile in D&F and change it with + / −.

In the same panel, switch on Target ID. The app balances again, and from then on every target shows an ID from 0 to 99 under the signal value, with a class: thin (below 25), medium or thick (60 and above). The tone gets higher with the ID.
With Target ID on, tap My metals. Each metal is learned with 5 passes over the coil: tap Learn, pass the object 5 times at the same height, and the app saves its ID window. From then on the detector shows its name, for example LARGE COIN · ID 76.

If you fitted the battery meter, in Settings › Battery settings enter the voltage of your battery when full and when empty (12 V and 10 V by default). The battery percentage on the detector screen uses this range, and the app warns you at 15 %.
Pulse settings are in the panel that opens from the profile name. The firmware checks every value and limits it to protect the MOSFET and the battery.
| Setting | Default | Change it when… |
|---|---|---|
| Delay (D) | 15 µs | Shorter for small, thin targets (more sensitive to ground). Longer on mineralised ground or a wet beach. |
| Frequency (F) | 200 Hz | Higher for a faster response (more battery). The firmware lowers it if the pulse doesn't fit. |
| Coil pulse (T0) | 120 µs | Longer for more power and depth (more current). Limited to 5 % of the period. |
| Sample window (T2) | 26 µs | Longer averages more of the decay: steadier, a little less sensitive to small targets. |
| Reads per pulse | 8 | More reads = less noise, lower maximum frequency. |
| Averaging | 16 | More = steadier, slower reaction. 8 reacts twice as fast. |
| Threshold | 40 | On the bottom bar. Higher if it beeps on nothing. |
| Target ID · Late sample | off · 25 µs | Turn on to see the ID of each target. More late sample = clearer ID, weaker signal. |
| Reject ID below | off | To silence foil and other low-ID targets. |
| Reconnect automatically | on | Settings › Detection. Retries 5 times if the Bluetooth connection drops. |
| Theme | Red | Settings › Theme: red or blue. |
Start with the line of text above the bottom bar: the app writes there what it is waiting for or what it found.
Another board is selected (an ESP32, for example). Choose Arduino Nano and compile again.
The phone is connected to the module, but nothing arrives from the Nano. Check that the module was set to 38400 baud, the D0/D1 wiring (TX to RX), and that the Nano is powered and running (Serial Monitor over USB, with the module unplugged).
Pair the module first and select it in the paired list. Allow the Bluetooth permission when the app asks. Only one phone can be connected to the module at a time.
The module answers with another firmware. Load the Spirit Pi 5 firmware. An earlier Spirit Pi is recognised by itself and shows Connected · classic.
Balance with the coil still and away from metal. Then raise the threshold. On mineralised ground or a wet beach use the Mineralized ground profile or a longer delay. Check the coil cable and that the battery isn't nearly empty.
The signal reaches the end of the ADC range. Balance away from metal, raise the delay, or check the analog board (the preamp gain and Uref). A single saturated reading over a big target is normal.
Check that the coil gets the pulses (D7 and the MOSFET drain), the coil wiring and Uref. A very long delay also hides small targets: try the Original profile.
"—" means the detector doesn’t measure the battery: the optional battery meter isn’t fitted, or BATT_WIRED is 0. If the percentage is wrong: check that the 12 kΩ / 3 kΩ divider to A7 is fitted. Measure Uref on AREF and write it in VREF_MV. Then enter the full and empty voltage of your battery in the app.
The firmware limits the pulse to 5 % of the period and makes sure everything fits in it. The slider jumps back to the value the detector really uses. That protects the MOSFET and the battery.
Pass slowly, at the same height. Very weak or very deep targets give unstable IDs. Raise the late sample a little, and learn your metals again if you changed the delay, the coil or the late sample.
The detector switches to its own speaker when it doesn't hear from the app for 3 seconds, for example if the app was closed or the connection dropped. Connect again, or turn the detector's volume to 0 with the buttons.
Spirit Pi 5 is in development. Every coil and board is a little different. If a step on this page doesn't work for you, write to me and I'll fix it in the next update.
Please include: