PWM fan speed control with a 12F683


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: PWM fan speed control with a 12F683

    Why turn all these off: FCMEN_OFF, IESO_OFF, WDT_OFF ?
    Since you're using the internal OSC... there's no need to use the internal/external switchover feature, same goes for FailSafe clock.... check out the datasheet for the whole set of crispy and ... obscure... details

    WDT_OFF? It's really up to you to decide, I tend to left it to ON... but, it's always case by case... still the datasheet will provide you some detail about the benefits of WDT to ON.

    Are these two statements redundant:
    OSCCON = %01110001 ' Internal 8MHz osc.
    DEFINE OSC 8
    No they're not, the OSCCON line specify the OSC speed to the PIC, while the DEFINE OSC specify the OSC Speed to the compiler.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: PWM fan speed control with a 12F683

    Got the program and got the circuit set up. It seems to work well with LEDs but feeding the output to a FET, at least the FET I'm using, won't trigger the FET.

    I looked at it with a scope and I'm getting barely over a 2V Peak signal. I assumed I'd get 5V square wave pulses spaced to get the right voltage from the PWM module. Did I do something wrong or do I need to find another FET?

    I do appreciate the help and your patience.

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: PWM fan speed control with a 12F683

    What FET?
    MosFet?

    Need to see the circuit anyway.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: PWM fan speed control with a 12F683

    Ok forget about the FET and talk to me about the PWM signal. Should it be 5V pulses or 2.2V pulses? If 5V, what do I need to set to make it be that level?

  5. #5
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: PWM fan speed control with a 12F683

    Using Sayzer's code, attached, I've been able to control an LED as desired.

    Coupling that to a larger current drawing device is a problem. Of the schematic page provided, the top drawing has pulses at GP2 to the MOSFET of about 2.3 volts and won't power on the fan. I thought once I figured out how to get the pulses up to around 5 volts the FET would turn on and I'd be golden.

    The lower schematic adds R1 and R2 so I get around 4.8 volt peaks with varying RMS values but even with the larger pulse size it still won't turn on the fan. I felt really stupid after I figured that one out.

    I can connect the gate to +5V and it will turn the FET on and drive the fan. Although I don't think it's bringing the fan up to full speed.

    So what in hell am I missing? Why won't the chip drive the FET to turn on the fan?
    Attached Images Attached Images  
    Attached Files Attached Files

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: PWM fan speed control with a 12F683

    Check PWM freq,
    Name:  Capture19.JPG
Views: 8406
Size:  73.3 KB
    If too high, the inductance of the motor affects operation, add diode across motor pointing up, returns energy to motor when MOS FET switches off. Hardware PWM freq only goes so low. May need INT to PWM or do it in basic.
    The ckt shows P-channel MOS but your N-channel setup is ok.

    Don

  7. #7
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: PWM fan speed control with a 12F683

    I didn't have a coil so I tried the cap across the motor and voila!

    Thanks.

    I still can't get the fan to do three speed steps it's either on or off. Any ideas?

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts