Announcement

Collapse
No announcement yet.

PWM in PBP3

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

  • PWM in PBP3

    I'm PWM'ing a a circuit with a PIC16FLF1823. I used the R/C circuit (10k, 1uF) in the manual but followed it with a MOSFET. I'm driving an LED with the MOSFET. The MOSFET's gate can be triggered with a very low voltage if necessary(a BSS138).
    I have a resistor on the source pin to 'plus' (I'm running this all at 3 volts) that meets the ohms necessary for the LEDs specs and the LED is common Anode (which receives the PWM).
    So I turn on the cathode of the color I want (it's an RGB) and hit the anode with the PWM but I don't get anything trying various cycles and duty.
    However, if I pulsout the pin I can get the LED to work but still quite dimly (I suppose that the cap isn't charging completely).
    Any ideas?-Keith

  • #2
    BSS138 is a Nch fet . so how are you driving the led anodes ? .
    post a schematic of your setup

    Comment


    • #3
      Schematic for PWM'ing MOSFET. PWM pin drives MOSFET for LED Anode. 2nd pin drives cathode to zero.
      Attached Files

      Comment


      • #4
        as I suspected , you need to use a Pch fet and swap the drain/source connections
        (hint the pwm will be reversed ie 0 pw = max bright ,100% = off)
        with the setup you are using how can get vgs high enough to turn the fet fully on . its not possible

        Comment


        • #5
          Thanks Richard. Works like a charm. Didn't try PWM yet but with a pulse out, the LED is beautifully lit.

          Pardon my ignorance but why is it I can't get that gate up high enough on the N-channel MOSFET on the first design? Thanks, Keith

          Comment


          • #6
            hope this pic will upload to explain no vgs

            sorry this forum is refusing to let me upload an image still!!!

            lets say 10ma through led :-

            led cathode .2 v (pic I/p sinking 10ma to low pin)
            led anode 1.8v (green led 1.6v vff)
            118 R = 2.98v ( vR = 1.18v)

            pic gate output 3v ( vcc=3.3)

            best vgs .02 v ie led barely lit
            Attached Files
            Last edited by richard; 07-13-2015, 04:05 PM.

            Comment


            • #7
              Got it. Thanks.-Keith

              Comment


              • #8
                One more thing since I can't get PWM to work at the moment (pulsout worked); because the capacitors are polarized and now I'm using the P-channel MOSFET, do I need to reverse the cap and get a positive to the cap's + terminal?
                Can I use a non-polarized cap?-Keith

                Comment


                • #9
                  Keith, I'm rather confused as to why you have the cap there anyways? It is PWM that you want right? Putting the PWM signal thru a LOWPASS filter like you are it looks as though you are trying to generate a linear voltage on the gate.
                  Dave Purola,
                  N8NTA
                  EN82fn

                  Comment


                  • #10
                    I was thinking it would act as a 'sample and hold' for the voltage. Do you think it's unnecessary and I will be able to dim the LED without it because of the frequency of refreshing?
                    I want the LED to have a gradual intensity, no pulsation.-Keith

                    Comment


                    • #11
                      Well Keith, What is the PWM period? If it's above 60 Hz. it won't be noticeable to the eye. I only ask because it will be operating the FET in a linear mode which will dissipate HEAT.
                      Dave Purola,
                      N8NTA
                      EN82fn

                      Comment


                      • #12
                        Good point David. I'll see what it looks like without them.

                        Comment


                        • #13
                          David,that worked (without the caps) really well. Thanks,Keith

                          Comment

                          Working...
                          X