Need advice: Metal detector with stm32f103

What are you developing?
User avatar
RogerClark
Posts: 5043
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Need advice: Metal detector with stm32f103

Postby RogerClark » Sun Nov 06, 2016 5:23 am

I see now that the OpAmp is powered by +/-12V. It wasn't that clear in the schematic that there was a -12v supply, as I can only see BAT1 and not BAT2

User avatar
Pito
Posts: 535
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Need advice: Metal detector with stm32f103

Postby Pito » Sun Nov 06, 2016 10:43 am

The op amp should have gain of 1000.
NE5534 is exactly 10Mhz and it has a good specs at all. It have been used in many commercial pulse induction detectors.

Ok thanks for the explanation on the pulse - that is exactly what we need to know, otherwise just writing mess :)

The bandwidth BW of an OPAMP depends on the Gain (called BANDWIDTH AT UNITY GAIN), thus 1000x gain and "10MHz bandwidth at GAIN=1" gives you 10kHz bandwidth at gain 1000.
10kHz BW means you can hardly see a 50us pulse.
BTW your gain is set to 500 based on the schematics..

In order to get gain=1000 with a few MHz BW you must use a series of say 3 of your opamps with gain=10 each (thus 1MHZ BW each and in total 1MHz BW, with total GAIN=1000). I doubt there is an OPAMP with GAIN=1000 and real bandwidth=10MHZ at that gain available on the market.. :(
Generally, designing amplifiers with such high gains in a single stage is not recommended (for many reasons, especially DC coupled!!).
Also mind the input's OPAMP offsets will be multiplied by the GAIN too - you must compensate it (with R7 disconnected you have to set the output of the opamp to 0.0V). BTW the input offsets are temperature depended, a coin detected in your lab must not necessarily be detected at -5degC or +35degC in the field..

What you currently measure with your arduino is just an "average of something" at the OPAMP output, which may or may not indicate the golden nugget hidden beneath the coil.. :D

PS: below a picture from the simulation:
1. Input -1mV to +1mV, 100us period, 50us pulse, rising/falling edge 1us
2. OPAMP is 70MHz BW, 1000V/usec slew rate, so by far better params than yours
3. GAIN=1000
4. See the output offset +1V due to high gain - must be compensated in your design..
5. The 5pF in your schematics decreases the bandwidth as it creates an low-pass, the corner freq will be aprox 1/(1000k * 5pF) = 200kHz, but it helps with stability a bit..
OPAMP.JPG
OPAMP.JPG (67.1 KiB) Viewed 242 times

User avatar
Pito
Posts: 535
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Need advice: Metal detector with stm32f103

Postby Pito » Sun Nov 06, 2016 2:16 pm

METAL2.JPG
METAL2.JPG (101.53 KiB) Viewed 238 times

METAL1.JPG
METAL1.JPG (108.16 KiB) Viewed 238 times

asen0v
Posts: 10
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Postby asen0v » Sun Nov 06, 2016 2:30 pm

This is how the simulation of the scheme looks in Proteus. This is exactly how the signal of a PI metal detector should look. As I said this op amp configuration have been used in many commercial metal detectors and it works like a charm. It was replicated thousand of times by amateur builders and it still works good. Of course I may try to change it a bit and see the results, but this is not what I need now.
One thing I did not mention is, that the NE5534 have offset compensation circuit. I have build it on my test board, but forgot to draw it in the scheme. This is how it looks http://i.stack.imgur.com/JsIzC.png.

The most important thing I need to know now is how to properly interface it with the ADC.
I will try different configurations and will share the results with you. Unfortunately I have killed my last maple mini and now I have to wait 10 days for the express delivery from China. This time I bough 5 :D

User avatar
Pito
Posts: 535
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Need advice: Metal detector with stm32f103

Postby Pito » Sun Nov 06, 2016 2:44 pm

This is exactly how the signal of a PI metal detector should look.

"Any" pulse will look like that because you are passing a pulse via a diode and then into an RC, while limiting it with the zener..
So hopefully your new MMs will arrive soon and you may continue! 8-)

asen0v
Posts: 10
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Postby asen0v » Sun Nov 06, 2016 5:14 pm

Pito wrote:
This is exactly how the signal of a PI metal detector should look.

"Any" pulse will look like that because you are passing a pulse via a diode and then into an RC, while limiting it with the zener..
So hopefully your new MMs will arrive soon and you may continue! 8-)


The simulation in Proteus does not include the diode, RC and the zener. The scope is tied directly on the op amp output.

asen0v
Posts: 10
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Postby asen0v » Mon Nov 07, 2016 6:20 pm

If someone is interested in this project - I think I found a solution. Here it is: Precision half wave rectifier.
I built it and it works. I generated the tx pulse with arduino nano and the signal after the rectifier looks fine on the real scope.
When my MM arrive I will do more tests and share again :)


Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest