You are on page 1of 74

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

“JNANA SANGAMA”, BELAGAVI-590018, Karnataka

Project Report on

“THERMAL STATE SENSING AND REGULATION MODULE FOR


A 100W POWER AMPLIFIER”
Submitted in the partial fulfilment for award of degree of

Bachelor of Engineering in

Electronics and Communication Engineering

Submitted by
N KOTRESH-1BI16EC089

NITHISH B M-1BI16EC112

SHRUTHI R G-1BI16EC184

Project carried out at

BEL. Bengaluru

Internal guide
Dr. C R BYRA REDDY
Professor
Department of ECE, BIT

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


BANGALORE INSTITUTE OF TECHNOLOGY
2019-2020
BANGALOREINSTITUTEOF TECHNOLOGY
K.R.Road, V.V.Pura,Bangalore-560004

DEPARTMENTOF ELECTRONICSANDCOMMUNICATION
ENGINEERING

CERTIFICATE
This is to certify that the project work entitled “Thermal Sensing and Regulation
module for 100W Power Amplifier”, carried out by Mr.N Kotresh (1BI16EC089),
Mr.Nithish BM (1BI16EC102), Ms.Shruthi R G (1BI16EC184), bonafide students of
Bangalore Institute of Technology in partial fulfillment for the award of degree of
Bachelor of Engineering in Electronics and Communication Engineering, affiliated to
Visvesvaraya Technological University, Belagavi during the year 2019-2020. It is
certified that all corrections or suggestions indicated for internal assessment have been
incorporated in the record. The project work has been approved as it satisfies the
academic requirements in respect of project work prescribed by the said Degree.

Signature of Internal Guide Signature of HOD Signature of thePrincipal


(Dr. C R Byra Reddy) (Dr. K.V. Prasad) (Dr. Aswath.M.U)

EXTERNALVIVA

Name of Examiners Signature with Date

1.

2.
ACKNOWLEDGEMENT

The project conduction opportunity we had with BEL was a great chance for learning and professional
development. Therefore, we consider ourselvesto be very fortunate as we were provided with an
opportunity to be a part of BEL. We are also grateful for having a chance to meet so many great
personalities and professionals who led us through this project period.

We wish to express our sincere gratitude to our guide Dr. C. R. BYRA REDDY, professor, ECE
department, BIT for his patience, motivation and support throughout.

We take this opportunity to express our deepest gratitude and special thanks to our guide at BEL,
Mr.ABHINAV SONI, senior engineer, MilCom division who in spite of being busy with his schedule
andduties, took time to hear, guide and keep us on the correct path and allowing us carry out our project in
BEL.

We are thankful to Dr. K V PRASAD, HOD, Dept of ECE, Bangalore Institute of Technology,
BANGALORE for all his support and valuable suggestions.

We are thankful to Dr. ASHWATH.M.U, Principal, Bangalore Institute of Technology,


Bengaluru for all his support in completing cause.

. It is our radiant sentiment to place on record our best regards, deepest sense of gratitude to all our
senior officers, project trainee, employees and foremen for their careful and precious guidance which were
extremely valuable for my project study both theoretically and practically. I perceive this opportunity as a
big milestone in my professional career development.

We would like to thank all the staff members of Department of Electronics and Communication
Engineering for their constant support and encouragement. It would be our privilege to express our
heartfelt gratitude and respect to BANGALORE INSTITUTE OF TECHNOLOGY which has given us
an opportunity to present this project report.

N Kotresh-1BI16EC089

Nithish B M-1BI16EC112

Shruthi R G-1BI16EC184

i
ABSTRACT

Power amplifiers are critical in Radio frequency communication chain used in Commercial as
well as defense requirements. Particularly in Defense applications where the temperature variability is
huge, thermal management acquires more significance.

This 100 watts Power amplifier is used in RF communication among Indian Naval Ships along with
other sub-systems like Data link Radio unit, Power supply, GPS. This product has been designed
keeping in mind the link requirements of Indian Navy under a classified project.This power amplifier
has a pulsed power output of 100 W ±2dB over a frequency band of 970MHz-1230MHz with three
different levels of power control. It requires protection features for High load VSWR & over
temperature protection.

The mechanism for over temperature control and device protection is implemented here in this project.
It involves design of Controller card & software development which along with other things provides
for automatic thermal management.

ii
CONTENTS
Chapter 1

1.INTRODUCTION……………………………………………………………………..1
1.1 TYPES OF AMPLIFIERS………………………………………………………….....2
1.2 APPLICATIONS OF AMPLIFIERS……………………………………………….....3
1.3 PURPOSE OF STUDY…………………………………………………………….....4
Chapter 2
2.LITERATURE SURVEY……………………………………………………………..5

Chapter 3
3. REQUIREMENT ANALYSIS……………………………………………………….7
3.1 HARDWARE REQUIREMENTS……………………………………………….......7
3.2 SOFTWARE REQUIREMENTS…………………………………………………....13
Chapter 4
4. METHODOLOGY AND IMPLEMENTATION………………………………….18

4.1 BLOCK DIAGRAM………………………………………………………………...18


4.2 IMPLEMENTATION…………………………………………………………….....21
Chapter 5
5.RESULTS…………………………………………………………………………….32
Chapter 6
6.APPLICATIONS…………………………………………………………………….34

Chapter 7
7.CONCLUSION AND FUTURE WORK…………………………………………...35
Chapter 8
8.REFERENCES……………………………………………………………………….36
Chapter 9
9.APPENDIX……………………………………………………………………….......37
9.1 HARDWARE SPECIFICATIONS……………………………………………….....37

9.2 SOFTWARE SPECIFICATIONS……………………………………………….......51


9.3 SOURCE CODE........................................................................................................54
iii
LIST OF FIGURES
Figure 1.1.1:Block diagram of an audio system……………………………..1
Figure 3.1.1:San Ace 60 ............................……………………………...7
Figure 3.1.2:Pin diagram of ADT7470............……………………………...8
Figure 3.1.3:Eval-ADT7470EBZ Dev Board………………………………..9
Figure 3.1.4:TC74 ..........................……………………………………...9
Figure 3.1.5:TC74 Pin diagram…………………………………………….10
Figure 3.1.6:PIC32MZ Starter kit…………………………………………..11
Figure 3.2.1:MP LAB main window……………………………………….14
Figure 3.2.2:MP LAB Successful project built…………………………….15
Figure 3.3.1:I2C Protocol…………………………………………………..16
Figure 4.1.1:Block Diagram of hardware…………………………………..18
Figure 4.2.1:Connection of the components………………………………..21
Figure 4.2.2:Base board top view ofPIC32MZ……………………………22
Figure 4.2.3:Interfacing with the PIC board and ADT7470………………..22
Figure 4.2.4:Reading the temperature……………………………………...25
Figure 4.2.5:Setting the Fan speed…………………………………………28
Figure 4.2.6:Reading the Fan speed………………………………………..31
Figure 5.1:Working model of setup………………………………………33
Figure 5.2:Plot of temperature vs speed………………………………….34
Figure 9.1.1:PIC Starter kit………………………………………………39
Figure 9.1.2:I2C Status Register…………………………………………41
Figure 9.1.3:I2C Control Register……………………………………….43
Figure 9.1.4:Pin diagram of ADT7470……………………………………47
Figure 9.1.5:Pin diagram of TC74……………………………………….50
Figure 9.1.6:Cross section view of the fan………………………………51
Figure 9.1.7:Speed characteristics…………………………………………51
Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Chapter1

INTRODUCTION

A power amplifier is an electronic device that is designed to increase the magnitude of

power of a given input signal. The power of the input signal is increased to a higher level

such that it is enough to drive loads of output devices like speakers, headphones, RF

transmitters etc. Unlike voltage or current amplifiers, power amplifiers are designed to

drive loads directly and are used as a final block in an amplifier chain.

The input signal to a power amplifier needs to be above a certain threshold value. Instead

of directly passing the raw audio or RF signal to the power amplifier, it is first pre-

amplified using current or voltage amplifiers and is sent as input to the power amplifier

after making necessary modifications. It can also be observed from the block diagram of

an audio amplifier shown below.

Figure 1.1 Block diagram of an audio system

