Jabara16
New Member
Hi, im a newbie in programming and im actually doing in my project but it seems i cant understand it as i browse in google i find about this forum and it fascinated me because theres a lot of people really willing to help others in programming.
I want to make a PWM temperature controlled fan using PIC12F675 and LM35 as my sensor, moreover, I need to use microC using C langauge. please help me
Equipment and Specs:
Temp Sensor: LM35 (Precission Centrigrade Temperature Sensor)
Output voltage = 0mv + 10.0mv/ Degree Celsius
Microcontroller: PIC12675
Output voltage = 0.004882812v/increment
A/D Converter 10 bits = 1023
Conditions:
When the temperature rises the PWM(duty cycle) of the fan will rise proportional to the temperature
When it is operating in the 30-49 degrees Celsius the green LED turns on but if the temperature exceeded at 49 degrees and above the PWM must be zero and the red LED must turn on
PWM Conditions
Temperature (Degree Celsius) PWM (duty cycle)
Less than or equal to 34 30%
35-37 35%
38 40%
39 50%
40 60%
41 70%
42 80%
43-46 90%
47-49 100%
Greater than or equal to 50 shutdown
Computations:
Let A = 10mV B=0.004882812 C= 49/100
Sample calculations
@35degrees
Output LM35 = 35*A = 0.35
A/D Converter output of PIC = 0.35/B = 71.68bits = 71bits (the PIC12F675 can only read whole numbers)
Temperature Reading of PIC
71*C = 34.79 degrees celcius is almost equivalent to 35degrees
@36degrees
Output LM3 = 36/10mV = 0.36
A/D Converter output of PIC = 0.36/B = 73.728 = 73
Temperature Reading of PIC
73*C = 36.12672
@40degrees
Output LM3 = 40*A = 0.4
A/D Converter output of PIC = 0.4/B = 81.92
Temperature Reading of PIC
81*C = 39.69degrees
@41
Output LM3 = 41*A = 0.41
A/D Converter output of PIC = 0.41/B = 83.968
Temperature Reading of PIC
83*C = 40.67degrees
@42
Output LM3 = 42*A = 0.42
A/D Converter output of PIC = 0.42/B = 86.016
Temperature Reading of PIC
86*C = 42.14
@43
Output LM3 = 43*A = 0.43
A/D Converter output of PIC = 0.43/B = 88.064
Temperature Reading of PIC
88*C = 43.12
@44
Output LM3 = 44*A = 0.44
A/D Converter output of PIC = 0.44/B = 90.112
Temperature Reading of PIC
90*C = 44.1
@45
Output LM3 = 45*A = 0.45
A/D Converter output of PIC = 0.45/B = 92.16
Temperature Reading of PIC
86*C = 45.06
I want to make a PWM temperature controlled fan using PIC12F675 and LM35 as my sensor, moreover, I need to use microC using C langauge. please help me
Equipment and Specs:
Temp Sensor: LM35 (Precission Centrigrade Temperature Sensor)
Output voltage = 0mv + 10.0mv/ Degree Celsius
Microcontroller: PIC12675
Output voltage = 0.004882812v/increment
A/D Converter 10 bits = 1023
Conditions:
When the temperature rises the PWM(duty cycle) of the fan will rise proportional to the temperature
When it is operating in the 30-49 degrees Celsius the green LED turns on but if the temperature exceeded at 49 degrees and above the PWM must be zero and the red LED must turn on
PWM Conditions
Temperature (Degree Celsius) PWM (duty cycle)
Less than or equal to 34 30%
35-37 35%
38 40%
39 50%
40 60%
41 70%
42 80%
43-46 90%
47-49 100%
Greater than or equal to 50 shutdown
Computations:
Let A = 10mV B=0.004882812 C= 49/100
Sample calculations
@35degrees
Output LM35 = 35*A = 0.35
A/D Converter output of PIC = 0.35/B = 71.68bits = 71bits (the PIC12F675 can only read whole numbers)
Temperature Reading of PIC
71*C = 34.79 degrees celcius is almost equivalent to 35degrees
@36degrees
Output LM3 = 36/10mV = 0.36
A/D Converter output of PIC = 0.36/B = 73.728 = 73
Temperature Reading of PIC
73*C = 36.12672
@40degrees
Output LM3 = 40*A = 0.4
A/D Converter output of PIC = 0.4/B = 81.92
Temperature Reading of PIC
81*C = 39.69degrees
@41
Output LM3 = 41*A = 0.41
A/D Converter output of PIC = 0.41/B = 83.968
Temperature Reading of PIC
83*C = 40.67degrees
@42
Output LM3 = 42*A = 0.42
A/D Converter output of PIC = 0.42/B = 86.016
Temperature Reading of PIC
86*C = 42.14
@43
Output LM3 = 43*A = 0.43
A/D Converter output of PIC = 0.43/B = 88.064
Temperature Reading of PIC
88*C = 43.12
@44
Output LM3 = 44*A = 0.44
A/D Converter output of PIC = 0.44/B = 90.112
Temperature Reading of PIC
90*C = 44.1
@45
Output LM3 = 45*A = 0.45
A/D Converter output of PIC = 0.45/B = 92.16
Temperature Reading of PIC
86*C = 45.06