For the first test, I plugged the stripped enameled copper wire directly into the breadboard, uploaded the Serial_Output sketch, and left the setup to run on my dining room table for an hour and twenty minutes. At that point I was using the original example sketch, which didn't print out a timestamp (just the frequencies). At first all the frequencies were reading zero; when I unplugged and replugged in some wires on the breadboard, it started working.
The frequencies were erratic at first, then rose sharply. After about a minute, they stabilized near 86 kHz (DZL's circuit oscillated at about 160 kHz). However, the frequencies continued to increase very gradually over the rest of the test:
So while the signal didn't break down in the way the commentor described, it wasn't exactly stable either, increasing at a rate of approximately 3.5 Hz per minute (a range of about 12 Hz).
For the next test, I used the same coil and the same setup. I let the circuit run for about an hour then slowly introduced a bag of coins. The coins started 12 in above the coil, and were lowered down to be level with the coil, then raised back up to 12 in. The process took place over a 15 second period. During the uninterrupted portion of the test, the frequencies varied more erratically, not showing the steady gradual increase seen in the first test:
During the coin test, there was a very slight increase in frequency when the coins were within an inch and a half of the coil:
This shows that the circuit is fundamentally working, but it didn't have a very impressive range. Many of the other metal detector tutorials I read recommended using 70 or more turns of wire in the search coil, while DZL only used 30. I also thought that since I had to push in the wires every time to get the circuit to work, it might help to solder hookup wire onto the ends of the enameled copper wire, to get a more reliable electrical connection. I decided to first test adding hookup wire to the ends of the enameled copper.
Hookup wire is a thicker wire, usually 22 AWG, that is commonly used with breadboards. I stripped a little insulation from the ends of the hookup wire (I used nail clippers, since the wire strippers I had were the wrong size for 22 AWG). Then I wrapped the end of the enameled copper wire (with enamel removed) around the the hookup wire 7 or 8 times, and covered the connection with solder. I then repeated the last test, running the circuit for an hour uninterrupted, then lowering the bag of coins towards the coil (from 12 in) over a 15 second period. After the initial increase (from seconds 0 to 50), the frequency was remarkably stable, ranging between 86.873 kHz and 86.892 kHz (a range of 19 Hz) over the next four minutes.
Later on, the frequency looked more erratic...
This graph shows the 585 Hz drop and the peak from the coins. |
The increase in frequency during the coin test is noticeable during the seconds marked 33 to 41 on the following graph:
The bag of coins was lowered the same way as in the previous tests, moving 24 inches over approximately 15 seconds. The frequency change was noticeable over an 8 second period, which suggests the coil can detect the bag of coins when it is within 5 or 6 inches.
For the next test, I constructed a new 30 cm coil, this time with about 70 turns of wire. The first change I noticed was that the frequency of this coil was lower, around 41 kHz instead of 86 kHz. After the initial ramp-up,
the frequency was quite stable, increasing linearly and very gradually:
If we divide the thirty minutes between the ramp-up (first five minutes) and the last 10 minutes (which include the coin test) into three ten minute periods, the frequency varied by 15 Hz, 28 Hz, and then 5 Hz. This is comparable to the stability of the first coil, but without the erratic jumps and dips in frequency- throughout that half-hour period, the frequency changes linearly, which could make this signal easier to work with than the signal generated by the first coil.
For this test, I had added the timestamp to the Arduino code (this version of the code can be found here), so that I could more accurately time the coin test. I held the bottom of the bag of coins level with each inch mark on the ruler for ten seconds before lowering or raising it:
As the graph shows, there are four recognizable "levels" on each side of the peak, which means that the coil was able to detect the bag when it was within 4 inches of the top of the coil. Since DZL says that his metal detector was able to find a single coin at a depth of almost 6 inches, it's clear that mine is not measuring up.
However, I do think it will improve with better code. In this post, when I say that the coil detected the bag, what I really mean is that I, looking at the graph with the naked eye, detected a change in frequency. For example, if the program can get a more sophisticated idea of the default frequency (for example, by taking a running average of the previous minute(s)), it would be able to distinguish between noise and small changes introduced by the presence of metal. At some point I'll return to the metal detector and work on improving the code, but for the moment I've switched gears and am going to focus on drivetrains for a while.
Hello Sarah. I'm building the exact same metal detector for a hobby project. Thanks for the tip on the FreqCount library. One thing I did which helped to reduce interference and fluctuations was to wrap the search coil in tinfoil and connect it to the GND.
ReplyDeleteOh cool! I'll have to try that when I get a chance. Thanks for the tip!
DeleteI noticed during Test 3 that the graph suddenly drops 585 Hz but the room was undisturbed. Was the bag of coins in a clear material? Is it possible that one of the coins dropped? The noise my metal detector makes when a coin is flat sounds different than the noise triggered by a coin on edge.
ReplyDeleteBrandi Bradley @ Rotax Metals
The coins were in a ziploc bag for all the tests, but at the time of the 585 Hz drop the coins weren't near the coil since I was still waiting for the frequencies to stabilize. The coins would have been at least 3-4 feet away, and might have been in a different room (I don't remember exactly, since it was almost a year ago).
Delete