In the above discussed case, a microphone is used as an input source and the magnitude

of signal from the microphone is not enough for the power amplifier. This calls for a need

to first pre-amplify the input signal where its voltage and current are increased slightly.

Then the signal is passed through tone and volume controls circuit which makes the

Department of Electronics and Communication, BIT Page 1


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

aesthetic adjustments to the audio waveform. Finally, the signal is passed through a

power amplifier and the output from power amplifier is fed to a speaker.

1.1 Types of Power Amplifiers

Depending on the type of output device that is connected, the power amplifiers are

divided into the following categories.

1.1.1 Audio Power Amplifiers

This type of power amplifiers are used for increasing the magnitude of power of a weaker

audio Signal. The amplifiers which are used in speaker driving circuitries of televisions,

mobile phones etc. come under this category.

The output of an audio power amplifier ranges from a few milli watts (like in headphone

amplifiers) to thousands of watts (like power amplifiers in Hi-Fi/Home theatre systems).

1.1.2 Radio Frequency Power Amplifiers

Wireless transmission requires modulated waves to be sent over long distances via air.

The signals are usually transmitted using antennas and the range of transmission depends

on the magnitude of power of signals fed to the antenna.

For wireless transmissions like FM broadcasting, antennas require input signals at a range

of thousands of kilowatts of power. Radio Frequency Power amplifiers here are employed

to increase the magnitude of power of modulated waves to a level high enough for

reaching required transmission span.

Department of Electronics and Communication, BIT Page 2


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

1.1.3 DC Power Amplifiers

DC power amplifiers are used to amplify the power of a PWM (Pulse Width Modulated)

signals. They are used in electronic control systems which need high power signals to

drive or actuators motors. They take input from microcontroller systems, increase its

power and feed the amplified signal to DC motors or Actuators.

1.2 Applications of power amplifiers:

There are wide ranges of applications of these amplifiers in the various sectors.

• These are used in variety of devices such as headphones, microwave ovens, home

theatre systems, etc. These form the most important part of the basic electronics

that comes under the category of the household needs and consumer’s range.

• To control servo motors and the specific DC motors, the power amplifiers are

widely utilized.

• As the wireless transmission requires high-frequency range for the transmission of

the signals over a long distance, the power amplification is beneficial in such areas

of work. Higher the levels of power, higher are the transfer rate of data and its

usability.

• Power amplifiers are also utilized in the types of equipment designed for the

communication of the satellites.

Department of Electronics and Communication, BIT Page 3


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

PURPOSE OF STUDY

Being a prime part of several setups and equipments, power amplifiers are prone to wear

and tear and their performance degrades with time. This process fastens if the temperature

within the power amplifier is more than the allowable value. The gain value of the

amplifier decreases if the temperature is high. Hence controlling the temperature within

the power amplifier is of prime importance. In this project, we intend to address the above

problem and offer an optimal solution using cost efficient and mass friendly resources.

Department of Electronics and Communication, BIT Page 4


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Chapter2
LITERATURE SURVEY
The various references used:

Dr.Sudha Senthil Kumar, Dr. K. Brindha [1]

This paper describes about the working of an automatically temperature controlled DC

fan.The main objective of this paper is to device a temperature controlled fan using the

analog components and to measure the threshold temperature for which the fan works

satisfactorily. An alarm circuit is attached to indicate the fan turn on. This device can be

used in smart homes. The temperature controlled dc fan is designed to turn off and turn on

according to the temperature of the surroundings. This device majorly functioning on the

behaviour of the thermistor and has a major advantage in power saving aspect. The device

will be designed in a way that the critical temperature (the minimum temperature) to turn

on the fan will be modified in accordance to the choice of the user.

Nigade A. S, Deepanshu Verma [2]

The research paper presented here is based on automatic fan speed controller that

automatically adjusts the fan's speed according to ambient temperature of the

surroundings. The temperature flow controlled fan used or mentioned here is an

automated fan, controlled by a temperature sensor. The heart of this project comprises of

the temperature sensor circuit which senses the change in the ambient temperature of the

surrounding. Here pulse width modulation technique is used. When heat is applied to the

temperature sensor which this will indicate it to the fan automatically increasing or

decreasing in speed according to the four speed levels of a normal fan that are set to

different temperature ranges.

Department of Electronics and Communication, BIT Page 5


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Shivesh, Rishabh Mishra, and Dr. E.Annie Elisabeth [3]

Usually, the traditional system fans run at high speed at high temperature and the opposite

at lower temperature. In this paper, to control the speed of the fan a circuit comprising

of microcontroller PIC16F877A, temperature sensor, ultrasonic sensor, motor and few

electronic components is used. Moreover an ultrasonic sensor is used for automatic

detection of human body in the room depending on which the fan gets operated and LCD

is used to display the temperature, number of people in the room and the speed of the fan.

Department of Electronics and Communication, BIT Page 6


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

CHAPTER 3
REQUIREMENT ANALYSIS

The hardware components used in this project and the different softwares used for

the development of this project is briefed below.

3.1 HARDWARE REQUIREMENTS

1. San Ace(60x60x38 PWM Controller Fan)

San Ace 60 is a DC fan which includes a PWM controller, an integrated circuit

that varies the speed and airflow of a cooling fan using a pulse width modulated

(PWM) voltage in response to temperature variations. The PWM controller

provides external speed control of PWM control function fans. This contributes to

reducing the system power consumption and the fan noise.

Figure 3.1.1 San Ace 60

Department of Electronics and Communication, BIT Page 7


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

2. ADT7470

The ADT7470 is a multichannel, pulse-width modulation (PWM) fan controller and

monitor for any system requiring monitoring and cooling. This device

communicates with the system through a serial system management bus.

Figure 3.1.2 Pin diagram of ADT7470

The device has a single address line for address selection, a serial data line for reading

and writing addresses and data and an input line for serial clock. All control and

programming functions of the ADT7470 are performed over the serial bus, that supports

both fast I2C and SMBus specifications. When the ADT7470 monitoring sequence is

started, it cycles through each fan tach input to measure the fan speed. Measured values

from these inputs are stored in few value registers. These can be read out through the

serial bus or can be automatically compared with programmed limits stored in the limit

registers. The results of out-of-limit comparisons are stored in the status registers, which

can be read over the serial bus to flag out-of limit conditions. If fan speeds drop below

preset levels or a fan stalls for a while, an interrupt is generated. Similarly the

Department of Electronics and Communication, BIT Page 8


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

ADT7470 can flag fan over speed conditions by using limits set in the fan tach registers.

Figure 3.1.3 Eval-ADT7470EBZ Development Board

3. TC74 - TEMPERATURE SENSOR

Figure 3.1.4 TC74

Department of Electronics and Communication, BIT Page 9


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

The TC74 is a serially accessible digital temperature sensor particularly preferable

for low cost and small form- factor applications. Temperature data is converted to

an 8-bit digital word from the onboard thermal sensing element.

Communication with the TC74 is accomplished through a 2- wire SMBus or I2C

compatible serial port.

Temperature resolution is of the sensor is 1°C. Conversion rate is a nominal 8

samples/sec. Compactness, low installed cost and ease of use make the TC74 an

ideal choice for implementing thermal management in a wide variety of systems

FEATURES

• Outputs Temperature as an 8-Bit Digital Word

• Simple SMBus or I2C™ Serial Port Interface

• Solid-State Temperature Sensing

▪ ±3°C (max.) Accuracy from 0°C to +125°C

▪ ±2°C (max.) Accuracy from +25°C to +85°C

Figure 3.1.5 TC74 Pin diagram

Department of Electronics and Communication, BIT Page 10


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

4. PIC32 MICROCONTROLLER

PIC stands for “Peripheral Interface Controller”. The 32-bit PIC family offers a large

range of products from the industry’s lowest point to highest-point. PIC32

microcontrollers have high performance and great memory capabilities. They are

especially designed for high performance embedded systems applications. The

manufacturer supplies computer software for development along with it known as

MPLAB X, assemblers and C/C++ compilers under the MPLAB and PICKIT series. PIC

devices are widely popular with industrial developers due to their low cost, wide

availability, extensive set of application notes,, large user base, availability of low cost or

free development tools and serial programming.

