Announcement
Collapse
No announcement yet.
My Pulse Oscillation detector project.
Collapse
X
-
Hi ApBerg
I see you have redrawn the board. Nice! What software did you use?
I made the board in kicad. I can share kicad files also. But I have no time tonight. I must investigate first what files and libraries I must include.
Leave a comment:
-
Hello Teemo
Thanks for the info, it is a nice little circuit !
Next is some time to etch a pcb..
Best regards.
ApAttached Files
Leave a comment:
-
Assembler source code!
Hello!
Thank you all for keeping up good conversation.
Today I released the source assembler code. Many people here seem to have pretty good knowledge of PIC programming. So it may happen that together we can improve from my original design to even further.
I encourage you to share your modification and test results, in case you decide to build this project.
Here is the link to my firmware page, there is also basic flow diagram:firmware-page
Direct link to assembler file:metaldetector100.asm
I also add zipped asm file here as attachment.
Best wishes,
TeemoAttached Files
Leave a comment:
-
So I was reasonably close, but got a little bit of the detail wrong.Originally posted by Teemo View PostHi Qiaozhi.
Some points you got right some not.
1. RA5 pings the mosfet and resonance fereq. 77kHz is correct. But resulting decaying sine wave is not clamped. Clamped is signal that reaches PIC through R4, and to supply rails, between 0V and 5V
2. correct
3. correct, and comparator output drives timer 1 gate function
4. no, Timer 1 do not reach limit, it is started and stopped at every sine wave period that reaches over comparator treshold level, using PIC timer1 gate function. Download PIC12F1840 datasheet for details how this function works. Timer1 count is therefore proportional to the decay time.
5. output audio is not pwm, it is just beep or no beep.
So it do not measure the ferequency for detecting metal, only the decay time.
Aziz, you are getting it way too complicated
.
Here is link for PIC1840 datasheet
See timer1 Gate function
Also my block diagram on my web:http://www.digiwood.ee/images/metal_...matic_copy.png
The timer1 gate function of the PIC12F1840 seems really useful. By setting the T1GSS bits of the T1GCON register to "10", it uses the comparator as the gate source. Pretty neat!
Also, from your block diagram, I can see that you're using the internal DAC to generate the threshold level for the comparator. Presumably the user is not able to set the threshold level manually, so how is this controlled? Is this a self=adjusting threshold (SAT)?
Lastly, what is the sensitivity of this detector?
Leave a comment:
-
Nice work Teemo!
Here's a similar idea, US patent 6,650,111
A proximity sensor has a transducer coil that is part of an oscillator circuit. The oscillating signal varies as a function of the presence or absence of a metallic object adjacent the transducer coil. By analyzing selected characteristics of that oscillating signal, the presence of and object and the distance to the object can be determined. Other analysis techniques enable the sensor to distinguish between ferrous and non-ferrous materials. A mechanism also is provided to automatically configure operation of the proximity to avoid interference from another adjacent proximity sensor.
Leave a comment:
-
F117, you got it right here.Originally posted by F117 View PostOne of the nice features of these PICs is that you can gate the free running timer1 with the output of the comparator. Very easy to measure incoming pulse widths !
So, no timer interrupts needed and reading the timer value is also not critical since it automagically stops counting when the gate signal goes low(/high)
Leave a comment:
-
Hi Qiaozhi.Originally posted by Qiaozhi View PostHere's my educated guess of how it works ->
1. The digital port RA5 (pin 2) pings the MOSFET, and starts the LC network into oscillation at an approximate frequency of 77kHz. The result is a decaying sine wave, which is initially clamped to +/- 0.3V (due to the Schottky diodes).
2. Timer 1 is reset and started running.
3. RA4/C1IN1 (pin 3) is a comparator input that is used to count the number of transitions through 0V during the period when the timer is active. This is probably done under interrupt control.
4. Eventually Timer 1 reaches the limit and generates an interrupt.
5. The number of transitions is then used to set the PWM output on RA2 (pin 5) to drive the piezo speaker with an audio frequency.
6. The cycle repeats.
Although this design superficially resembles a PI, it appears to be measuring frequency changes due to metal targets altering the inductance of the coil.
Teemo - am I close?
Some points you got right some not.
1. RA5 pings the mosfet and resonance fereq. 77kHz is correct. But resulting decaying sine wave is not clamped. Clamped is signal that reaches PIC through R4, and to supply rails, between 0V and 5V
2. correct
3. correct, and comparator output drives timer 1 gate function
4. no, Timer 1 do not reach limit, it is started and stopped at every sine wave period that reaches over comparator treshold level, using PIC timer1 gate function. Download PIC12F1840 datasheet for details how this function works. Timer1 count is therefore proportional to the decay time.
5. output audio is not pwm, it is just beep or no beep.
So it do not measure the ferequency for detecting metal, only the decay time.
Aziz, you are getting it way too complicated
.
Here is link for PIC1840 datasheet
See timer1 Gate function
Also my block diagram on my web:http://www.digiwood.ee/images/metal_...matic_copy.png
Leave a comment:
-
One of the nice features of these PICs is that you can gate the free running timer1 with the output of the comparator. Very easy to measure incoming pulse widths !Eventually Timer 1 reaches the limit and generates an interrupt.
So, no timer interrupts needed and reading the timer value is also not critical since it automagically stops counting when the gate signal goes low(/high)
Leave a comment:
-
HI Aziz,Originally posted by Aziz View PostWhat I mean is the following:
Sampled Coil "bits": 000111100011100011110000111000.....
Reference "bits": 011100001111100001110000...
XOR: 011011101100000010000000...
Low-pass: 111111111100000000000000.. -> output (down mixed and filtered output beat frequency)
Very simple to implement and very effective. Can be implemented in an endless loop.
Aziz
OK I see how this works (I think) can you explain the processes involved (HOW this filters)? I've tried to learn and don't know much about DSP, plus I'm not bvery good at "seeing" things at the moment due to the medication I'm on (seems to make me dumb-er than I normally am)
.
Regards
Sean G.
Leave a comment:
-
Here's my educated guess of how it works ->
1. The digital port RA5 (pin 2) pings the MOSFET, and starts the LC network into oscillation at an approximate frequency of 77kHz. The result is a decaying sine wave, which is initially clamped to +/- 0.3V (due to the Schottky diodes).
2. Timer 1 is reset and started running.
3. RA4/C1IN1 (pin 3) is a comparator input that is used to count the number of transitions through 0V during the period when the timer is active. This is probably done under interrupt control.
4. Eventually Timer 1 reaches the limit and generates an interrupt.
5. The number of transitions is then used to set the PWM output on RA2 (pin 5) to drive the piezo speaker with an audio frequency.
6. The cycle repeats.
Although this design superficially resembles a PI, it appears to be measuring frequency changes due to metal targets altering the inductance of the coil.
Teemo - am I close?
Leave a comment:
-
Thanks,Originally posted by F117 View PostNice design !
You can probably omit D2/D3 clipping diodes as they are already inside the PIC ?
I also have had problems in the past using the MCLR pin 4 as a pushbutton input. The controller would sometimes reset when holding the search coil near a damp grass surface. The solution is to add a 100nF to ground (in parallel with the pushbutton).
Best regards,
- Bernard
Still I think it is better not to omit D2,D3 because PIC internal diodes are not strong enough. There is 150V, maybe more, at the coil!
Leave a comment:
Leave a comment: