Announcement

Collapse
No announcement yet.

Simple PIC based PI detector

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple PIC based PI detector

    This is my first post on this magnificent forum.
    I would like you to have a look at the schematic diagram + block diagram of my attempt to make a very simple yet performant PI detector.
    It is built around the PIC12F615. The major advantage of this PIC is that the decay pulse can be fed into the internal comparator and the output of the comparator can gate the internal timer. This makes it very elegant to measure the resulting puls width. The resolution is limited by the internal oscillator to the timer - max 8 MHz. So, I accumulate several pulse widths to compare this result with the calibrated value + margin.
    All feedback is welcome.
    Thanks in advance for your time and effort.

    Schematic diagram:


    Block diagram:




    Best regards
    - Bernard
    Belgium

  • #2
    What results are you getting with your detector?

    Comment


    • #3
      can topicstarter give me an example of circuit with IC4 he uses of?
      i do not penetrate the part, seems non-standart using of LM317 for me...

      tia

      Comment


      • #4
        F117 very interesting
        are you ok with sharing your code please ?
        could you give a bit more detail on the coil
        thanks

        Comment


        • #5
          The top right part of the schematic is the battery charger. The LM317 is used as a current source set to about 1/10 of the battery Ah.

          I use 15 AAA cells in series - 1000 mAh.
          Overall current consumption of the detector is around 90 mA.

          The coil is a simple (flat spiral or not) monocoil - 27turns 19-20 cm diameter. ( 8"). - about 350µH

          I will upload all files - including code - to my own website, since things got quite elaborate over time.
          The main challenge here was to make a PI as simply as possible using all available resources in the microcontroller.

          Drawbacks:
          - no low battery indication
          - no discrimination whatsoever, just a simple 1kHz tone or silence.

          Comment


          • #6
            hello f117 ,

            been having a look at shematic , could be wrong about points listed below ,

            output from AD847N with 18V supply going to pin 3 of pic chip , output of amp may go to aprox 17V , but input limit of pin 3 on pic chip according to data sheet is 5V+0.7v or there abouts. poss resistor / voltage divider required after op-amp.

            LM317T charging circuit , yes current limiting , but won't cut off when charged , will continue to overcharge , led may go off , note : nicd and nimh battery voltage drops when at 90% charge .

            am i correct in asuming that connection x2-2 is to go to coil shield ?

            coil drive / mosfet could be run off 18V same as op-amp , op-amp should be ok with the 10mV signal above rail . or poss run both on 12V , then follow amp with divider down to a max of 5V in to pic.

            didn't want to rain on your parade , just a few observations .

            Comment


            • #7

              been having a look at shematic , could be wrong about points listed below ,
              Thanks, Dooley.

              output from AD847N with 18V supply going to pin 3 of pic chip , output of amp may go to aprox 17V , but input limit of pin 3 on pic chip according to data sheet is 5V+0.7v or there abouts. poss resistor / voltage divider required after op-amp.
              Correct: internally in the PIC there are 2 clipping diodes to ground and 5V, the series resistor at the input helps limiting the current through these diodes.

              LM317T charging circuit , yes current limiting , but won't cut off when charged , will continue to overcharge , led may go off , note : nicd and nimh battery voltage drops when at 90% charge .
              I use an adaptor that gives out 24V DC at the input of the charger. As the 15xNiMH in series are charged, the LED goes off. I typically do this overnight and disconnect in the morning. No overheating/ other disadvantages noted so far...

              am i correct in asuming that connection x2-2 is to go to coil shield ?
              Correct, this is the coil shield connection.

              coil drive / mosfet could be run off 18V same as op-amp , op-amp should be ok with the 10mV signal above rail . or poss run both on 12V , then follow amp with divider down to a max of 5V in to pic.
              You are right, the analog front end is the weakest (but most important) part in the design. This is not my best point, and a also lower power voltage to start from would be better. I had a colleague of mine design this front-end, and it seems to work fine. I agree it can probably be made simpler yet.

              didn't want to rain on your parade , just a few observations .
              thanks, any help / feedback is largely appreciated.

              Comment


              • #8
                hello f117 ,

                ref:internal volt limiting in pic , ok , so pic ok to "see" 17v , but it will clip your signal,still poss best to use volt divide resistors before it so that all of the signal can be "seen" rather than only the last 5v , only a thought.

                Comment


                • #9
                  Dooley,
                  thanks for this feedback, you are right about the voltage divider at the opamp output.

                  - Bernard

                  Comment


                  • #10
                    Originally posted by DOOLEY View Post
                    hello f117 ,

                    ref:internal volt limiting in pic , ok , so pic ok to "see" 17v , but it will clip your signal,still poss best to use volt divide resistors before it so that all of the signal can be "seen" rather than only the last 5v , only a thought.
                    I could be wrong but the way I understand his description of the circuit, he is essentially only interested in the last 5 volts of the signal. Everything else is merely turning on the output of a comparater which gates on a timer. Therefore any voltage above the threshold (assumed to be in the 5V to 0V range) would be gating the timer on and then when the threshold level is reached, the timer is turned off. Nothing would be gained by dividing the level down. Maybe I misunderstand the principal though.

                    Comment


                    • #11
                      ah , i see signman , never looked close to what the function of the pin was , just asumed it was an analogue input to the pic ,

                      i don't play with pic's myself ,

                      whats the old saying "to asume , makes an as out of u and me"

                      sorry for that will look closer in future .

                      Comment


                      • #12
                        Signman,
                        thanks for your input.

                        I tend to agree with Dooley that a resistive voltage divider is better than the current series resistor + clipping diodes. With the diodes, the decay slope output of the opamp - presumably between ~0 and ~18V ( I have to verify this with a scope) , is limited - cut off - at 5.5V. This means that only a third of the slope is taken into account as input for the internal comparator. Then this part of the slope is sliced at the comparator level. This means that the comparator is looking at the very bottom part of the decay pulse.
                        To have a more dynamic range, I assume the resistor divider scheme is better since the entire slope amplitude is taken into account.
                        But again, I am not an analog designer - all help is largely appreciated.

                        Comment

                        Working...
                        X