Figure 3.1.6 PIC32MZ Starter kit

Department of Electronics and Communication, BIT Page 11


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Some of the salient features of the starter kit are listed below:

Operational Conditions:

1. 2.2v to 3.6v,-40c to +85c,

2. 2.2v to 3.6v,-40c to +105c.

Integrated software tools and libraries:

1. c/c++ compiler with native DSP/fractional.

2. MPLAB Harmony Integrated Software Framework.

3. TCP/IP, USB, Graphics and mTouch middleware.

Communication Interfaces:

1. Two CAN modules (with dedicated DMA channels)

2. Six UART modules (25 Mbps):

3. Supports up to LIN 2.1 and IrDA® protocols

4. Six 4-wire SPI modules (up to 50 MHz)

5. SQI configurable as additional SPI module (up to 80 MHz)

6. Five I2C modules (up to 1 Mbaud) with SMBus support

The I2C module in PIC32MZ starter kit provides complete hardware support for both

Slave and Multi-Master modes of the I2C serial communication standard.

Each I2C module of PIC32MZ offers the following key features:

• I2C interface supporting both slave and master operation

• I2C Slave and master modes support 7-bit and 10-bit addressing

Department of Electronics and Communication, BIT Page 12


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

• Bidirectional transfers between master and slaves are allowed by I2C port.

• Serial clock synchronization for the I2C port can be used as a handshake mechanism to

suspend and resume serial transfer

• I2C supports multi-master operation

3.2 SOFTWARE REQUIREMENT


1. MP LAB X IDE

MPLAB X IDE is a software program that is used to develop applications for Microchip

microcontrollers and digital signal controllers. This development tool is called an

Integrated Development Environment or IDE as it provides a single integrated

“environment” to develop code for embedded microcontrollers.

A development system for embedded controllers is a system of programs running on a

computer that helps to write, edit, debug and program the code which is the intelligence

of embedded systems applications into a microcontroller. MPLAB X IDE is such a

system which contains all the components needed to design and deploy embedded

systems applications.

Department of Electronics and Communication, BIT Page 13


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 3.2.1 MP LAB main window

With MPLAB X IDE, many tools can be selected, but they all will have a similar

interface, and the learning curve from simulator to low-cost in-circuit debugger to

powerful in-circuit emulator. Once the application has been debugged and is run in the

development environment, it needs to be tested on its own. A device can be programmed

with an in-circuit emulator, an in-circuit debugger, a development programmer, or a

device programmer.

Department of Electronics and Communication, BIT Page 14


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 3.2.2 MPLAB Successful project built

COMPONENTS OF MPLAB X IDE:

MPLAB X IDE includes:

• A full-featured programmer’s text editor that also serves as a window into the debugger.

• A project manager that provides integration and communication between the IDE and

the language tools.

• A number of assembler/linker suites for the development of firmware for respevtive

project’s device.

• A debugger engine that provides breakpoints, single stepping, Watches windows and all

the features of a modern debugger.

Department of Electronics and Communication, BIT Page 15


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

• A software simulator for all PIC MCU and ds PIC DSC devices. The simulator is

originally composed of several device-specific simulator executables. MPLAB X IDE

decides which one to use based on project’s device.

3.3 PROTOCOL USED

I2C – Inter Integrated Circuit


It is a synchronous bi-directional half duplex two wire serial bus. I2C bus comprises of

two bus lines namely serial clock (SCL) and serial data (SDA). I2C bus is a shared bus

system to which many I2C devices can be connected. The devices can be either master or

slave. The synchronized clock signal is always generated by the master.

Figure 3.3.1 I2C

The sequence of operations for communicating with an I2C slave device is as below:

1. Master device pulls SCL to ‘high’.

2. Master device pulls SDA ‘low’ when SCL is ‘high’ initiating start condition.

3. Master device sends the address of slave device with which it wants to

communicate over SDA line.

4. Master sends read or write bit according to the requirement.

Department of Electronics and Communication, BIT Page 16


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

5. Master waits for the acknowledgement from slave whose address is sent.

6. Upon receiving acknowledgement, master sends data to the slave over SDA line.

7. Once the data transmission is done, it waits for an acknowledgement from the

slave.

8. On receiving the acknowledgement, master device terminates the transfer by

making SDA ‘high’ when SCL is ‘high’ indicating the initiation of stop condition.

Department of Electronics and Communication, BIT Page 17


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Chapter 4

METHODOLOGY AND IMPLEMENTATION


4.1 Block Diagram

FAN PIC32MZ BOARD


TC74

POWER
ADT7470
SUPPLY

Figure 4.1.1: Block Diagram of Hardware


The block diagram of the hardware of the project is given above. The various

functionality of each of the block is given briefly here.

➢ PIC32MZ - The heart of the entire project is the PIC32MZ, a 32 bit

microcontroller. PIC32MZ DA family microcontrollers provide 4GB of

unified virtual address space. The starter kit used here belongs to this family.

They have 5 I2C modules inbuilt that support the communication. The

microcontroller is written upon with the program using the I2C protocol. It

behaves as the decision making device for the temperature input received and

decides the further course of action. The communication between the

microcontroller and the sensor and also that between the microcontroller nad

the ADT7470 is established through I2C protocol.

➢ ADT7470 - The ADT7470 controller is a multichannel temperature sensor and

Department of Electronics and Communication, BIT Page 18


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

PWM fan controller and fan speed monitor for systems requiring active

cooling. It interfaces directly to an I2C bus. The ADT7470 monitors

temperature sensor and controls the speed of fans. Control of the ADT7470 is

carried out using the serial system management bus (SMBus). The ADT7470

is connected to the bus as a slave device under the control of a master

controller which in this case is the PIC32MZ. The temperature sensor also

behaves as a slave device. Hence the PIC microcontroller here behaves as a

single master in a multi-slave environment.

➢ Temperature Sensor (TC74) - The TC74 is a serially accessible, digital

temperature sensor. Communication with the TC74 is accomplished via a 2-

wire SMBus/I2C compatible serial port. TC74 is an ideal choice for

implementing thermal management in a wide range of systems. The TC4 sensor

is placed on the oscillator part of the power amplifier where it detects the value

of the temperature. Since the temperature sensed is analog in nature, upon

reception of the data, it is converted to an 8-bit digital data and is sent to the

microcontroller. This acts as a slave device with the PIC microcontroller as a

master.

➢ The cooling device - San Ace 60 fan is used for this purpose. The chosen

dimension of the fan is 60×60×38 mm. It is a dc fan with PWM controller.

Initially the fan has 100% duty cycle while temperature has crossed the

threshold value and upon the appropriate instructions from ADT7470 through

the microcontroller, its speed is decreased or increased and the duty cycle is

varied correspondingly. This device is placed in the exterior edge of the power

amplifier setup so that no intrusion is caused due to its presence.

➢ MPLAB X IDE - MPLAB X IDE is a software program that is used to develop

Department of Electronics and Communication, BIT Page 19


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

applications for Microchip microcontrollers and digital signal controllers. The

code to process the received temperature reading is written in MPLAB using

embedded C. Similarly, the code to read the speed at which the fan is rotating

and to increase or decrease its speed appropriately as per the temperature input

is written here. Upon successful compilation, the program is run.

The work flow of the project is as follows:

1) Temperature sensor TC74 is placed on the metal coated oscillator unit of the

power amplifier.

2) The sensed temperature is converted into digital format and is sent to the

PIC32MZ microcontroller. TC74 acts as a slave device wrt to the

microcontroller. The communication between them is established through

the I2C protocol.

3) ADT7470 is connected to the microcontroller as a slave device. This is in-

turn connected to the San Ace 60 fan that is placed in the exterior part of the

power amplifier case.

4) If the sensed temperature exceeds the predefined threshold value, the

indication is sent and the fan is switched on. The cooling device will have a

100% duty cycle on exceeding the critical value which means that it runs

with the highest speed.

5) The rpm of the fan is monitored and the speed can be reduced upon the

reduction of the temperature inside the equipment. This helps in utilizing the

resources optimally.

Department of Electronics and Communication, BIT Page 20


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

4.2 Implementation

Figure 4.2.1 Connection of the components

4.2.1 Interfacing
This section includes the representation of the connection of the components to the

