![]() We use the formula temp = (temp*5.0*100.0/1024.0) to calculate the temperature.And we set the initial speed of the fan as ZERO.First we define the minimum temperature required to start the fan and maximum temperature of the fan.The power pin of the temperature sensor is connected to the 5 V of the Arduino and Vout pin is connected to A0 of the Arduino and ground pin is connected to ground.įloat temp int tempPin = A0 //Arduino pin used for temperature sensor int tempMin = 25 //temparature to start fan int tempMax = 70 int fan = 6 //the pin where fan is connected int fanSpeed = 0 void setup() CODE EXPLANATION:.The temperature sensor consists of 3 terminals Power,Vout,Ground. ![]() Connect the Terminal 2 of the DC motor to a digital pin 6 of the Arduino and Terminal 1 to the ground.A temperature sensor is an electronic device that measures the temperature of its environment and converts the input data into electronic data to record, monitor, or signal temperature changes.
0 Comments
Leave a Reply. |