Skip to main content
deleted 39 characters in body
Source Link
cyberponk
  • 672
  • 6
  • 10

Since you are using a PIC, I would suggest something as simple as 1 FET or BJT darlington driving the fan at 12V, and a PWM for the PIC output.

This way you can make the PIC output any voltage from 0 to 12V with only 1 pin.

Maybe your PIC already has embedded PWM. If not, PWM is simple to implement, just set the output pin lowhigh for, say, 500us, then highlow for 700us, and keep doing this forever. This way you will have a pulse of 1200us width with 5841,3%7% duty cycle, which, after inverted by the BJT or FET, is equal to 5Vrms at 833,33Hz.

More examples:
1200us low1200us high, 0us highlow = 12V12V
700us low700us high, 500us highlow = 7V7V
300us low300us high, 800us highlow = 3V3V

Circuit should be something like this:

schematicschematic

simulate this circuitsimulate this circuit – Schematic created using CircuitLab

Since you are using a PIC, I would suggest something as simple as 1 FET or BJT darlington driving the fan at 12V, and a PWM for the PIC output.

This way you can make the PIC output any voltage from 0 to 12V with only 1 pin.

Maybe your PIC already has embedded PWM. If not, PWM is simple to implement, just set the output pin low for, say, 500us, then high for 700us, and keep doing this forever. This way you will have a pulse of 1200us width with 58,3% duty cycle, which, after inverted by the BJT or FET, is equal to 5Vrms at 833,33Hz.

More examples:
1200us low, 0us high = 12V
700us low, 500us high = 7V
300us low, 800us high = 3V

Circuit should be something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Since you are using a PIC, I would suggest something as simple as 1 FET or BJT darlington driving the fan at 12V, and a PWM for the PIC output.

This way you can make the PIC output any voltage from 0 to 12V with only 1 pin.

Maybe your PIC already has embedded PWM. If not, PWM is simple to implement, just set the output pin high for, say, 500us, then low for 700us, and keep doing this forever. This way you will have a pulse of 1200us width with 41,7% duty cycle, which is equal to 5Vrms at 833,33Hz.

More examples:
1200us high, 0us low = 12V
700us high, 500us low = 7V
300us high, 800us low = 3V

Circuit should be something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Source Link
cyberponk
  • 672
  • 6
  • 10

Since you are using a PIC, I would suggest something as simple as 1 FET or BJT darlington driving the fan at 12V, and a PWM for the PIC output.

This way you can make the PIC output any voltage from 0 to 12V with only 1 pin.

Maybe your PIC already has embedded PWM. If not, PWM is simple to implement, just set the output pin low for, say, 500us, then high for 700us, and keep doing this forever. This way you will have a pulse of 1200us width with 58,3% duty cycle, which, after inverted by the BJT or FET, is equal to 5Vrms at 833,33Hz.

More examples:
1200us low, 0us high = 12V
700us low, 500us high = 7V
300us low, 800us high = 3V

Circuit should be something like this:

schematic

simulate this circuit – Schematic created using CircuitLab