Recycling of the Kolokolov-Shchedrin deep-water scheme. Differences from the original scheme:
1. There is NO crystal oscillator on the k561 .. chip and 32 kHz quartz. The 32 kHz signal gives the Arduino Pro Mini.
2. Sound notification circuits on several 561 series microcircuits are also not present, Arduino is also voicing the target (And I must say, it is excellent voicing, in comparison with the author's scheme).
3. Powered by unipolar voltage 12v (lead-acid battery).
4. Adjust the sensitivity with the buttons. With the ADC scale from 0 to 1023, the response threshold is adjustable from 1 to 38 (the value can easily be changed in the sketch).
Most importantly, I wanted to show in this article that it is possible to assemble MDs on Arduino not inferior to the original in sensitivity (this worked out, because the originals of the original circuit were collected on the order of 10 pieces, so there is material for comparison). Original circuit:
When I first started working with Arduino, I was so enthusiastic that I thought I could find and assemble any Metal Detector circuitry from the Internet on Arduino that I could easily find in the vast garbage dump. In principle, it turned out that way, but the circuits were based on a frequency counter, which did not allow achieving a really good range. Some children's toys and a test of the pen + attempts to make money on beginners. The original of this MD is a real workhorse that allows you to find large objects at a distance of 2m (see the Kolokolov-Shchedrin book in Google). There are no statistics on the transformed md. I hope she appears with the support of fans of MD and Arduino. The scheme worked with Arduino Uno and Arduino Pro Mini.
Further on the link is laid out the process of the birth of this MD on the website of the Soldering Iron, which lasted more than one year and pushed the author to study programming duin. Perhaps the sketch will seem wretched to someone - I will gladly accept your FIXES.
At the moment, there is a sketch that allows you to adjust the sensitivity barrier (pin 7 douins +1 to the barrier, pin 8 -1 to the barrier). .
Arduino about mini 5v, 16MHz, ATmega168 and the display used these. Next to the scale is the Mini SD- adapter
As already said 1602 costs 86 rubles, ProMini - 82 rubles. If you wish, you can generally take a naked ATmega168, develop a board for it and fill the sketch directly into it.And so, for example, I installed mom-dad on the MD board using the connector. The photo shows Arduino's 6-pin plug, through which sketches were poured directly on the board.
Sketch-MD.Rx-Tx.ProMini.SrednjajaTochkaRegBar.ino
// A3 analog input for voltmeter
// A4 analog input for signal
// 6- conclusion of the zook
// 9 - output frequency 31200 Hz
#include
Liquid Crystal lcd (12, 11, 5, 4, 3, 2);
byte z1 [8] = {// battery icon
0b01100, 0b11110, 0b11110, 0b11110, 0b11110, 0b11110, 0b11110};
int countleds = 0; // variable to store the scale level value
int voltag = 0; // variable to store the voltage value
int noll = 0; // variable to store the midpoint value
#define NUM_SAMPLES 10 // 10 analog samples to read in 1 second
int sum = 0; // sum of samples taken
int sun = 0; // same, but divided by 10
unsigned char sample_count = 0; // current sample number with
float voltage = 0.0; // calculated voltage
const int button1 = 7; // barrier plus button
const int button2 = 8; // barrier-minus button
int i = 5; // barrier
void setup () {
lcd.begin (16, 2); // display initialization
lcd.setCursor (1, 0);
lcd.setCursor (10, 1);
lcd.print ("Rx-Tx");
delay (3000);
lcd.clear ();
TCCR1A = TCCR1A & amp; 0xe0 | 2;
TCCR1B = TCCR1B & amp; 0xe0 | 0x09;
analogWrite (9, 126); // at pin 10 PWM = 50% f = 31200Hz
lcd.createChar (1, z1);
}
void loop () {
int buttonState1 = HIGH; // The state of the button is one
int buttonState2 = HIGH; // Two button state
sample_count = 0; // reset the contour of the number of additions
sum = 0; // reset the sum of 10 additions
while (sample_count & lt; NUM_SAMPLES) {
sum + = analogRead (A4); // the next measurement is added to the sum
sample_count ++; // the unit is added to the measurement number
sun = sum / 10;} // find the average value from 10 measurements
noll = analogRead (A3) / 2; // midpoint power
float voltage = map (analogRead (A3), 0,1023,0,1500) /100.0;
// Voltmeter built at input A3
if (sun & gt; = noll + i) {countleds = map (sun, noll + i, noll * 2 - 250, 9, 14);
// if the received result is on the 9-15th segment of the scale
tone (6, countleds * 100);}
if (sun & lt; = noll - i) {countleds = map (sun, 116, noll - i, 0, 7);
// if the resulting result is 0-7 segment of the scale
tone (6, countleds * 50); }
if (sun & lt; noll & amp; & amp; sun & gt; = noll - (i-1)) {countleds = 7;
noTone (6); } // islet of virtual ZERO (7 segment)
if (sun & gt; noll & amp; & amp; sun & lt; = noll + (i-1)) {countleds = 8;
noTone (6); } // island of virtual ZERO scale (8 segment)
{lcd.setCursor (countleds, 0); // set the cursor to the countleds column, line 0
lcd.print ("\ xff"); // filled icon
lcd.setCursor (0, 1); // move to 2 row, column-0
lcd.print (char (1)); // Battery Icon Indication
lcd.setCursor (1, 1); // move to voltage indication
lcd.print (voltage); // voltage
lcd.setCursor (7, 0); // 8th column 1st row
if (sun & lt; noll) {lcd.print ("{");} // print
lcd.setCursor (8, 0); // 9th column 1st row
if (sun & gt; noll) {lcd.print ("}");} // print
lcd.setCursor (7, 1);
lcd.print ("B =");
lcd.setCursor (9, 1); // 11 column 2nd row
lcd.print (i); // barrier
lcd.setCursor (13, 1); // 13th column 2nd row
lcd.print (sun); // print the average value of the ADC value
delay (100); // we wait
buttonState1 = digitalRead (button1); // Read Button 1 Status
buttonState2 = digitalRead (button2); // Read button 2 state
if (buttonState1 == LOW) {i = i + 1; delay (50);}
// When the button is pressed, the barrier grows by 1. Delay 50
if (buttonState2 == LOW) {i = i - 1; delay (50);}
// When the button is pressed, the barrier decreases by 1. Delay 50
if (i & lt; 1) {i = 1;} // Lower boundary of the barrier
if (i & gt; 38) {i = 38;} // The upper boundary of the barrier
lcd.clear ();
}
}
I didn’t use the car. The last two elements of TL074 were left idle. But on the circuit and board they are. You may want to bring them to working condition a little later. I believe that I have achieved my goal. The display unit works wonderfully. Everything else depends on the MD.