AN2680 Application note



Similar documents
AN2389 Application note

AN3332 Application note

EVL185W-LEDTV. 185 W power supply with PFC and standby supply for LED TV based on the L6564, L6599A and Viper27L. Features.

BD241A BD241C. NPN power transistors. Features. Applications. Description. NPN transistors. Audio, general purpose switching and amplifier transistors

2STBN15D100. Low voltage NPN power Darlington transistor. Features. Application. Description

ST High voltage fast-switching NPN power transistor. Features. Applications. Description

BD238. Low voltage PNP power transistor. Features. Applications. Description. Low saturation voltage PNP transistor

AN3110 Application note

AN2604 Application note

TN0023 Technical note

ULN2801A, ULN2802A, ULN2803A, ULN2804A

Single LNB supply and control IC DiSEqC 1.X compliant with EXTM based on the LNBH29 in a QFN16 (4x4) Description

BD135 - BD136 BD139 - BD140

ULN2001, ULN2002 ULN2003, ULN2004

Order code Temperature range Package Packaging

AN3998 Application note

DDSL01. Secondary protection for DSL lines. Features. Description

AN3353 Application note

AN4108 Application note

AN3354 Application note

LM337. Three-terminal adjustable negative voltage regulators. Features. Description

L6234. Three phase motor driver. Features. Description

ST19NP18-TPM-I2C. Trusted Platform Module (TPM) with I²C Interface. Features

STN3NF06L. N-channel 60 V, 0.07 Ω, 4 A, SOT-223 STripFET II Power MOSFET. Features. Application. Description

ESDLIN1524BJ. Transil, transient voltage surge suppressor diode for ESD protection. Features. Description SOD323

LM134-LM234-LM334. Three terminal adjustable current sources. Features. Description

LM135-LM235-LM335. Precision temperature sensors. Features. Description

AN3265 Application note

Description. Table 1. Device summary

SPC5-FLASHER. Flash management tool for SPC56xx family. Description. Features

STP60NF06FP. N-channel 60V Ω - 30A TO-220FP STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

STP60NF06. N-channel 60V Ω - 60A TO-220 STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

AN4156 Application note

Description. Table 1. Device summary. Order code Temperature range Package Packaging Marking

UM1613 User manual. 16-pin smartcard interface ST8034P demonstration board. Introduction

EN: This Datasheet is presented by the m anufacturer. Please v isit our website for pricing and availability at ore.hu.

L78MxxAB L78MxxAC. Precision 500 ma regulators. Features. Description

BZW50. Transil, transient voltage surge suppressor (TVS) Features. Description

MC Low noise quad operational amplifier. Features. Description

AN2824 Application note

ETP01-xx21. Protection for Ethernet lines. Features. Description. Applications. Benefits. Complies with the following standards

Description. IO and RF AGC. ASIC controller and power management. Carrier recovery loop. GPIO switch matrix. Lock indicator and monitoring DVBS2 FEC

STCS A max constant current LED driver. Features. Applications. Description

VN05N. High side smart power solid state relay PENTAWATT. Features. Description

UM0985 User manual. Developing your STM32VLDISCOVERY application using the IAR Embedded Workbench software. Introduction

DSL01-xxxSC5. Secondary protection for DSL lines. Features. Description. Applications. Benefits. Complies with the following standards

STP55NF06L STB55NF06L - STB55NF06L-1

AN2557 Application note

M24LRxx/CR95HF application software installation guide

STEVAL-IEG001V2. Smart real-time vehicle tracking system. Features

STTH2R06. High efficiency ultrafast diode. Features. Description

AN3252 Application note

UA741. General-purpose single operational amplifier. Features. Applications. Description. N DIP8 (plastic package)

AN3359 Application note

AN4368 Application note

STCS1A. 1.5 A max constant current LED driver. Features. Applications. Description

AN2760 Application note

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

AN2866 Application note

TDA W CAR RADIO AUDIO AMPLIFIER

