TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (347 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 (136217 times)
  2. FAT32 Library (69478 times)
  3. Network Ethernet Library (55705 times)
  4. USB Device Library (45989 times)
  5. Network WiFi Library (41638 times)
  6. FT800 Library (40780 times)
  7. GSM click (28788 times)
  8. PID Library (26327 times)
  9. mikroSDK (26051 times)
  10. microSD click (25139 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: 4780 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

MIC24045 click

6

MIC24045 click carries MIC24045 I2C-programmable, high-efficiency, wide input range, 5A synchronous step-down regulator from Microchip. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over I2C interface.

[Learn More]

Magnetic Rotary 3 click

0

Magnetic Rotary 3 Click is a compact add-on board for accurate magnet-position sensing. This board features the AS5147, an SPI-configurable high-resolution rotary position sensor for fast absolute angle measurement over a full 360-degree range from ams AG.

[Learn More]

VU Meter click

0

VU Meter Click is a compact add-on board representing a volume unit meter that displays the intensity of an audio signal. This board features the LM3914, a monolithic integrated circuit that senses analog voltage levels and drives a 10-segment bar graph display from Texas Instruments. This Click board™ is manufactured with a sound detecting device (microphone), Op-Amp, and the LM3914, which gleams the bar graph display according to the sound’s quality. The LM3914 is an analog-controlled driver meaning it can control (turn ON or OFF) a display by an analog input voltage and eliminates the need for additional programming.

[Learn More]