TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139050 times)
  2. FAT32 Library (71588 times)
  3. Network Ethernet Library (56988 times)
  4. USB Device Library (47326 times)
  5. Network WiFi Library (43005 times)
  6. FT800 Library (42295 times)
  7. GSM click (29754 times)
  8. mikroSDK (27873 times)
  9. PID Library (26858 times)
  10. microSD click (26129 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

FAN 8 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: Brushless

Downloaded: 176 times

Not followed.

License: MIT license  

Fan 8 Click is a compact add-on board that represents a compliant fan controller. This board features the MAX6615, a fan-speed controller, and a dual-channel temperature monitor with external thermistor inputs from Maxim Integrated, now part of Analog Devices. The MAX6615 controls the speed of two cooling fans based on the temperatures of external thermistors and the device's internal temperature, reporting temperature values in a digital form using the I2C serial interface.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "FAN 8 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "FAN 8 Click" changes.

Do you want to report abuse regarding "FAN 8 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


FAN 8 Click

Fan 8 Click is a compact add-on board that represents a compliant fan controller. This board features the MAX6615, a fan-speed controller, and a dual-channel temperature monitor with external thermistor inputs from Maxim Integrated, now part of Analog Devices. The MAX6615 controls the speed of two cooling fans based on the temperatures of external thermistors and the device's internal temperature, reporting temperature values in a digital form using the I2C serial interface.

fan8_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Aug 2021.
  • Type : I2C type

Software Support

We provide a library for the FAN8 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for FAN8 Click driver.

Standard key functions :

  • fan8_cfg_setup Config Object Initialization function.

    void fan8_cfg_setup ( fan8_cfg_t *cfg );
  • fan8_init Initialization function.

    err_t fan8_init ( fan8_t *ctx, fan8_cfg_t *cfg );
  • fan8_default_cfg Click Default Configuration function.

    err_t fan8_default_cfg ( fan8_t *ctx );

Example key functions :

  • fan8_set_duty_cycle This function sets the duty cycle of the selected fan channel and waits until the duty cycle is set at the PWM output.

    err_t fan8_set_duty_cycle ( fan8_t *ctx, uint8_t fan_ch, uint8_t duty_cycle );
  • fan8_measure_rpm This function measures the RPM of the selected fan channel.

    err_t fan8_measure_rpm ( fan8_t *ctx, uint8_t fan_ch, uint8_t num_pulses, uint16_t *fan_rpm );
  • fan8_read_temperature This function reads the temperature from the thermistor attached to the selected temperature channel.

    err_t fan8_read_temperature ( fan8_t *ctx, uint8_t temp_ch, float *temperature );

Example Description

This example demonstrates the use of FAN 8 Click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;    /**< Logger config object. */
    fan8_cfg_t fan8_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    fan8_cfg_setup( &fan8_cfg );
    FAN8_MAP_MIKROBUS( fan8_cfg, MIKROBUS_1 );
    err_t init_flag = fan8_init( &fan8, &fan8_cfg );
    if ( I2C_MASTER_ERROR == init_flag ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    init_flag = fan8_default_cfg ( &fan8 );
    if ( FAN8_ERROR == init_flag ) 
    {
        log_error( &logger, " Default Config Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Changes the speed of fans at both channels by changing the PWM duty cycle, then calculates the fans RPM from measured tachometer signal. It also reads the temperature of two thermistors. The results are being displayed to the USB UART where you can track their changes.


void application_task ( void )
{
    static uint8_t duty_cnt = FAN8_MIN_DUTY_CYCLE;
    static int8_t duty_inc = FAN8_DUTY_CYCLE_STEP_10;
    uint16_t fan_rpm = 0;
    float temperature = 0;

    if ( duty_cnt == FAN8_MAX_DUTY_CYCLE )
    {
        duty_inc = -FAN8_DUTY_CYCLE_STEP_10;
    }
    else if ( duty_cnt == ( FAN8_MIN_DUTY_CYCLE + FAN8_DUTY_CYCLE_STEP_10 ) )
    {
        duty_inc = FAN8_DUTY_CYCLE_STEP_10;
    }
    duty_cnt += duty_inc;

    log_printf( &logger, " - Channel 1 values -\r\n" );
    fan8_set_duty_cycle ( &fan8, FAN8_FAN_CHANNEL_1, duty_cnt );
    log_printf( &logger, " PWM Duty Cycle : %d\r\n", ( uint16_t ) duty_cnt );
    fan8_measure_rpm ( &fan8, FAN8_FAN_CHANNEL_1, FAN8_2_PULSES_PER_REVOLUTION, &fan_rpm );
    log_printf( &logger, " Last measured fan RPM : %u\r\n", fan_rpm );
    fan8_read_temperature ( &fan8, FAN8_TEMP_CHANNEL_1, &temperature );
    log_printf( &logger, " Temperature : %.2f C\r\n\r\n", temperature );

    log_printf( &logger, " - Channel 2 values -\r\n" );
    fan8_set_duty_cycle ( &fan8, FAN8_FAN_CHANNEL_2, duty_cnt );
    log_printf( &logger, " PWM Duty Cycle : %d\r\n", ( uint16_t ) duty_cnt );
    fan8_measure_rpm ( &fan8, FAN8_FAN_CHANNEL_2, FAN8_2_PULSES_PER_REVOLUTION, &fan_rpm );
    log_printf( &logger, " Last measured fan RPM : %u\r\n", fan_rpm );
    fan8_read_temperature ( &fan8, FAN8_TEMP_CHANNEL_2, &temperature );
    log_printf( &logger, " Temperature : %.2f C\r\n\r\n", temperature );

    if ( !fan8_check_fault_indicator ( &fan8 ) )
    {
        log_printf( &logger, " Fault detected!\r\n\r\n", temperature );
    }

    Delay_ms ( 500 );
}

Note

The MAX6615 measures the tachometer signal every 67s, therefore the fan RPM value will be updated once per 67s. An NTC 10K3 thermistor is required for proper temperature measurements.

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.FAN8

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 MikroElektronika compilers.


ALSO FROM THIS AUTHOR

MCP2517FD click

6

MCP2517FD Click is a compact add-on board representing a complete CAN solution used as a control node in a CAN network. This board features the MCP2517FD and ATA6563, an external CAN FD controller with an SPI interface, and a high-speed CAN transceiver from Microchip. The ATA6563, a low-level physical layer IC (PHY), provides a physical connection with the CAN bus itself, while the CAN controller MCP2517FD represents an interface between the MCU and the PHY. It features three operating modes with dedicated fail-safe features, remote wake-up via CAN, and ideally passive behavior when powered off on the CAN bus. This Click board™ is suitable for developing a wide range of automotive diagnostic applications, even on MCUs that don’t support CAN interface.

[Learn More]

6DOF IMU 16 Click

0

6DOF IMU 16 Click is a compact add-on board with a 6-axis inertial measurement device. This board features the ICM-42605, a premium performance 6-axis MotionTracking™ IMU from TDK InvenSense. It combines a 3-axis gyroscope and a 3-axis accelerometer, supporting the lowest gyroscope and accelerometer sensor noise in this IMU class. It also has the highest stability against temperature, shock, SMT/bend-induced offset, and more.

[Learn More]

H-Bridge 3 Click

0

H-Bridge 3 Click is designed for the control of small DC motors and inductive loads, it features TLE9201SG a general purpose 6A H-Bridge perfectly suited for industrial and automotive applications. This IC meets the harsh automotive environmental conditions and it is qualified in accordance with the AEC-Q100 standard, also has set of features such as the short circuit and over-temperature protection, under-voltage protection, detailed SPI diagnosis or simple error flag and fully 3.3/5.5V compatible logic inputs.

[Learn More]