AN2703 Application note

AN235 Application note

STTH1R04-Y. Automotive ultrafast recovery diode. Features. Description

Obsolete Product(s) - Obsolete Product(s)

AN3990 Application note

STLM20. Ultra-low current 2.4 V precision analog temperature sensor. Features. Applications

STCS2A. 2 A max constant current LED driver. Features. Applications. Description

UM1676 User manual. Getting started with.net Micro Framework on the STM32F429 Discovery kit. Introduction

LM2901. Low-power quad voltage comparator. Features. Description

Description SO-8. series. Furthermore, in the 8-pin configuration Very low-dropout voltage (0.2 V typ.)

STOD2540. PMOLED display power supply. Features. Application. Description

P6KE. Transil, transient voltage surge suppressor (TVS) Features. Description. Complies with the following standards

Table 1. Absolute maximum ratings (T amb = 25 C) Symbol Parameter Value Unit. ISO C = 330 pf, R = 330 Ω : Contact discharge Air discharge

Description. Table 1. Device summary. Order codes. TO-220 (single gauge) TO-220 (double gauge) D²PAK (tape and reel) TO-220FP

SPC5-CRYP-LIB. SPC5 Software Cryptography Library. Description. Features. SHA-512 Random engine based on DRBG-AES-128

AN4128 Application note

STB75NF75 STP75NF75 - STP75NF75FP

How To Write To An Eeprom Memory On A Flash Memory On An Iphone Or Ipro Memory On Microsoft Flash Memory (Eeprom) On A Microsoft Microsoft Powerbook (Ai) 2.2.2

STM6315. Open drain microprocessor reset. Features

STGB10NB37LZ STGP10NB37LZ

VN03. ISO high side smart power solid state relay PENTAWATT. Features. Description.

TDA2004R W stereo amplifier for car radio. Features. Description

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

AN3155 Application note

STP10NK80ZFP STP10NK80Z - STW10NK80Z

AN3327 Application note

UM1790 User manual. Getting started with STM32L053 discovery kit software development tools. Introduction

AN3270 Application note

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

MC34063AB, MC34063AC, MC34063EB, MC34063EC

STDP2690. Advanced DisplayPort to DisplayPort (dual mode) converter. Features. Applications

TDA2822 DUAL POWER AMPLIFIER SUPPLY VOLTAGE DOWN TO 3 V LOW CROSSOVER DISTORSION LOW QUIESCENT CURRENT BRIDGE OR STEREO CONFIGURATION

STB4NK60Z, STB4NK60Z-1, STD4NK60Z STD4NK60Z-1, STP4NK60Z,STP4NK60ZFP

TDA CHANNEL VOLUME CONTROLLER 1 FEATURES 2 DESCRIPTION. Figure 1. Package

AN438 APPLICATION NOTE SAFETY PRECAUTIONS FOR DEVELOPMENT TOOL TRIAC + MICROCONTROLLER

NE555 SA555 - SE555. General-purpose single bipolar timers. Features. Description

Obsolete Product(s) - Obsolete Product(s)

NE555 SA555 - SE555. General-purpose single bipolar timers. Features. Description

L6219. Stepper motor driver. Features. Description

Transcription:

Application note Fan speed controller based on STDS75 or STLM75 digital temperature sensor and ST72651AR6 MCU Introduction This application note describes the method of defining the system for regulating the speed of the 5 Vdc fan using an ST72651AR6 microcontroller and digital temperature sensor STDS75 or STLM75. The sensor measures the temperature data and communicates this data to the microcontroller. Based on this temperature data, the microcontroller issues a PWM signal with varying duty cycle to the fan for regulating its speed. The key features of the system are: Microcontroller with I 2 C interface and PWM peripheral to communicate with the sensor and for regulating the fan speed Digital temperature sensor to measure the ambient temperature 5 Vdc fan to show the speed regulation Section 1 highlights the features of the STDS75 or STLM75 sensor and explains its interfacing with the microcontroller. Section 2 explains BLDC fan management and PWM signal control to regulate the fan speed. Section 3 focuses on the hardware setup and in Section 4 the application flow of the system is defined. February 2008 Rev 1 1/15 www.st.com