microcontroller evaluation kit.

The top assembly of the PIC32MZ DA starter kit Base Board includes several key

features. The slots that are utilized for interfacing in this project are discussed below.

1) USB Micro-B power supply connector (J4).

2) To facilitate application debug and development, a MCP2221 USB-to-UART/I2C

device (U1) is available.

3) Connector for an external debugger, such as MPLAB (J12).

Department of Electronics and Communication, BIT Page 21


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

4) 40-pin expansion connector for adding external boards (J15).

ADT7470

TC74

Figure 4.2.2 Base board top view of PIC32MZ starter kit


VDD

U SDA
S
B PIC32MZ BOARD SCL
PC TC74
GND
USB SDA SCL GND

PWM

FAN
TACH
+24V GND TACH PWM SDA SCL GND

+12V
ADT7470
GND

+24V GND +12 GND

POWER SUPPLY

Figure 4.2.3 Interfacing with the PIC board and ADT7470

Department of Electronics and Communication, BIT Page 22


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

To accomplish the communication of master with a slave, the software will sequence

through the following steps:

1. Turn on the I2C module by setting the ON bit to ‘1’.

2. Assert a Start condition on SCLx and SDAx.

3. Send the I2C device address byte to the slave with a write indication.

4. Wait for an Acknowledge from the slave and verify it.

5. Send the serial memory address high byte to the slave.

6. Wait for an Acknowledge from the slave and verify it.

7. Send the serial memory address low byte to the slave.

8. Wait for and verify an Acknowledge from the slave.

9. Assert a Repeated Start condition on SCLx and SDAx.

10. Send the device address byte to the slave with a read indication.

11. Wait for an Acknowledge from the slave and verify it.

12. Enable master reception to receive serial memory data.

13. Generate an ACK or NACK condition at the end of a received byte of data.

14. Generate a Stop condition on SCLx and SDAx.

Department of Electronics and Communication, BIT Page 23


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

To transmit and receive data using I2C:

I2CxTRN is a register to which transmit data is written. This register is used when the

I2C module operates as a master transmitting data to the slave, or as a slave sending reply

data to the master. If the I2C module receives another complete byte before the software

reads the previous byte from the I2CxRCV register.

Algorithm for sensing the temperature:

1. Read I2C1 Status register and I2C1 control register. Set and reset the control register

bits appropriately.

2. Send slave device address and turn on the I2C module (I2C3CONbits.ON = 1).

3. Initiate the start condition (I2C3CONbits.SEN = 1)

4. Send slave address along with a write bit and check for the acknowledgement.

5. Set the repeat start enable bit to one (I2C3CONbits.RSEN = 1).

6. Data is sent by the slave and reception occurs at the master end.

7. Receive enable bit is set high (I2C3CONbits.RCEN = 1).

8. After the data transmission, if the acknowledgement is received, the stop enable bit is

set.

9. The received data is stored in a register.

Execution of “Read_temperature” code in DEBUG mode yields the value of temperature

(in 2’s complement format) recorded by thermal sensor. Further, varying external

temperature on metal plate of TC74 results in different values of temp which is reflected

in corresponding register bits. (this was verified with the help of soldering iron).

Department of Electronics and Communication, BIT Page 24


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 4.2.4 Reading the temperature

Code snippet:

reg_e = I2C3STAT; // for reading I2C1 Status register

reg_d = I2C3CON; // for reading I2C1 control register

I2C3ADD = 0x90; // slave device address

I2C3BRG = 0x091; // BRG value for 100KHz cycle, clock 30MHz

I2C3CONbits.ON = 1; // turn ON I2C3

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x90; // send address of slave device + write bit high

I2C3CONbits.RSEN = 1; // Repeated start

Department of Electronics and Communication, BIT Page 25


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

I2C3TRN = 0x91; //slave transmission & master reception + READ BIT HIGH

I2C3CONbits.RCEN = 1;

while(I2C3CONbits.RCEN == 1);

while(I2C3CONbits.ACKEN == 1);

I2C3CONbits.PEN = 1;

Algorithm for setting fan speed:

1. Send slave device address and turn on the I2C module.

2. While the module is activated, initiate stop condition and then the start condition.

3. After setting start enable bit, send the slave address with write bit high.

4. Check for acknowledgement and then send device Id register address.

5. Upon receiving the acknowledgement, calculate the decimal value of duty cycle

using the formula given below with .0.39 as step size

reg_C = (float)(dutycycle)/(float)(0.39);

6. Check for the acknowledgement and set stop enable bit.

On entering the percentage value of required dutycycle in the “set_fan_speed” function,

the speed of the fan changes according to the dutycycle value. Thus, the fan speed control

can be achieved.

Department of Electronics and Communication, BIT Page 26


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Code snippet:

I2C3ADD = 0x5E; // slave device address

I2C3BRG = 0x091; // BRG value for 100KHz cycle, clock 30MHz

I2C3CONbits.ON = 1; // turn ON I2C3

I2C3CONbits.SEN = 1;

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5E; // send address of slave device + write bit high

while(I2C3STATbits.ACKSTAT == 1);

I2C3TRN = 0x34; //send address of Device ID register

while(I2C3STATbits.ACKSTAT == 1);

reg_C = (float)(dutycycle)/(float)(0.39);

I2C3TRN = reg_C; // decimal value of dutycycle is divided by step size of 0.39

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.PEN = 1;

Department of Electronics and Communication, BIT Page 27


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 4.2.5 Setting the fan speed

Algorithm for reading the fan speed:

1. Initiate a start condition and send slave device address with write bit high.

2. Check for acknowledgement and send the address of the lower byte of the tach3 slot.

3. Set the stop enable bit.

4. Initiate the start condition and send address of slave device with read bit high.

5. If the acknowledgement is received, set the receive enable bit.

6. While receive enable bit is set, check for the acknowledgement and set the stop

enable bit.

7. From the below format, calculate the value of the speed

tach_high = I2C3RCV;

reg_c = ((tach_high) << 8);

tach_value = (reg_c) | (tach_low);

rev = ((float)5400000)/((float)tach_value);

8. Return the rpm value.

Department of Electronics and Communication, BIT Page 28


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Executing the” Read_fan_RPM” function outputs the value of fan revolutions/minute in

hex. Hence the data of fan RPM can be passed to other application as per requirements.

Code snippet:

I2C3CONbits.SEN = 1; // initiate a start condition

I2C3TRN = 0x5E; // send address of slave device + write bit high

while(I2C3STATbits.ACKSTAT == 1);

I2C3TRN = 0x2E; // address of tach3 low byte

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5F; // send address of slave device + read bit high

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.RCEN = 1;

