Clone Pi AVR Metal Detector
Clone Pi AVR Metal Detector
As the warm weather approaches, I decided to make this, a little more serious than the old AVT metal detector (MD). Advantages – LCD, settings can be changed, no expensive parts, more stable (than AVT) at low temperatures, easy adjustment, reaches decent depth, shows battery voltage and turns off when it is too low (very useful with lead-acid). Minuses – almost all the information is in Russian, you need to program the microprocessor, the sound is a bit funny until you get used to it . The scheme was created by the Russian Andy F. I will try to describe the production in as much detail as possible, but there will be some unmentioned things. I would advise those who are completely green to touch the eyelashes first. OK, that’s enough rambling.Clone Pi AVR Metal Detector.
_______MD scheme _______
The original scheme is as follows:
I made according to the identical, only redrawn with Eagle:
The scheme is 100% working, without errors – we solder it as shown and it works immediately, even without tuning. Arrangements will be made later in the fields. Hmm what else, such an observation that it is very inconvenient to turn on the LCD lighting every time through the menu. A good idea is to build a separate connector for this. We simply solder the wires to 1 and 16 of the LCD output. Connecting them will turn on the LCD backlight. I used a JHD162A for the LCD (it’s based on the HD44780 anyway), it definitely works with the 1602A as well. With blue lighting, it looks fun, but it’s impractical, because you’ll have to keep the lighting on all the time, which wastes the already limited battery resources unnecessarily. With green lighting, you don’t even need to turn it on during the day, dark letters are visible well.
LCD Pin Values. Some of the middle conclusions will remain free. And it is important that the RW pin needs to be connected to the ground with some wire (conclusion 1). It is not needed because it is only used when reading data from the LCD.
_______PCB manufacturing _______
There are more than one version of the tablets roaming the Internet. I borrowed from Pablox . Quite intelligently laid out, small, as if someone mentioned that it does not generate like some others. It looks like this:
In other words, we send PCBs from Pachablox, open with Cadsoft Eagle software and make PCBs. There are a couple of places where the gaps between the tracks are very small, so pay attention. For convenience, I have generated a little list of parts, with small comments, convenient when you need to assemble/solder parts. Any power of the resistors, even the weakest 0.125W will do. Although I basically used 0.25W metal oxide.
Some transistors may have to be placed differently than drawn on the board, because the arrangement of the conclusions is different, but it’s okay, those legs fold out . So be sure to pay attention before soldering. What’s more, BSN304 is rare, you can’t buy them everywhere, so you can use BS170 (a little weaker, but it takes time). The loudspeaker should not be placed with anything , it should be with a high resistance. RCl has perfectly suitable ones (50ohm resistance), price 1LT. By the way, it is also possible to make a connection for headphones, at least I connected their speakers in series to get the highest possible resistance (we just connect between R and L, and leave the ground unconnected). After printing the PCB you should get something like this:
And after assembling everything, the panel should look like this (I made several MDs, so the parts are slightly different, and some were missing during the shooting):
After the soldering work, I recommend not to put microchips, but first apply 12V and test the power supplies (5V and ground) on all 3 chips .
Atmega 8 : 7 and 20 pin is +5V. Pin 8 is ground.
TL074: Pin 3 and 12 are +5V. Pin 11 is ground.
4066: Pin 3 and 4 and 5 are ground. Pin 14 is +12V.
If they are, then we collect everything to the end and go to program. If there are none, then we check whether the LM78L05 stabilizes 5 volts, and if it does not, then we check whether it is alive and whether the tracks behind it are not shorted. By the way, this MD has a diode, which is intended to prevent the MD from burning when the power poles are mixed.
_______ Programming _______
I used a cheap (few $) USBasp programmer from Ebay. Just like here , only assembled by the Chinese factory. But of course, simpler programmers connected to the COM port can also be used. It should be noted that the programming contacts on our MD board are not arranged in a very standard way. On the left we see the standard 10pin isp header pin layout, and on the right is the one we have. For this reason, we either cut the programmer wires and solder them to the MD board, or we buy a couple of flash drives and make a transition .
USBasp needs a driver, you can find it here . If everything is ok, the computer should recognize the programmer when connected to USB. I programmed eXtreme Burner – AVR software. Simple and clear, I don’t think you will find better. When programming, it is not necessary to connect the power supply to the MD, it will receive 5V from the USB port.
OK, we connect all the wires as they belong. We open eXtreme Burner. Mygiam Read All should read the blank Atmega flash. If it throws errors, check whether we connected it well. Before uploading the hex, you need to configure the Fuse Bits to prevent the Atmega from locking up. Fuse Bitus Fandy gives on their page, but I have already calculated for you. If you want it yourself, go to Fuse Bit Calculator .
We will need to enter the High and Low fuse bits. We do everything (enter E4 and D9 and put check
Fuse Bits are configured, now we can blow Hex. There are quite a few clone programs, I used one newer than 1.8.1. You can also download it on the Fandy page, or here at my place. OK, click File / Open flash, then find the file ClonePI_AVR.hex and click Write / Flash. We wait a little while it sends and if no errors are thrown, we disconnect the board from the programmer. When applying power, the letters on the screen should light up and the speaker should beep. If we haven’t connected the LCD with buttons and coil yet, the speaker should still beep. Means our MD is at least somewhat alive.
Files to download in case Pablox link clicks: pablox_pcb_softas181.zip
If we want to do everything normally, it is a good idea for the box to be more or less airtight. And it’s not a bad idea to protect the LCD from scratches and moisture with glass. The maniška got like this:
You will want to put a better connector for the coil, if there is no good contact, the MD will start cutting the mushroom. By the way, when the MD does not see the coil, when it is turned on, the Guard Interval setting will start and throw out the number 81. When everything is ok with the coil, that interval is set to approximately 4-15. Fyškė is a microphone, 4 contacts because they should not have sold two instead. I used standard DC connectors to connect the power supply, and I’m constantly cursing because they don’t make good contact.
I used acid battery 12V 1.3Ah (only 24LT). The capacity is enough for digging in the fields for a long time, after a few hours of tasting every day, I think it would last for a week. The stem is made from a 32mm thick-walled water supply pipe, and it folds as needed when heated with a construction hair dryer.
_______MD Tuning_______
In order for the MD to work normally and not to cut the mushroom, it needs to be adjusted. It’s not as simple as you’d like, because I couldn’t find normal instructions in Lithuanian, so I’m writing this as I tried it myself. You need somewhere in the meadow, where there is really no metal, to raise it on a stump and adjust R7 (1K). After each turn, you need to reset (press ZERO) the MD. You need to measure the voltage in two places with a multimeter:
- Between terminals 1-12 of TL074. It is necessary to adjust to be as close as possible to +- 0.15-0.06V
- Between pin 14 of TL074 and power negative. It is necessary to adjust to be as close as possible to 4.8-5.1V
Method 1. Turn on the MD, set the interval to auto, then adjust R7. It didn’t work out very well, because it doesn’t reach the voltage it should be. We get, let’s say, 0.4V and 3V. As a result, MD does not work very stably, sometimes it shines after being raised in the air or touching the ground, or even all the time.
Method 2. We turn on the MD, we set the guard interval not to auto, but to a specific number, and then we adjust R7 and measure the voltages. How do you know what number to enter? No way, you have to try the test method. Let’s say on my car, it was set to 5. It was best coordinated when I manually set it to 9. What will happen if we choose the wrong interval: either the voltages will not be matched, or it will light up where there is no metal, or the scanning depth will decrease significantly. When we adjust R7, we always leave the interval as we manually set it. If we put another coil, it is likely that we will need to readjust. This method worked better – MD stopped mushrooming immediately.
If anyone knows how to really tune this MD as it should, please feel free to write in the comments
When MD works poorly/unstable, you may want to try the following things of questionable effect :
- Connect headphones instead of the speaker.
- Turn on the screen lighting.
- When drying the coil, if moisture gets on the coil windings.
- Try different ground adjusts (in practice, I didn’t really feel the difference).
But if well adjusted, it can really work stably and you won’t have to look for the reason why it flashes unnecessarily.
_______MD Menu Settings_______
- Light, well, the lighting is on or off. But every time you turn on the MD, you should turn on the lighting. This is not convenient, so serious scanners have an additional button for this purpose. Oh, and in reality, this function is not really necessary – we don’t like it at night, do we?
- MD sensitivity B (barrier) can be adjusted without entering any menu by pressing + or -. 1-16 can be set. I use it for 5-8, because if you set 1 MD, it can work unstable and flash unnecessarily. And if you set it to, say, 16, the scanning depth may decrease.
- Guard interval. It will be difficult to translate here, I only know that it depends on what coil is connected. You can park your car, you can set the number. Here it depends on how we agreed.
- Ground adjust, sometimes adaptation to the ground, I have no idea how it works, I usually set it to adaptive and that’s it. You can try others – fixing and static (off).
- Volume (or the letter V with a number for the main menu) means how loud the speaker is. For me, the sound is nicer on the 7.
- Volume raise, something similar to the timbre of lighting, sounds the most beautiful on 1 equal.
-
- U min battery is the minimum battery voltage at which the MD automatically switches off. When using an acid battery, it should be set to 11.8V, which means a more or less 80% discharged battery. By the way, acid batteries are healthy to be charged as much as possible all the time.
Okay, this post turned out to be not very informative, but I’m tired of teaching the obvious from A to Z. If you’re experienced in electronics, you’ll figure it out yourself, and if you’re completely green, you won’t be able to make this MD OK, I think there will be another 3rd part where we’ll look at 3 different coils (simple/basket/metric depth)…