# Temperature Dependent Fan

This tutorial describes how we can make temperature dependent fan using evive and LM35
Tutorial Info
Estimated Time (hrs):
3

## Introduction:

Temperature is a significant part of our daily life. Too high Temperature and too Low temperature are not comfortable for human as well as electronics around us.

This can be controlled by having an airflow around our system. Airflow can cool down our system and also stable our temperature.

For temperature sensing, we use LM35 which is a low-cost and precise sensor with easy operations.

Detailed Temperature sensing can be found here

For proper operation, we have to average some samples of temperature so in this tutorial we are using 100 samples.

Connection:

Note: Here DC source is required as Motor is DC and it should not exceed 9V

## Procedure:

• Place LM35 on evive’s mini breadboard
• Join Vcc and ground.
• Attach Out with A0
• Connect Relay with Motor, Battery and evive.
• Start coding.

## Coding Algorithm:

• Set pin as Input and output
• initialize sampling array and threshold
• Threshold is temperature in Degree Celcius
• Start averaging function as at 0
• Averaging loop add samples at very fast rate
• After adding divide it to the total number of samples.
• The total temperature will be 0.48* temp ( HOW? )
• CheckThreshold and turn ON of OFF fan

## Why 0.48 only?

As total Resolution of 0 – 5V is from 0 to 1023 we can have 4.88 mV ( 5/1023 V)

Now LM35 shows 10mV increase per degree Celsius so one reading of value ( 0 – 1023) shows 0.488 degree Celsius ( 4.88 / 10 degree Celsius)

Therefore total Temperature is 0.48 * Value.

This Helped
This didn't help
Related Tutorials
Featured Projects

### DIY Soccer Playing Mobile Robot

IntroductionPlaying soccer is fun, but playing soccer with robots is awesome.  In this project, we are

Make this Project

### DIY RGB LED Goggles

IntroductionIt’s a calm Sunday afternoon and you’re wandering by the road lost in thought of what

Make this Project

### Drip Irrigation System

Introduction Drip irrigation system is a type of micro-irrigation of soil which has the potential to save water

Make this Project
×