Page 1 of 1
Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 1:10 am
by electron67
Hello to everyone, something is wrong; I am use the LM61 (-30 TO 100 GRADE CENTIGRADE)
600mV offset, 10 mV/ºC, +300 mV to 1600 mV; -30ºC to +100ºC.
I want conver to ºF , but is wrong, EJEM. 30ºC is: ºC(9) / 5 + 32 = ºF = 86ºF
I use 4 display 7 seg. The data give to me is 150ºF
Someone can help me ?
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 7:37 am
by JohnCrow
Hi
The formula you have is correct
F = C * (9/5) +32
At work so not able to look at flowcode
but the markets might make a difference
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 2:13 pm
by electron67
The data in ºC is correct, but in ºF not, maybe I have wrong the file ?
I think that can use the LM35 too
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 3:19 pm
by medelec35
Hi electron67,
I was going to look a to your flowchart tonight after work, and sort it out for you so it correctly shows fahrenheit.
electron67 wrote:
I think that can use the LM35 too
For creating a very simple flowchart to read temperature, take a look at this:
http://www.matrixmultimedia.com/mmforum ... 445#p49124
( in fact it's worth looking at the whole thread as its interesting reading!)
The sensor increases or decreases 1 byte per degC
When I convert from C to F, I just use F = C * 1.8 + 32
I know the 1.8 is just same as 9/5 (standard people use).
But I thought why use a calculation when a simple constant will do?
Martin
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 3:22 pm
by Mantas
Hi,
try changing it to:
Code: Select all
ADC_Value1 = ADC_Value1 * 9.0
ADC_Value1 = ADC_Value1 / 5.0
ADC_Value1 = ADC_Value1 + 32.0
Best regards,
Mantas
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 6:21 pm
by electron67
Hi Mantas
I change 9.0, 5.0 and 32.0; but to 27ºC display indicate 144ºF
Hi Martin
Maybe not is the same display the temperature in the LCD and 7 seg display 4 digit, the program change ? Is correct my file flowcode ?
Thanks
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 7:53 pm
by medelec35
Hi electron67
The problem with your Flowchart is MOD can't be used with floats.
So I have added Float to int conversion and reduced and simplified your calculations.
Note: All your calculations are correct
With your Flowchart:
If you ReadAsVoltage (using Float). e.g ADC_Value = float2int (ADC_Value1)
do all calculations using floats as you already have done.
Then convert Float to Int.
Change all your Digits e.g from DIGIT4 = ADC_Value1 / 1000 to
DIGIT4 = ADC_Value/ 1000
Then your flowchart should work on hardware.
I have done that with GradosC_Fv1.34f887 with Float to Int.fcf
Martin
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 8:10 pm
by electron67
Hi Martin, thank you one more time .....
Now reading the temperature in ºF correctly.
Electron67
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 8:11 pm
by medelec35
Your welcome.
Glad its working for you.
Thanks for updating us.
I have just added some extra text you may not have seen as you was online while I was editing my post.
Re: Grades Centigrade to Farenheit
Posted: Tue Jun 18, 2013 8:23 pm
by electron67
I see more clear and understand.
THANKS
Re: Grades Centigrade to Farenheit
Posted: Thu Jun 20, 2013 7:19 am
by medelec35
No problem.
So long as information has helped you.
Did the help button on the component macro help you more to learn about the functions available?
Re: Grades Centigrade to Farenheit
Posted: Thu Jun 20, 2013 3:55 pm
by electron67
The button help is good but not is clear when the function should be used (when using an example in flowchart of the function is more understandable). I think that an example together with button help in functions complex (not all) is ideal.
But the help that you give in the forum is essential for learning.... Thank you.
Electron67