A fan is a simple device that creates a flow within some fluid – such as the air, causing the heat accumulated in one section of the fluid to be moved away from the heat source, effectively cooling the affected area. The faster the fan rotates, the faster the fluid moves. This movement causes an audible noise which is one of the most obvious reasons why the fan speed control is needed, especially when the fan is used to cool down electronic components, such as the personal computer.
How does it work?
Fan 3 click uses two ICs to control the speed of the fan. The first IC is the MIC74 from Microchip, which is a serial to parallel I/O expander and fan controller. The four most significant bit outputs can be used to implement the fan speed control. This device uses an I2C communication protocol to set up the dedicated internal registers. The CLK and DATA pins are routed to mikroBUS™ I2C pins. Also, those pins are already pulled up with the 4k7 resistors on the click board, so there is no need to use additional pull-up resistors.
The three most significant bit outputs are equipped with the resistors, connected to the feedback input (ADJ) of the MIC29152 IC – a high current, high accuracy, low dropout voltage regulator from Microchip. This regulator is used to output the regulated voltage for the fan, determined by the feedback voltage on the ADJ pin. The output of the regulator is set to 12V when the maximum speed is selected. The recommended input voltage should not be much higher than 12V because in that case, the regulating efficiency won’t be optimal and the excess power will be dissipated as the heat. The voltage regulator features an internal power limiting logic, which protects it from damage in case of an excessive load on its output.
Individual open-drain output bits of the MIC74 are selectively grounded or allowed to float under the control of the internal state machine, so the equivalent resistance seen by the MIC29152 regulator’s feedback path is raised or lowered, changing the output voltage that way. The fourth bit is set to work as the SHDN which is used to enable the voltage regulator, via its EN pin when the fan mode is selected by the I2C. Setting this bit will activate the voltage regulator and the fan will start turning with the speed defined by the MIC74 registers.
Fan 3 click can be used on several different I2C addresses, selectable by the ADD SEL jumpers. Those jumpers are used to directly set A0 to A2 address select pins of the MIC74. By default, all address pins are grounded, which sets the slave I2C address to 0x20h.
The click is equipped with two connectors. One connector is used to connect an external voltage source, which is fed to the input of the regulator. The other connector is used to connect the load – usually, an electromotor which works with the nominal voltage of 12V and has the fan blades attached to its rotor.
MikroElektronika offers libraries with functions which allow simplified control over this click board. The example can also be used as a starting point or a reference for your own application code.
Specifications
Type
Brushless
Applications
The click can be used whenever a noiseless solution with the variable fan speed is needed, for example – cooling of electronic components with the minimal possible noise produced
On-board modules
MIC74 – 2-Wire Serial I/O Expander and Fan Controller and MIC29152 a high current, high accuracy, low dropout voltage regulator from Microchip
Key Features
Fan speed control circuit with 7 discrete voltage levels, which can deliver relatively high current on the output terminals. Over-current protection, I2C communication interface, several selectable I2C addresses
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Fan 3 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Fan 3 click maximum ratings
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Input connector voltage | 12 | 12 | 25 | V |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR LED | – | Power indication LED |
JP1 | ADD. SEL. | LEFT | Slave address least significant bit selection 0/1, left position 0, right position 1 |
JP2 | ADD. SEL. | LEFT | Slave address second to least significant bit selection 0/1, left position 0, right position 1 |
JP3 | ADD. SEL. | LEFT | Slave address third to least significant bit selection 0/1, left position 0, right position 1 |
Software Support
We provide a library for the Fan 3 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for Fan 3 Click driver.
Key functions
-
fan3_set_speed
- Set speed
Example Description
This application controls the fan speed.
void application_task ( )
{
log_printf( &logger, "Speed 1...rn" );
fan3_set_speed( ctx, FAN3_SPEED1 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, "Speed 3...rn" );
fan3_set_speed( ctx, FAN3_SPEED3 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, "Speed 5...rn" );
fan3_set_speed( ctx, FAN3_SPEED5 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, "Speed 7...rn" );
fan3_set_speed( ctx, FAN3_SPEED7 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, "Stopped...rn" );
fan3_set_speed( ctx, FAN3_STOPPED );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Fan3
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.