Intro: Thermistor - Fan Speed Control Using LabVIEW and MyRIO
The basic idea for this project was to feed thermistor voltage values into the myRIO and control fan speed based on these values.
This project requires LabVIEW and the additional required software to run the myRIO. The student version of myRIO comes with all the software that you need to complete this project. A free trial of LabVIEW and the required software can be found here:
Step 1: Materials
1) TDC03C310 thermistor (10kΩ at 25°C)
The thermistor, transistor, and resistor as well as many other useful parts are included in the Analog Parts Kit from Digilent
2) 10kΩ resistor
3) 2N3904 Transistor
4) 12V external power supply
5) Standard computer fan
6) NI myRIO and LabVIEW
The student version of the myRIO includes the required LabVIEW, LabVIEW FPGA, and LabVIEW Real-Time software.
A breadboard that directly interfaces with the myRIO is sold by Digilent here:
Step 2: Setup
First, arrange the thermistor in series with a 10kΩ resistor and supply it with 5V. Feed the voltage across the thermistor to the MSP connector C - AI0 channel located on the right side of the myRIO.
Connect MSP connector C - DIO3 (located on the right side of the myRIO) to the base lead of the transistor (this line is capable of pulse wave modulation). This channel will supply pulse waves to the transistor to switch the 12V connection to ground on and off. Next, connect the 12V external supply to the power wire of the fan and connect the ground wire of the fan to the collector lead of the transistor (refer to the pictures above to make sure the correct connections to the fan and transistor are made). Now connect the emitter lead of the transistor to ground. The transistor will now switch the circuit open and closed depending on the digital signal sent.
Step 3: LabVIEW Code
Three different fan speeds were chosen based on the thermistor voltage ranges. The fan was off with thermistor voltages greater than 2.35V. Thermistor voltage between 2.35V and 2.15V created a PWM with a frequency of 100 and a duty cycle of 0.1 (10%). Thermistor voltage between 2.15V and 1.95V created a PWM with a frequency of 100 and a duty cycle of 0.5 (50%). Thermistor voltage under 1.95V resulted in a constant 12V supply to the fan. If you open the block diagram picture, the empty boxes on the right side contain comments that appear when you hover over them.
For the equations pictured above, Vt = voltage across thermistor, R = thermistor resistance, T = thermistor temperature in Celsius, and T1 = thermistor temperature in Fahrenheit. Vt is found using a voltage divider equation and R is found by rearranging this equation. Using R, the temperature can then be calculated. Note - in the Celsius calculation, temperature is calculated in Kelvin and then 273.15 is subtracted to give the correct reading. Also, the 4000 value used is the beta value of the thermistor found in the data sheet. These equations are used in the formula block in the block diagram.
From here, download the VI. Once downloaded, open LabVIEW and start a myRIO project. Open the downloaded VI and run. You're done! Feel free to change voltage range values or use temperature readings to control fan speed instead of voltage. Let me know if you have any questions or if you have changes you would make.