alternating current using pic microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by sayf alawneh, Aug 4, 2014.

  1. sayf alawneh

    Thread Starter New Member

    Aug 4, 2014
    20
    0
    hello guys my question is for experienced members
    we all know that the pic microcontroller output is 5volts and 25 mA as maximum
    now am trying to design a metal detector using pic technology
    and my problem is as followed
    i need an alternating current with frequency about 20 KHZ passing through a coil
    how can i get this constant frequency using pic microcontroller
    i know i need another stuffs in addition with the pic what are they ?
    :confused:
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    You can use a timer module on the mcu to generate a 20kHz square wave.

    But how does a metal detector work?
     
  3. sayf alawneh

    Thread Starter New Member

    Aug 4, 2014
    20
    0
    its VLF metal detector
    u apply an alternating current with constant frequency to a transmitter loop producing a magnetic field if this magnetic field interacts with a metal object for example a reversed magnetic field from this object will be detected by a reciever coil in other words a current with a certain frequency will pass through the reciever coil due to the object magnetic field
    now i need the microcontroller for two purposes first to create a current with constant frequency through the transmitter loop and to read the frequency through the reciever loop
    now the different between the 2 frequencies is known as the phase shift and every object has a constant phase shift depending on many varibles such as the conuctivity
    its a great idea but i need help using the pic microcontroller
    if u have good ideas to use the pic microcontroller please msg me on private and lets discuss every thing
    peace
     
  4. mitko89

    Member

    Sep 20, 2012
    123
    19
    Hmmm.... Didn't know I was on the freelancer website
     
  5. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    I doubt that 25mA will be enough for the Tx coil current. You will probably need to use the PIC output to drive the coil via an amplifier.
     
  6. sayf alawneh

    Thread Starter New Member

    Aug 4, 2014
    20
    0
    so if i change the output voltage of the pic into AC voltage with certain frequency using PWM will that make the output amplified current AC also,,,, and with the same properties of the voltage
     
  7. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    You can apply the amplified PWM via a capacitor to the coil if you want to eliminate the DC; but do you really need AC? Won't the Tx coil be happy with pulsed DC?
     
  8. sayf alawneh

    Thread Starter New Member

    Aug 4, 2014
    20
    0
    using alternating current to create a magnetic field that is distorted by a metallic object
    here is what i need if u can give me a detailed help

    i need to change the output of the MC into alternating also the output current of the MC is very low so i need to amplify it and then filter it through an LC circuit to get the wanted frequency
    was that correct or i need to do other steps ??
     
  9. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,692
    2,762
    Here is a clever solution that I linked to before on other, similar threads:

    PicoDetector
     
  10. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    I think you'll find that DC pulses would would give a similar result. How much current do you need for the Tx coil? How important is the coil frequency? What size object are you hoping to detect at what distance?
     
    Last edited: Aug 4, 2014
  11. BobTPH

    Active Member

    Jun 5, 2013
    786
    114
    I don't understand your detection scheme. If you are outputting a fixed frequency to the transmitter, how does the receiver get a variable frequency? A metal object will not change the frequency your PIC is outputting. The normal way this is done, is that the coil is part of an LC oscillator, and a nearby metal object changes L and thus the frequency generated.

    Bob
     
  12. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    That's my understanding of conventional metal detectors. But the OP at one point mentioned phase shift detection?
     
  13. sayf alawneh

    Thread Starter New Member

    Aug 4, 2014
    20
    0
    hmmmm ,As the magnetic field pulses back and forth into the ground, it interacts with any conductive objects it encounters, causing them to generate weak magnetic fields of their own. The polarity of the object's magnetic field is directly opposite the transmitter coil's magnetic field. If the transmitter coil's field is pulsing downward, the object's field is pulsing upward.Therefore, when the receiver coil passes over an object giving off a magnetic field, a small electric current travels through the coil. This current oscillates at the same frequency as the object's magnetic field. The coil amplifies the frequency and sends it to the microcontroller again to distnguish the frequency
    How does a VLF metal detector distinguish between different metals? It relies on a phenomenon known as phase shifting. Phase shift is the difference in timing between the transmitter coil's frequency and the frequency of the target object
    thats the explanation
    also can u give me more tips on how using the LC circuit to produce the needed frequency
    my friend told me about connecting the L and C once in series and once in parallel to recharge the capacitor contiuosly to avoid damping effect
    do u have any comments on that or a detailed way to use that via microcontroller
    the LC circuit is my only problem now so lets work together to make it come true
     
  14. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    Since the frequency is set by the micro why do you need the LC circuit?
    I don't understand that. Perhaps you can get your friend to build the circuit, or at least provide a schematic?
     
  15. sayf alawneh

    Thread Starter New Member

    Aug 4, 2014
    20
    0
    the current of the micro is not enough for the coil of the transmitter friend
    so i need this current amplified the current of the MC only works as the base current of the transistor switch
    any ways once he tell me exactly about the circuit it will be our new topic
    and am gonna visit him this day for further explanations so this day u will know
    regards
     
Loading...