12V Fan controller with PIC18F25K20

Not rated 9,348

Circuit Image

This project is based on a PIC18F25K20, with the purpose of controlling a fan with PWM (Pulse Width Modulation). It offers variable speed control, low acoustic noise, reliability, long lifetime, low power consumption, and protection features. The MCU gets the temperature from the sensor (DS18B20), and after conversion to Celsius degrees, it generates a PWM signal on PORTC.2 with six different levels. The signal goes to Q1 (BC338) to control the duty cycle of the fan. Two transistors are used to ensure sufficient current (Ic) on Q2 to activate the fan. The MCU only generates a maximum of 3.6V on its output, and 15% of 3.6V is 0.5V to polarize Q1, but 0.7V is needed. The fan can be controlled between 5V and +/-12V. The BC338 has a current load of 800mA, which is the value a fan can have; two or more fans can be used as long as the current load does not exceed 800mA. The output of the MCU connects to Q1 and Q2, which function as a switch. D3 is included for protection against the magnetic field generated by the inductors in the fan; without D3, turning off the system could discharge current to Q2 and potentially damage it.

The circuit utilizes a PIC18F25K20 microcontroller, which serves as the central processing unit for controlling the fan's operation based on temperature readings. The DS18B20 temperature sensor provides accurate temperature measurements, which are processed by the microcontroller to determine the appropriate fan speed. The PWM signal generated on PORTC.2 allows for precise control of the fan speed by varying the duty cycle.

The BC338 transistor is employed as a switching device to amplify the PWM signal from the microcontroller. Given that the microcontroller output is limited to 3.6V, a secondary transistor configuration is necessary to ensure that the base current is sufficient to drive the BC338 into saturation. This configuration allows the fan to operate effectively at higher voltages, ranging from 5V to +/-12V, accommodating various fan specifications.

The design incorporates protective measures, including diode D3, which safeguards the circuit from back EMF generated by the fan's inductive load. This diode is critical in preventing damage to the transistors during the switching process. The overall design allows for the control of multiple fans, provided that the total current does not exceed the rated capacity of the BC338, ensuring reliable and efficient operation in various environmental conditions.This project it´s based on a PIC18F25K20, with the purpose of control a FAN with PWM (Pulse with Modulation). It offers a variable speed control, low acoustic noise, reliability, long lifetime, low power consumption, protection features.

The MCU get the temperature from the sensor (D18B20), and after will do a conversion Celsius degrees and then it´s generated a PWM on PORTC.2 with 6 different levels. After the signal goes to Q1 (BC338) in order to control the duty cycle in the fan. I had to use two transistors to have an Ic on Q2 to be enough to activate the fan. Because the MCU only generate a maxim of 3.6V on which output, and 15% of 3.6V is 0.5V to polarize Q1 we need 0.7V. You will be able to control the FAN between 5V and +/-12V.The BC338 have a current load of 800mA that is value of a fan can have, you can use two or more fans as long the current load isn´t more than 800mA.

The output of MCU connect to the Q1 and Q2 it works like a switch, the D3 it´s for protection from the magnetic field in the inductors from the FAN, without the D3 when you turn off the system the current will be discharge to the Q2 and could damage it. 🔗 External reference




Warning: include(partials/cookie-banner.php): Failed to open stream: Permission denied in /var/www/html/nextgr/view-circuit.php on line 713

Warning: include(): Failed opening 'partials/cookie-banner.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/nextgr/view-circuit.php on line 713