Announcement

Collapse
No announcement yet.

Signal Truncator for PI w/ PIC uC

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

  • Signal Truncator for PI w/ PIC uC

    Thanks to youall for the voltage level shifter. I got a new problem now. I have a signal that goes from -5 to +5 and I need to eliminate the negative side so the signal will go only from 0v to +5v. Once I get this I can feed the signal into my PIC uC and do some signal processing on it.

    I have the signal processing algorithm already working on a test jig but in the real PI circuit the signal is out of range for my PIC which is 0v to +5v. Once this is solved I should be getting some real improvements in the signal-to-noise and hence get a lot better depth detection.

    Your last inputs helped me solve the trigger signal into the PIC that tells the PIC when to collect the data off the incoming pulse.

    I'd really appreciate some inputs on this.
    Many Thanks,
    Goldfinder

  • #2
    One addition note on the signal.

    I neglected to mention that the -5v to +5v response is due to the coil moving over some metal. The first part of the signal moves to -5v and then as the metal is moved away from the coil the signal goes to the +5v.

    Any inputs that are simple to implement would be greatly appreciated.

    Goldfinder

    Comment


    • #3
      Hi Goldfinder,
      You could AC couple the signal followed by voltage divider. Eg; 1 cap and 2 resistors.
      Or use 2 clamp diodes and 1 series resistor.... I take it you are using the PIC ADC input....if so, the series resistor should match the ADC input impedance which from memory is around 6- 10K.

      I prefere to AC couple , voltage divide to the ADC range and use clamp diodes
      to limit the voltage swing.

      Hope this helps.

      Regards

      Brian K

      Comment


      • #4
        Voltage Divider gives Volts reduction but still also in -V

        Hi Brian,
        Your suggestion to use a voltage divider is good but I had already thot of that and even tried it. What it does is reduce the signal level but there is still a negative votlage component. For example, use 2 resistors of same value in series and the voltage goes from -5v/5V to -2.5v/+2.5v. Now, its possible I don't understand how to hook this up so if I did something wrong let me know.
        Thanks again,
        Goldfinder

        Comment


        • #5
          Is this a digital pulse or analog signal?

          Comment


          • #6
            Use a Diode

            A simple solution would be to use a series diode wired so that it would only conduct when the voltage goes positive. Once the voltage reached 0.6volts positive the diode would conduct. When the voltage goes negative the diode would be reverse biased and no conduction would take place effectively blocking any negative voltage from reaching your PIC.

            Comment


            • #7
              Analog or Digital ??

              Hi Carl,
              The signal is analog. It is coming off an opamp and is to go into a A2D converter that is part of the PIC uC. Anything that is negative volts will probably destroy the A2D port.

              I tried the diode trick last week when I was trying to get this to work but it conducts anyway since once the signal starts going positive the diode conducts.

              Goldfinder

              Comment


              • #8
                I think I would use an op amp to "scale" the signal. Just configure it to accept -5 to +5 volts in and give 0 to +5 volts out. From your second post it sounds like the signal is around +5V and swings negative when the coil gets near metal. If this is the case, you could configure the op amp as inverting so that it will be 0 going into the A2D with no metal and +5V when it detects metal. This would save you from inverting it in Software. I would invert it in software instead of adding an op amp but since you already have to add the op amp you could go ahead and invert the signal there.
                Good luck,
                Boattow

                Comment


                • #9
                  Took me a while to look at this, but here are a couple of circuits. This first is a simple diode rectifier which will just lop off the negative part of the signal. This is fine for a logic signal. The second circuit level shifts and compresses the whole signal, so no information is lost. Good for analog signals.

                  - Carl

                  P.S. -- I didn't test the opamp circuit, but on paper it works
                  Attached Files

                  Comment

                  Working...
                  X