Contents AN2680 Contents 1 Digital temperature sensor.................................... 3 1.1 Theory of operation.......................................... 3 1.2 Interfacing of sensor with the microcontroller....................... 4 1.3 Configuring the sensor........................................ 4 1.4 Alarm signal behavior......................................... 4 2 BLDC fan.................................................. 5 2.1 Principle used for fan speed control using PWM.................... 5 2.2 Method of fan speed control using a power MOSFET................ 5 2.2.1 PWM control using transistor at low side drive.................... 5 3 Hardware setup............................................. 7 3.1 Description of the hardware setup............................... 7 3.1.1 Sensor - microcontroller connection............................ 8 3.1.2 Microcontroller - fan connection................................ 8 4 Software flow............................................... 9 4.1 Description of fan control logic.................................. 9 4.2 Description of alarm control logic............................... 11 5 Firmware................................................. 12 6 References................................................ 13 7 Revision history........................................... 14 2/15

Digital temperature sensor 1 Digital temperature sensor The STDS75 and STLM75 are digital temperature sensors that measure the ambient temperature and give the digital output. Both the STDS75 and STLM75 are 8-pin ICs available in two packages, SO-8 and TSSOP-8. The measurable temperature range of the sensors is -55 C to 125 C. The STLM75 and STDS75 differ only in terms of the resolution of the temperature data. The STLM75 has a fixed 9-bit resolution whereas the STDS75 has configurable resolution starting from 9 to 12 bits. In the present application, we move with the default resolution settings of the sensor that is 9 bits and thus both the STDS75 and STLM75 are dealt with in the same manner. Figure 1. Temperature sensor pin description Table 1. Pin description Name Description SDA Serial data input output pin SCL Serial clock input pin Alarm Alarm output pin GND DC ground A0,A1,A2 Address lines VCC Supply voltage (2.7 V- 5.5 V) 1.1 Theory of operation This temperature sensor is a high-precision CMOS IC with a delta-sigma analog-to-digital converter (ADC) and I 2 C compatible serial digital interface. The on board delta-sigma ADC converts the measured temperature to a digital value that is calibrated in degree Celsius. Negative temperature is shown in two's compliment form. The sensor also has an alarm output signal. 3/15

Digital temperature sensor AN2680 1.2 Interfacing of sensor with the microcontroller The sensor supports the I 2 C communication protocol. It has 3 configurable address lines, thus can support up to 8 different addresses. All 3 address lines are grounded in the present application and hence the address of sensor is made 0x90. The sensor is connected to the microcontroller through 2 communication lines of I 2 C interface (SDA and SCL). 1.3 Configuring the sensor The sensor has 3 internal registers which are used to configure its behavior: 1. Configuration register: Tconfig (8-bit) 2. Oversaturation register: T os (16-bit) 3. Hysteresis register: Thys (16-bit) Based on the value configured in the configuration register the behavior of sensor is achieved. In our application these settings are made as 0x40. This setting configures the mode of operation of the sensor and the nature of the output alarm signal. For details, please refer to the STDS75 datasheet. The value set in the oversaturation register defines the threshold value at which fan starts. In our application the fan starts as the temperature rises above 29 degrees Celsius. Thus the setting for this register is made as 0x1D00. Also as the temperature rises above this oversaturation value the alarm signal turns ON. This alarm is shown as an LED in the system. A setting in the hysteresis register is used to control the output of the alarm output signal of sensor. It is set at 27 degrees Celsius in our application which means that as the temperature falls below 27 degrees Celsius the alarm goes OFF. Thus the settings for this register are made 0x1B00. 1.4 Alarm signal behavior The alarm signal of the sensor is configured to go ON when the measured temperature exceeds 29 degrees Celsius and goes OFF when the temperature falls below 27 degrees Celsius. 4/15

