TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (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 (136998 times)
  2. FAT32 Library (70116 times)
  3. Network Ethernet Library (56027 times)
  4. USB Device Library (46347 times)
  5. Network WiFi Library (41966 times)
  6. FT800 Library (41286 times)
  7. GSM click (29055 times)
  8. mikroSDK (26489 times)
  9. PID Library (26447 times)
  10. microSD click (25413 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 2 click

Rating:

6

Author: MIKROE

Last Updated: 2019-05-03

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: Brushless

Downloaded: 4893 times

Not followed.

License: MIT license  

Fan 2 click carries the MAX31760 precision fan-speed controller. It can also measure temperature and adjust the fan speed to keep the temperature at the same level.

The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over I2C interface.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Fan 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Fan 2 click" changes.

Do you want to report abuse regarding "Fan 2 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Fan 2 click

Fan 2 click

Native view of the Fan 2 click board.

View full image
Fan 2 click

Fan 2 click

Front and back view of the Fan 2 click board.

View full image

Library Description

The library initializes and defines the I2C bus driver and drivers that offer a choice for writing and reading
one byte or two bytes of data in and from registers. The library includes a functions for reading temperature from internal or external sensor,reading and writing from control registers, fan fault duty cycle register, alert mask register, ideality factor Register, remote\local high set-point register,remote\local overtemperature set-point register, TACH count threshold registers, lookup table registers, direct duty-cycle control register and EEPROM LOAD/WRITE register.Current PWM duty-cycle register TACH1 count register, TACH2 Count register and status register can only be read. User can also use functions to check the state of the ALR SHD FF INT pins.

Key functions:

  • void fan2_writeCtrl1( uint8_t wrData ) - Function writes 8-bit data into control register 1.
  • float fan2_readLocalTempReg() - Function is used to read temperature from an internal measuring device.
  • void fan2_writeLookupTable( uint8_t lutVal ) - Function is used to write into Lookup Table registers.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes I2C module, LOG and GPIO structures, sets AN, RST, CS and INT pins as input.
  • Application Initialization - Initalizes I2C driver, applies manual control settings and makes an initial log.
  • Application Task - (code snippet) This example demonstrates the use of Fan 2 Click board. It measures current temperature, using an internal sensor and logs values. In case of temerature exceeding 30 degree centigrade it rans a fan.
void applicationTask( )
{
    temperature = fan2_readLocalTempReg();

    FloatToStr( temperature, logTxt );
    mikrobus_logWrite( "Temperature : ", _LOG_TEXT );
    mikrobus_logWrite( logTxt, _LOG_TEXT );
    mikrobus_logWrite( degCel, _LOG_LINE );
    if( temperature > 30 )
    {
        fan2_writeDirDutCycCtrlReg( _FAN2_DUTYCYCLE_100 );
    }
    else
    {
        fan2_writeDirDutCycCtrlReg( _FAN2_DUTYCYCLE_0 );
    }
    Delay_ms( 1000 );
}

Other mikroE Libraries used in the example:

  • I2C
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

ALSO FROM THIS AUTHOR

UWB 2 click

0

UWB 2 Click is a compact add-on board that brings Ultra-Wideband communication to any solution. This board features the DWM3000, an IEEE 802.15-z UWB transceiver module from Qorvo. This module fully aligns with FiRaTM PHY, MAC, and certification development. It uses an integrated UWB antenna to establish wireless communication in UWB channels 5 (6.5GHz) and 9 (8GHz). This Click board™ makes the perfect solution for developing precision real-time location systems (RTLS) using two-way ranging or TDoA schemes in various markets, location-aware wireless sensor networks (WSNs), and more.

[Learn More]

LED Driver 3 click

0

LED Driver 3 click is an RGB LED driver, capable of driving RGB LEDs with up to 30mA per segment, via the digital I2C interface.

[Learn More]

Mikromedia 5 for PIC32MZ Capacitive

0

This project contains demo example for Mikromedia 5 for PIC32MZ Capacitive.

[Learn More]