while(I2C3CONbits.RCEN == 1;

while(I2C3CONbits.ACKEN == 1);

I2C3CONbits.PEN = 1;

while(I2C3CONbits.PEN == 1);

Department of Electronics and Communication, BIT Page 29


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

tach_low = I2C3RCV;

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5E; // send address of slave device + write bit high

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3TRN = 0x2F; // address of tach3 low byte

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.PEN = 1;

while(I2C3CONbits.PEN == 1);

tach_high = I2C3RCV;

reg_c = ((tach_high) << 8);

tach_value = (reg_c) | (tach_low);

rev = ((float)5400000)/((float)tach_value);

Department of Electronics and Communication, BIT Page 30


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 4.2.6 Reading the fan speed

Algorithm for fan speed control with respect to temperature data

1. Save the current and previous sensed data.


2. If current temperature is greater than the maximum allowed value, raise an alarm.
3. Calculate the difference in temperature.
4. If temperature variation is greater than 2º, check the temperature range and
accordingly change the duty cycle.
5. If the current temperature is not exceeding 20 degrees, the fan is switched off.

Code snippet:

high_temp_limit= 80;

current_temp = Read_temperature ( );

SYS_CONSOLE_PRINT(“PA Temperature = %d\n”, current_temp);

if(current_temp > high_temp_limit)

PORTGbits.RG7 = 1; // Glow indication


Department of Electronics and Communication, BIT Page 31
Thermal state sensing and regulation module for 100W power amplifier 2019-2020

SYS_CONSOLE_PRINT(“high temperature >90 degrees\n”);

diff_temp = current_temp – prev_temp;

if (diff_temp >2 || diff_temp <-2)//change the speed if there is variation of more than 2º

if ( current_temp > 45) // 100% duty cycle if temp is more than 45 deg

set_fan_speed(FAN1, 99);

set_fan_speed(FAN2, 99);

set_fan_speed(FAN3, 99);

Department of Electronics and Communication, BIT Page 32


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Chapter 5

RESULTS
After the setup is completed, the model is now working. The following results were

achieved from the designed model.

➢ The TC74 sensor is sensing the temperature of the surrounding it is placed in.

➢ The data is sent to the PIC32MZ starter kit.

➢ If the sensed temperature is exceeding the threshold value, the ADT7470 sends an

indication to the fan initiating its movement.

➢ The fan rpm is monitored.

➢ Upon reduction in the temperature in the power amplifier, the speed of the fan is

gradually reduced.

Figure 5.1 Working model of the setup

Department of Electronics and Communication, BIT Page 33


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

The monitored values are plot to produce the below graph. It can be seen that the speed of

the fan increases along with the increase in temperature.

Figure 5.2 Plot of temperature vs speed

Department of Electronics and Communication, BIT Page 34


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Chapter 6

APPLICATIONS

The project mainly focuses on the controlling of the excess temperature in the power

amplifier setup. Reducing the unwanted over temperature results in efficient working and

long life of the power amplifiers.

Some of the major places where the project finds its relevance and is of high importance

are listed below.

➢ Network Communication Server (NCS) – The NCS used in BEL uses a VHF or

UHF power amplifier. This power amplifier is capable of delivering 100W at the

output. This is associated with the release of enormous amount of heat and hence

in order to not have a hampered performance, the thermal state regulation module

is used.

➢ This can be used to drive a speaker of low input impedance efficiently as the

increase in temperature causes the intrusion of noise as a result of poor

performance of the power amplifier.

➢ This is also used in power amplifiers that drive high power antennas for long

range transmission.

➢ In the high-powered Radio Frequency (RF) linear power amplifier that enables

efficient, linear operation with multiple simultaneous signals across a wide

instantaneous bandwidth capable of operating in an active antenna array.

➢ Navy applications.

Department of Electronics and Communication, BIT Page 35


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Chapter 7

CONCLUSION AND FUTURE WORK


The project was completed and it succeeded in controlling the temperature within

the power amplifier resulting in maintaining the temperature in ambient range.

There are numerous approaches to this cause, yet here a brilliant technique for

interfacing a sensor with the starter kit ie microcontroller using the concept of I2C

was done. The module designed is mainly used of the power amplifiers in the NCS

which are installed in the naval systems as the amplifiers are exposed to a higher

temperature and are prone to work falsely if not taken care of.

The main goal of the system is to secure the amplifier from over-temperature so

that it can work without wear and tear that helps to enhance efficiency and

decrease irregularities.

Though the claim has been made that a module has been developed to protect the

power amplifiers, future enhancements are

➢ The Units / Hardware / Sensors have to be rugged.

➢ More advancement in software processing can be implemented to rule out

any false alarms.

➢ Artificial Intelligence can be used to increase the accuracy of alerts.

➢ More advanced processors can be used.

➢ The module can be collaborated with a wifi gateway and the display can

obtained and recorded using IOT.

Department of Electronics and Communication, BIT Page 36


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Chapter 8
REFERENCES
[1] Dr.Sudha Senthilkumar, Dr. K. Brindha, Prof.Rathi.R Siya Hardi

Sadhika Kataria,” TEMPERATURE CONTROLLED DC FAN”

[2] Surabhi ,Upendra Prasad , Vivek Kumar Jain “Design and Fabrication of Temperature

based DC Fan”

[3] Nigade, A. S,Deepanshu Verma, Brajesh Kumar Pandey and Pranjal Srivastav,”

TEMPERATURE BASED AUTOMATIC FAN SPEED CONTROLLER”.

[4] Shivesh, Rishabh Mishra, and Dr. E.Annie Elisabeth “SPEED CONTROL OF

CEILING FAN USING PWM TECHNIQUE”

[5] Power Amplifier Introduction and Types Available at

https://www.electronicshub.org/power-amplifier/

[6] Evaluation board ADT7470 datasheet Available at

https://www.analog.com/en/products/adt7470.html

[7] Temperature Sensor TC74 datasheet Available at

https://www.analog.com/en/products/adt7470.html

[8] PIC32MZ Starter kit datasheet Available at

https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/DM320010

Department of Electronics and Communication, BIT Page 37


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

CHAPTER 9
APPENDIX
The component layouts, component specification of the different components used,

brief introduction about the different software’s used in this project are explained in

this section.

9.1 HARDWARE SPECIFICATION

The various components used and their working have been briefly explained in the above

sections. The details of all these components are explained below.

1. PICMZ32 STARTER KIT

The PIC32MZ DA Starter Kit contains the following items:

• One PIC32MZ Embedded Graphics (DA) Starter Kit

• One LAN8740A Ethernet PHY Daughter Board

• One Type-A male to Micro-B USB cable (to communicate with the PIC32 DEBUG

port)

• One ETH cable

• Information sheet

Department of Electronics and Communication, BIT Page 38


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 9.1.1 PIC starter kit

There are four ways to supply power to the starter kit:

• Through USB Micro-B connector (J4) – This enables using a wall adapter to supply

more power than traditional USB as needed by the most applications.

• Through USB Micro-B DEBUG connector (J19). This connector supports

debugging/programming by MPLAB tools through PKOB® interface.

• Through USB Micro-USB connector (J6).

• An external application board with a regulated DC power supply that provides +5V

can be connected to the application board connector that is provided on the bottom

side of the board (J3).

Salient features:

Operating Conditions

•2.2V to 3.6V, -40ºC to +85ºC, DC to 200 MHz

•2.2V to 3.6V, -40ºC to +105ºC (Planned)

Department of Electronics and Communication, BIT Page 39


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Core: 200 MHz / 330 DMIPS MIPS32® microAptiv™

•32 KB I-Cache, 32 KB D-Cache

•MMU for optimum embedded OS execution

•microMIPS™ mode for up to 35% smaller code size

•DSP-enhanced core:

-Four 64-bit accumulators

-Single-cycle MAC, saturating and fractional math

•Code-efficient (C and Assembly) architecture

Communication Interfaces

•Two CAN modules (with dedicated DMA channels):

-2.0B Active with DeviceNet™ addressing support

•Six UART modules (25 Mbps):

-Supports up to LIN 2.1 and IrDA® protocols

•Six 4-wire SPI modules (up to 50 MHz)

•SQI configurable as additional SPI module (up to 80 MHz)

•Five I2C modules (up to 1 Mbaud) with SMBus support

•Parallel Master Port (PMP)

•Peripheral Pin Select (PPS) to enable function remap

Integrated Software Libraries and Tools

•C/C++ compiler with native DSP/fractional support

•MPLAB® Harmony Integrated Software Framework

•TCP/IP, USB, Graphics, and mTouch™ middleware

•MFi, Android™, and Bluetooth® audio frameworks

Department of Electronics and Communication, BIT Page 40


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

•RTOS Kernels: Express Logic ThreadX, FreeRTOS™, OPENRTOS®, Micriμm®

μC/OS™, and SEGGER embOS®

Figure 9.1.2 I2CXSTAT: I2C Status Register

• bit 31-16 Unimplemented: Read as ‘0’

• bit 15 ACKSTAT: Acknowledge Status bit (when operating as I2C master,

applicable to master transmit operation) 1 = NACK received from slave 0 = ACK

received from slave Hardware set or clear at end of slave Acknowledge.

• bit 14 TRSTAT: Transmit Status bit (when operating as I2C master, applicable

to master transmit operation) 1 = Master transmit is in progress (8 bits + ACK) 0

= Master transmit is not in progress Hardware set at beginning of master

transmission. Hardware clear at end of slave Acknowledge.

• bit 13 ACKTIM: Acknowledge Time Status bit (Valid in I2C Slave mode only)

1 = I2C bus is in an Acknowledge sequence, set on 8th falling edge of SCL clock

0 = Not an Acknowledge sequence, cleared on 9th rising edge of SCL clock

• bit 12-11 Unimplemented: Read as ‘0’

• bit 10 BCL: Master Bus Collision Detect bit 1 = A bus collision has been

detected during a master operation 0 = No collision Hardware set at detection of

bus collision.

Department of Electronics and Communication, BIT Page 41


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

• bit 9 GCSTAT: General Call Status bit 1 = General call address was received 0 =

General call address was not received Hardware set when address matches

general call address. Hardware clear at Stop detection.

• bit 8 ADD10: 10-bit Address Status bit 1 = 10-bit address was matched 0 = 10-

bit address was not matched Hardware set at match of 2nd byte of matched 10-bit

address. Hardware clear at Stop detection.

• bit 7 IWCOL: Write Collision Detect bit 1 = An attempt to write the I2CxTRN

register failed because the I2C module is busy 0 = No collision Hardware set at

occurrence of write to I2CxTRN while busy (cleared by software).

• bit 6 I2COV: Receive Overflow Flag bit 1 = A byte was received while the

I2CxRCV register is still holding the previous byte 0 = No overflow Hardware

set at attempt to transfer I2CxRSR to I2CxRCV (cleared by software).

• bit 5 D_A: Data/Address bit (when operating as I2C slave) 1 = Indicates that the

last byte received was data 0 = Indicates that the last byte received was device

address Hardware clear at device address match. Hardware set by reception of

slave byte.

• bit 4 P: Stop bit 1 = Indicates that a Stop bit has been detected last 0 = Stop bit

was not detected last Hardware set or clear when Start, Repeated Start or Stop

detected.

• bit 3 S: Start bit 1 = Indicates that a Start (or Repeated Start) bit has been

detected last 0 = Start bit was not detected last Hardware set or clear when Start,

Repeated Start or Stop detected.

• bit 2 R_W: Read/Write Information bit (when operating as I2C slave) 1 = Read –

indicates data transfer is output from slave 0 = Write – indicates data transfer is

input to slave Hardware set or clear after reception of I2C device address byte. bit

Department of Electronics and Communication, BIT Page 42


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

1 RBF: Receive Buffer Full Status

• bit 1 = Receive complete, I2CxRCV is full 0 = Receive not complete, I2CxRCV

is empty Hardware set when I2CxRCV is written with received byte. Hardware

clear when software reads I2CxRCV.

• bit 0 TBF: Transmit Buffer Full Status bit 1 = Transmit in progress, I2CxTRN is

full 0 = Transmit complete, I2CxTRN is empty Hardware set when software

writes I2CxTRN. Hardware clear at completion of data transmission.

Figure 9.1.3 I2CXCON: I2C Control Register

• bit 31-23 Unimplemented: Read as ‘0’

• bit 22 PCIE: Stop Condition Interrupt Enable bit (I2C Slave mode only) 1 =

Enable interrupt on detection of Stop condition 0 = Stop detection interrupts are

disabled

• bit 21 SCIE: Start Condition Interrupt Enable bit (I2C Slave mode only) 1 =

Enable interrupt on detection of Start or Restart conditions 0 = Start detection

interrupts are disabled

• bit 20 BOEN: Buffer Overwrite Enable bit (I2C Slave mode only) 1 = I2CxRCV

is updated and ACK is generated for a received address/data byte, ignoring the

Department of Electronics and Communication, BIT Page 43


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

state of the I2COV bit (I2CxSTAT<6>)only if the RBF bit (I2CxSTAT<2>) = 0 0

= I2CxRCV is only updated when the I2COV bit (I2CxSTAT<6>) is clear

• bit 19 SDAHT: SDA Hold Time Selection bit 1 = Minimum of 300 ns hold time

on SDA after the falling edge of SCL 0 = Minimum of 100 ns hold time on SDA

after the falling edge of SCL

• bit 18 SBCDE: Slave Mode Bus Collision Detect Enable bit (I2C Slave mode

only) 1 = Enable slave bus collision interrupts 0 = Slave bus collision interrupts

are disabled bit 18 AHEN: Address Hold Enable bit (Slave mode only) 1 =

Following the 8th falling edge of SCL for a matching received address byte;

SCKREL bit will be cleared and the SCL will be held low. 0 = Address holding is

disabled

• bit 16 DHEN: Data Hold Enable bit (I2C Slave mode only) 1 = Following the 8th

falling edge of SCL for a received data byte; slave hardware clears the SCKREL

bit and SCL is held low 0 = Data holding is disabled

• bit 15 ON: I2C Enable bit 1 = Enables the I2C module and configures the SDA

and SCL pins as serial port pins 0 = Disables the I2C module; all I2C pins are

controlled by PORT functions

• bit 14 Unimplemented: Read as ‘0’

• bit 13 SIDL: Stop in Idle Mode bit 1 = Discontinue module operation when device

enters Idle mode 0 = Continue module operation in Idle mode

• bit 12 SCLREL: SCLx Release Control bit (when operating as I2C slave) 1 =

Release SCLx clock 0 = Hold SCLx clock low (clock stretch) If STREN = 1: Bit

is R/W (i.e., software can write ‘0’ to initiate stretch and write ‘1’ to release

clock). Hardware clear at beginning of slave transmission. Hardware clear at end

of slave reception. If STREN = 0: Bit is R/S (i.e., software can only write ‘1’ to

Department of Electronics and Communication, BIT Page 44


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

release clock). Hardware clear at beginning of slave transmission.

• bit 11 STRICT: Strict I2C Reserved Address Rule Enable bit 1 = Strict reserved

addressing is enforced. Device does not respond to reserved address space or

generate addresses in reserved address space. 0 = Strict I2C Reserved Address

Rule not enabled

• bit 10 A10M: 10-bit Slave Address bit 1 = I2CxADD is a 10-bit slave address 0 =

I2CxADD is a 7-bit slave address

• bit 9 DISSLW: Disable Slew Rate Control bit 1 = Slew rate control disabled 0 =

Slew rate control enabled

• bit 8 SMEN: SMBus Input Levels bit 1 = Enable I/O pin thresholds compliant

with SMBus specification 0 = Disable SMBus input thresholds

• bit 7 GCEN: General Call Enable bit (when operating as I2C slave) 1 = Enable

interrupt when a general call address is received in the I2CxRSR (module is

enabled for reception) 0 = General call address disabled

• bit 6 STREN: SCLx Clock Stretch Enable bit (when operating as I2C slave) Used

in conjunction with SCLREL bit. 1 = Enable software or receive clock stretching

0 = Disable software or receive clock stretching

• bit 5 ACKDT: Acknowledge Data bit (when operating as I2C master, applicable

during master receive) Value that is transmitted when the software initiates an

Acknowledge sequence. 1 = Send NACK during Acknowledge 0 = Send ACK

during Acknowledge

• bit 4 ACKEN: Acknowledge Sequence Enable bit (when operating as I2C

master, applicable during master receive) 1 = Initiate Acknowledge sequence on

SDAx and SCLx pins and transmit ACKDT data bit. Hardware clear at end of

master Acknowledge sequence. 0 = Acknowledge sequence not in progress

Department of Electronics and Communication, BIT Page 45


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

• bit 3 RCEN: Receive Enable bit (when operating as I2C master) 1 = Enables

Receive mode for I2C. Hardware clear at end of eighth bit of master receive data

byte. 0 = Receive sequence not in progress

• bit 2 PEN: Stop Condition Enable bit (when operating as I2C master) 1 = Initiate

Stop condition on SDAx and SCLx pins. Hardware clear at end of master Stop

sequence. 0 = Stop condition not in progress

• bit 1 RSEN: Repeated Start Condition Enable bit (when operating as I2C master)

1 = Initiate Repeated Start condition on SDAx and SCLx pins. Hardware clear at

end of master Repeated Start sequence. 0 = Repeated Start condition not in

progress

• bit 0 SEN: Start Condition Enable bit (when operating as I2C master) 1 = Initiate

Start condition on SDAx and SCLx pins. Hardware clear at end of master Start

sequence. 0 = Start condition not in progress

2. ADT7470 evaluation kit

The ADT74701 controller is a multichannel temperature sensor and PWM fan

controller and fan speed monitor for systems requiring active cooling. It is designed to

interface directly to an I2C® bus. The ADT7470 can monitor up to 10 daisy-chained

TMP05 temperature sensors. It can also monitor and control the speed of four fans, in

automatic or in manual control loops.

A FULL_SPEED input is provided to allow the fans to be blasted to maximum speed,

via external hardware control, under extreme thermal conditions or on system startup.

An SMBALERT interrupt communicates error conditions such as fan under speed and

over temperature measurements to the system service processor. Individual error

conditions can then be read from status registers over the I2C bus.

Department of Electronics and Communication, BIT Page 46


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 9.1.4 Pin diagram of ADT7470

Pin No. Mnemonic Description

1 SCL Digital Input (Open Drain). SMBus serial clock input.

Requires SMBus pull-up, typically 2k2Ω.

2 GND Ground Pin.

3 VCC Power Supply Pin.

4 TACH3 Digital Input (Open Drain). Fan tachometer input to

measure

the speed of Fan 3.

5 PWM2 Digital I/O (Open Drain). Requires 10 kΩ typical

pull-up.

Pulse-width modulated output to control the speed of

Fan 2.

Can be configured as GPIO by setting Bit 0x7F[2] = 1.

6 TACH1 Digital Input (Open Drain). Fan tachometer input to

measure

Department of Electronics and Communication, BIT Page 47


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

the speed of Fan 1.

7 TACH2 Digital Input (Open Drain). Fan tachometer input to

measure

the speed of Fan 2.

8 PWM3 Digital I/O (Open Drain). Pulse-width modulated

output to

control the speed of Fan 3. Requires 10 kΩ typical

pull-up.

Can be configured as GPIO by setting Bit 0x7F[1] = 1.

9 TACH4 Digital Input (Open Drain). Fan tachometer input to

measure

the speed of Fan 4.

10 PWM4 Digital I/O (Open Drain). Pulse-width modulated

output to

control the speed of Fan 4. Requires 10 kΩ typical

pull-up.

Can be configured as GPIO by setting Bit 0x7F[0] = 1.

11 ADDR Three-state Input. Used to set the SMBus device

address.

12 TMP_IN Digital Input (Open Drain). PWM input to PWM

processing engine that interprets daisy-chained output

from multiple TMP05 temperature sensors. Readings

from individual TMP05 temperature sensors are

available by reading the temperature reading registers

over the SMBus.

Department of Electronics and Communication, BIT Page 48


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

13 FULL_SPEED Digital Input Active Low (Open Drain). This input

blasts the fans to maximum speed when the pin is

pulled low externally. Do not leave pin 13 open

when not I use, tie to VCC.

13 TMP_START Digital Output (Open Drain). This pin can be used

as an output to start daisy-chained temperature

measurements from TMP05 or TMP06 temperature

sensors. Requires 10 kΩ typical pull-up.

14 SMBALERT Digital Output Active Low (Open Drain). This pin

can be reconfigured as an SMBALERT interrupt

output to signal out-of-limit conditions such as fan

failures.

15 PWM1 Digital I/O (Open Drain). Pulse-width modulated

output to control the speed of Fan 1. Requires 10 kΩ

typical pull-up. Can be configured as GPIO by setting

Bit 0x7F[3] = 1.

16 SDA Digital I/O (Open Drain). SMBus bidirectional serial

data. Requires SMBus pull-up, typically 2k2Ω.

Table 9.1.1 Pin description of ADT7470

3. TC74

The TC74 is a serially accessible, digital temperature sensor particularly suited for low

cost and small form factor applications. Temperature data is converted from the onboard

thermal sensing element and made available as an 8-bit digital word.

Department of Electronics and Communication, BIT Page 49


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

Figure 9.1.5 Pin diagram of TC74

Pin description

Ground (GND) - Input. Ground return for all TC74 functions.

Power Supply Input (VDD) - Power supply input. See Electrical Specifications.

SMBus/I2C Serial Clock (SCLK) - Input. SMBus/I2C serial clock. Clocks data into and

out of the TC74.

Serial Data (SDA) - Bidirectional. Serial data is transferred on the SMBus/I2C in both

directions using this pin.

Actual Temperature Registered Temperature Binary Hex

+130.00°C +127°C 0111 1111

+127.00°C +127°C 0111 1111

+126.50°C +126°C 0111 1110

+25.25°C +25°C 0001 1001

+0.50°C 0°C 0000 0000

+0.25°C 0°C 0000 0000

Table 9.1.2 TEMPERATURE-TO-DIGITAL VALUE CONVERSION

Department of Electronics and Communication, BIT Page 50


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

4. SAN ACE 60

Figure 9.1.6 Cross section view of the fan

General Specification:
· Material - Frame: Plastic (Flammability: UL 94V-0), Impeller: Plastic

· Motor protection function - Locked rotor burnout protection, Reverse polarity


protection .

· Insulation resistance - 10 MΩ or more with a 500 VDC megger (between lead wire
conductors and frame)

· Sound pressure level (SPL) - At 1 m away from the air inlet

· Storage temperature - -30 to +70˚C (Non-condensing)

· Lead wire - Red Black Sensor Yellow Control Brown

· Mass - 130 g

Figure 9.1.7 Speed characteristics

Department of Electronics and Communication, BIT Page 51


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

9.2 SOFTWARE SPECIFICATION

MPLAB X IDE is a software program that is used to develop applications for Microchip

microcontrollers and digital signal controllers.

This development tool is called an Integrated Development Environment, or IDE, because

it provides a single integrated “environment” to develop code for embedded

microcontrollers.

The typical tasks for developing an embedded controller application are:

1. Create the high level design. From the features and performance desired, decide

which PIC MCU or dsPIC DSC device is best suited to the application, then design

the associated hardware circuitry. After determining which peripherals and pins

control the hardware, write the firmware – the software that will control the hardware

aspects of the embedded application. A language tool such as an assembler, which is

directly translatable into machine code, or a compiler that allows a more natural

language for creating programs, should be used to write and edit code. Assemblers

and compilers help make the code understandable, allowing function labels to

identify code routines with variables that have names associated with their use, and

with constructs that help organize the code in a maintainable structure.

2. Compile, assemble and link the software using the assembler and/or compiler and

linker to convert your code into “ones and zeros” – machine code for the PIC MCUs.

This machine code will eventually become the firmware (the code programmed into

the microcontroller).

3. Test your code. Usually a complex program does not work exactly the way imagined,

and “bugs” need to be removed from the design to get proper results. The debugger

allows you to see the “ones and zeros” execute, related to the source code you wrote,

Department of Electronics and Communication, BIT Page 52


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

with the symbols and function names from your program. Debugging allows you to

experiment with your code to see the value of variables at various points in the

program, and to do “what if” checks, changing variable values and stepping through

routines.

4. “Burn” the code into a microcontroller and verify that it executes correctly in the

finished application.

Optional components can be acquired or purchased to work with the MPLAB X IDE:

• Compiler Language Tools

MPLAB XC C compilers from Microchip provide fully integrated, optimized code for

PIC MCUs and dsPIC DSCs. Along with compilers from microEngineering Labs, CCS

and SDCC, they are invoked by the MPLAB X IDE project manager to compile code that

is automatically loaded into the target debugger for instant testing and verification.

• Programmers

MPLAB ICD 3 in-circuit debugger, MPLAB REAL ICE in-circuit emulator, and MPLAB

PM3 programmer are capable of the production programming of code into target devices.

PICkit 3 in-circuit debugger is capable of the development programming of code into

target devices.

All of these tools may be used with MPLAB X IDE to control programming of both code

and data, as well as the Configuration bits to set the various operating modes of the target

microcontrollers or digital signal controllers.

In addition, all of these tools may be used with MPLAB IPE to program code, data and

configuration bits. MPLAB IPE is designed more for production programming, and its

interface is simplified to do just that.

• In-Circuit Debuggers and Emulators

Department of Electronics and Communication, BIT Page 53


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

PICkit 3 and MPLAB ICD 3 in-circuit debuggers, and MPLAB REAL ICE in-circuit

emulator can be used to debug application code on target devices. By using some of the

on-chip resources, these can download code into a target microcontroller inserted in the

application, set breakpoints, single step and monitor registers and variables. The emulator

includes additional debug features, such as trace.

• Plugin Tools

Several plugins are available to add to the capabilities for MPLAB X IDE. For example,

the Data Monitor and Control Interface (DMCI) provides a mechanism to view and

control variables in code and change their values real-time. It also allows you to view

output data in a graphical format.

9.3 SOURCE CODE

#include <stdio.h>

#include <math.h>

#include <stdlib.h>

#include <xc.h>

#include <stdint.h> /* For uint32_t definition */

#include <stdbool.h> /* For true/false definition */

void set_fan_speed(unsigned short dutycycle)

float reg_C ;

I2C3CONbits.SIDL = 0;

Department of Electronics and Communication, BIT Page 54


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

I2C3CONbits.SCLREL = 1;

I2C3CONbits.A10M = 0;

I2C3CONbits.DISSLW = 1;

I2C3ADD = 0x5E; // slave device address

I2C3BRG = 0x091; // BRG value for 100KHz cycle, clock 30MHz

I2C3CONbits.ON = 1; // turn ON I2C3

while(I2C3CONbits.ON == 0);

I2C3CONbits.PEN = 0; // initiate a stop condition

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5E; // send address of slave device + write bit high

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3TRN = 0x34; //send address of Device ID register

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

reg_C = (float)(dutycycle)/(float)(0.39);

I2C3TRN = reg_C; // decimal value of dutycycle is divided by step size of 0.39

while(I2C3STATbits.TRSTAT == 1);

Department of Electronics and Communication, BIT Page 55


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.PEN = 1;

while(I2C3CONbits.PEN == 1);

return (EXIT_SUCCESS);

//for reading Tach3 low byte

//step1: writing to address pointer (in this case 0x2E)

unsigned short Read_fan_RPM(void)

unsigned int reg_A,reg_B;

unsigned short reg_c,tach_high,tach_low,tach_value,rev;

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5E; // send address of slave device + write bit high

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3TRN = 0x2E; // address of tach3 low byte

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

Department of Electronics and Communication, BIT Page 56


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

I2C3CONbits.PEN = 1;

while(I2C3CONbits.PEN == 1);

//step2:reading from address pointer (in this case 0x2E)

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5F; // send address of slave device + read bit high

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.RCEN = 0; // Receive enable

I2C3CONbits.SEN = 0;

I2C3CONbits.RSEN = 0;

I2C3CONbits.PEN = 0;

I2C3CONbits.ACKEN = 0;

I2C3CONbits.RCEN = 1;

while(I2C3CONbits.RCEN == 1);

I2C3CONbits.ACKDT = 1;

I2C3CONbits.ACKEN = 1;

while(I2C3CONbits.ACKEN == 1);

I2C3CONbits.PEN = 1;

Department of Electronics and Communication, BIT Page 57


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

while(I2C3CONbits.PEN == 1);

tach_low = I2C3RCV;

//for reading Tach3 high byte

//step1: writing to address pointer (in this case 0x2F)

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5E; // send address of slave device + write bit high

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3TRN = 0x2F; // address of tach3 low byte

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.PEN = 1;

while(I2C3CONbits.PEN == 1);

//step2:reading from address pointer (in this case 0x2F)

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x5F; // send address of slave device + read bit high

Department of Electronics and Communication, BIT Page 58


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.RCEN = 0; // Receive enable

I2C3CONbits.SEN = 0;

I2C3CONbits.RSEN = 0;

I2C3CONbits.PEN = 0;

I2C3CONbits.ACKEN = 0;

I2C3CONbits.RCEN = 1;

while(I2C3CONbits.RCEN == 1);

I2C3CONbits.ACKDT = 1;

I2C3CONbits.ACKEN = 1;

while(I2C3CONbits.ACKEN == 1);

I2C3CONbits.PEN = 1;

while(I2C3CONbits.PEN == 1);

tach_high = I2C3RCV;

reg_c = ((tach_high) << 8);

tach_value = (reg_c) | (tach_low);

rev = ((float)5400000)/((float)tach_value);

return(rev);

Department of Electronics and Communication, BIT Page 59


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

unsigned short Read_temperature(void)

unsigned int reg_d,reg_e;

short reg_f;

reg_e = I2C3STAT; // for reading I2C1 Status register

reg_d = I2C3CON; // for reading I2C1 control register

I2C3CONbits.SIDL = 0;

I2C3CONbits.SCLREL = 1;

I2C3CONbits.A10M = 0;

I2C3CONbits.DISSLW = 1;

I2C3ADD = 0x90; // slave device address

I2C3BRG = 0x091; // BRG value for 100KHz cycle, clock 30MHz

I2C3CONbits.ON = 1; // turn ON I2C3

while(I2C3CONbits.ON == 0);

I2C3CONbits.PEN = 0; // initiate a stop condition

I2C3CONbits.SEN = 1; // initiate a start condition

while(I2C3CONbits.SEN == 1);

I2C3TRN = 0x90; // send address of slave device + write bit high

Department of Electronics and Communication, BIT Page 60


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3TRN = 0x00; //send address of TEMP register

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.RCEN = 0; // Receive enable

I2C3CONbits.SEN = 0;

I2C3CONbits.RSEN = 0;

I2C3CONbits.PEN = 0;

I2C3CONbits.ACKEN = 0;

I2C3CONbits.RSEN = 1; // Repeated start

while(I2C3CONbits.RSEN == 1);

I2C3TRN = 0x91; //slave transmission & master reception+READ BIT HIGH

while(I2C3STATbits.TRSTAT == 1);

while(I2C3STATbits.ACKSTAT == 1);

I2C3CONbits.RCEN = 1;

while(I2C3CONbits.RCEN == 1);

I2C3CONbits.ACKDT = 1;

I2C3CONbits.ACKEN = 1;

Department of Electronics and Communication, BIT Page 61


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

while(I2C3CONbits.ACKEN == 1);

I2C3CONbits.PEN = 1;

while(I2C3CONbits.PEN == 1);

reg_f = I2C3RCV;

while(I2C3STATbits.RBF == 0);

return (reg_f);

unsigned char current_temp,prev_temp;

short diff_temp;

void temperature_loop (void)

high_temp_limit= 80;

current_temp = Read_temperature ( );

SYS_CONSOLE_PRINT(“PA Temperature = %d\n”, current_temp);

if(current_temp > high_temp_limit)

PORTGbits.RG7 = 1; // Glow indication

general_error_status |= 0x20;

SYS_CONSOLE_PRINT(“high temperature >90 degrees\n”);

Department of Electronics and Communication, BIT Page 62


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

diff_temp = current_temp – prev_temp;

if (diff_temp >2 || diff_temp <-2)//change the speed if there is variation of more than 2º

if ( current_temp > 45) // 100% duty cycle if temp is more than 45 deg

set_fan_speed(FAN1, 99);

set_fan_speed(FAN2, 99);

set_fan_speed(FAN3, 99);

else if ( current_temp > 40) // 70% duty cycle if temp is more than 40 deg

set_fan_speed(FAN1, 70);

set_fan_speed(FAN2, 70);

set_fan_speed(FAN3, 70);

else if (current_temp >35)

Department of Electronics and Communication, BIT Page 63


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

set_fan_speed(FAN1, 60);

set_fan_speed(FAN2, 60);

set_fan_speed(FAN3, 60);

else if (current_temp >30)

set_fan_speed(FAN1, 50);

set_fan_speed(FAN2, 50);

set_fan_speed(FAN3, 50);

else if (current_temp >25)

set_fan_speed(FAN1, 30);

set_fan_speed(FAN2, 30);

set_fan_speed(FAN3, 30);

else if (current_temp >20)

set_fan_speed(FAN1, 10);

Department of Electronics and Communication, BIT Page 64


Thermal state sensing and regulation module for 100W power amplifier 2019-2020

set_fan_speed(FAN2, 10);

set_fan_speed(FAN3, 10);

else

set_fan_speed(FAN1, 0);

set_fan_speed(FAN2, 0);

set_fan_speed(FAN3, 0);

prev_temp = current_temp;

SYS_CONSOLE_PRINT(“the speed is \n”, Read_fan_RPM()) ;

temperature_loop (void);

Department of Electronics and Communication, BIT Page 65

You might also like