BLDC fan 2 BLDC fan The basic DC brushless fan is a 2-wire device over which a DC voltage is applied. Brushless DC fans are called "brushless" because the electric motor is commutated electronically. The basic brushless DC motor consists of two main parts: a) the rotor b) the stator a) Rotor: As the name implies, the rotor is the part that rotates. The rotor houses the permanent magnets, and in the case of the fan, the fan blades are also attached to the rotor. The number of poles in the permanent magnet varies according to the characteristics of the motor. b) Stator: The stator is the stationary part of the motor. It consists of the motor coil number which varies according to the characteristics of the motor. The stator for the 2-phase motor consists of four coils. 2.1 Principle used for fan speed control using PWM The speed of the DC fan can be modified by varying the DC voltage across the two terminals of the fan motor. However if we take a DC fan and switch on the DC supply across it, the fan motor takes some time to speed up.this is because the fan motor has an inductive coil so it does not respond immediately to the applied voltage. If we switch the power off before the motor reaches full speed, the motor starts to slow down. If we switch the power on and off quickly enough the fan motor and hence the fan run at some speed between the zero and full speed. This is what is achieved through the PWM signal. The fan speed can be modified with the variation in the duty cycle of the PWM signal. 2.2 Method of fan speed control using a power MOSFET To control the speed of the DC fan using the PWM signal, we need to use a switch which can be switched on and off at PWM frequency and hence control the supply voltage across the motor of the DC fan. This switch can be made by using a high switching speed power MOSFET. The action of switch is to connect and disconnect the power across the fan at PWM frequency. 2.2.1 PWM control using transistor at low side drive In low side drive connection, the fan positive terminal is kept at constant DC voltage (5 V for 5 V fan) while the negative terminal of the fan is connected to the drain of power MOSFET. The source of the power MOSFET is connected to ground. The PWM signal is applied to the gate terminal of the power MOSFET, thus the power MOSFET switches between on and off condition at the rate of the PWM signal. When the power MOSFET is ON, the current builds up in the coil of the fan motor and the fan starts to attain speed, whereas when the power MOSFET is off, the fan starts losing speed. Figure 2 illustrates the low side drive transistor. 5/15

BLDC fan AN2680 Figure 2. Low side drive circuit LOW SIDE DRIVE 5 Volt DC DC Fan PWM Drive Signal N-MOSFET The speed of the DC fan can be regulated by the PWM drive signal that changes the supply across the DC fan. So, varying the duty cycle of this PWM signal modifies the fan speed. At 100% duty cycle the fan runs at full speed. 6/15

Hardware setup 3 Hardware setup This system consists of an ST72651AR6 microcontroller, STDS75 or STLM75 temperature sensor, 5 V BLDC fan, N-channel power MOSFET and an alarm LED. The power to the system is provided through USB power. Figure 3 shows the setup for the system. Figure 3. Connection diagram of the system VCC 5 Volts FAN 10 k 10 k NMOS 1k VCC PWM MCU I2C SDA SCL LED I2C VCC TS (1) A0 ALARM A1 GND A2 GND Note: 1 Temperature sensor STDS75/STLM75 3.1 Description of the hardware setup The complete system is shown in Figure 3 with the temperature sensor and fan control logic. Major components used in the system are: Microcontroller: ST72651AR6 BLDC fan: 5 V Temperature sensor: STDS75 N-Channel power MOSFET: STB100NF03L For this application we can also choose any other microcontroller having a PWM peripheral and I 2 C interface. 7/15

Hardware setup AN2680 3.1.1 Sensor - microcontroller connection The sensor is connected to the microcontroller using two communication lines of I 2 C interface (SDA and SCL). The address lines of the sensor are grounded so that the address of the sensor is hardwired to 0x90 (refer to the STDS75 datasheet for details). An LED is connected to the alarm output of the sensor to show the alarm signal. Power to the sensor is provided through the 5 V USB power. A pull resistor of 10 kω is connected to the SDA and SCL line of the I 2 C interface. 3.1.2 Microcontroller - fan connection Fan control is achieved through the MOSFET switching action due to PWM signal coming to its gate terminal. An N-channel MOSFET is used in the low side driving of the fan. The positive terminal of the fan is connected to the 5 V power supply and the negative terminal of the fan is connected to the drain of the MOSFET. The source of the MOSFET is grounded while the gate is driven by the PWM output of the microcontroller. Current limiting resistors are connected to the gate terminals of the MOSFET. 8/15

Software flow 4 Software flow The software architecture of the system demonstrates the flow of control of the fan speed on the basis of digital temperature sensed. Figure 4 shows the flow chart of the MCU firmware for the system. Figure 4. Software flow diagram for fan control Power up the system Initialize the I 2 C communication Configure the Temperature Sensor Device Measure the temperature (T) Switch of the Fan T > = Tos No Yes Switch ON the Fan and ramp up the speed with temperature No T > = Tmax Yes Run Fan at maximum Speed 4.1 Description of fan control logic For fan control logic, the microcontroller monitors the temperature continuously and changes accordingly the duty cycle of the PWM output signal controlling the fan. Firstly the system is initialized and temperature is measured. This measured temperature is compared with the threshold value (T os ) set in the oversaturation register (29 degrees Celsius). If the measured temperature is greater than this value, then the fan is switched ON and the temperature is monitored again. The duty cycle of the PWM signal is changed from 9/15

Software flow AN2680 0 to 100% as the measured temperature increases from T os to T max. T max is the value of the temperature set through the firmware at which the fan runs at maximum speed. Thus to control the duty cycle of the PWM signal a linear relationship is established between the measured temperature and the duty cycle of PWM. As the measured temperature ramps up, the duty cycle is also moved towards 100%. The linear relationship with temperature is controlled by the following conditions: Temperature < threshold value; duty cycle is made 0% and thus fan is OFF. Threshold value <Temperature < T max value; duty cycle is ramped linearly towards 100%, thus fan runs at variable speed. Temperature> T max value; duty cycle is made 100%, thus fan runs at maximum speed. The duty cycle is handled by writing in the registers of the PWM peripheral of the microcontroller. Figure 5. Software flow diagram for alarm control Power up the system Initialize the I 2 C communication Configure the Temperature Sensor Device Measure the temperature (T) Is T >= Tos? YES NO NO Is Alarm LED ON? Alarm LED ON YES Measure the temperature (T) NO Is T <= Thys? YES Alarm LED OFF 10/15

Software flow 4.2 Description of alarm control logic T os is the temperature setting put in the oversaturation register and Thys is the temperature setting put in the hysteresis register. In our application these values are: T os = 0x1D00 (29 degrees Celsius) Thys = 0x1B00 (27 degrees Celsius) T max = 40 degrees Celsius The temperature measurement is put in continuous loop. As the measured temperature rises above T os for the first time the alarm goes ON. It remains ON until the temperature falls below the Thys value for first time. Thus alarm behavior for measured temperature (T): T >= T os ; alarm ON Thys < T < T os ; alarm ON T<= Thys; alarm OFF 11/15

Firmware AN2680 5 Firmware All the source files are in 'C' language and the application uses ST7 firmware library functions. The source files are only for guidance. STMicroelectronics shall not be liable for any direct, indirect or consequential damages with respect to any claim arising from use of this software. 12/15

References 6 References 1. ST72651AR6 microcontroller datasheet 2. STDS75 temperature sensor datasheet 3. STLM75 temperature sensor datasheet 4. STB100NF03L power MOSFET datasheet 5. ST7 software manual user library 13/15

Revision history AN2680 7 Revision history Table 2. Document revision history Date Revision Changes 06-Feb-2008 1 Initial release 14/15

Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2008 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 15/15