PR11 - Convert from analog voltage to Celsius

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

PR11 - Convert from analog voltage to Celsius

Postby PHKan » Thu Sep 20, 2012 5:17 pm

Based on ADC, how to calculate or how to convert from analog voltage to Celsius (digital values) which displayed on the LCD screen? Can you show or any an block diagram of ADC with PIC16F876A?

regards,
Kan
PHKan
Freshie
 
Posts: 4
Joined: Sun Jul 08, 2012 1:36 pm

Re: PR11 - Convert from analog voltage to Celsius

Postby sich » Fri Sep 21, 2012 4:05 pm

I think this is exactly what you need. Getting Started with SK40C: Project 5
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: PR11 - Convert from analog voltage to Celsius

Postby PHKan » Fri Sep 21, 2012 10:23 pm

Thank you for given the project 5 of PIC16F877. As according to PR11 project, can you let me know , which part of code for ADC converting from analog voltage to digital voltage?
I'm try to know further about this calculation of ADC converting.

regards,
Kan
PHKan
Freshie
 
Posts: 4
Joined: Sun Jul 08, 2012 1:36 pm

Re: PR11 - Convert from analog voltage to Celsius

Postby yonghui » Sat Sep 22, 2012 1:53 pm

analog channel which ADC reads, ADC will sample n digitize the analog value, dont worry the code to convert analog value to digital, just read the ADC buffer value, it is digital.
u can use the value get from the adc read function.
after u get the value which adc read, then u can refer the datasheet of the temperature sensor, what is the relation between the voltage reading the temperature. for LM35 it will be linear relation, so just divide or multiply some constant value u get from the datasheet u will get the temperature in celcius.
then display the value to LCD. u will need to convert the value into BCD and to the ascii code. mayb u can directly use some LCD function there.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: PR11 - Convert from analog voltage to Celsius

Postby putu » Tue Jan 14, 2014 11:51 am

yonghui wrote:analog channel which ADC reads, ADC will sample n digitize the analog value, dont worry the code to convert analog value to digital, just read the ADC buffer value, it is digital.
u can use the value get from the adc read function.
after u get the value which adc read, then u can refer the datasheet of the temperature sensor, what is the relation between the voltage reading the temperature. for LM35 it will be linear relation, so just divide or multiply some constant value u get from the datasheet u will get the temperature in celcius.
then display the value to LCD. u will need to convert the value into BCD and to the ascii code. mayb u can directly use some LCD function there.


Can you please let me know how I can see the temperature reading/ADC value of the sensors using the MPlab IDE software? I want to see in real time that these value change as the temperature increase or decrease. For debugging / troubleshooting purposes. Thanks!
putu
Freshie
 
Posts: 4
Joined: Tue Jan 14, 2014 10:27 am

Re: PR11 - Convert from analog voltage to Celsius

Postby ober » Wed Jan 15, 2014 3:29 pm

putu wrote:Can you please let me know how I can see the temperature reading/ADC value of the sensors using the MPlab IDE software? I want to see in real time that these value change as the temperature increase or decrease. For debugging / troubleshooting purposes. Thanks!

There are a few methods:
- You can use a debugger to check the value of ADRESH/L register. This method can be done with MPLAB IDE + Debugger (PICkit2, PICkit3, ICD2, or ICD3, UIC00B is compatible with PICkit2). Anyway, you will need to check the User's Manual of specify tools to perform debug.
- You can develop UART function and send the register (ADRES) to computer and display it with any available terminal program such as HyperTerminal, RealTerm, PuTty, etc.
- Yan can add LCD and use some available LCD function to display the value on LCD.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1409
Joined: Wed Apr 15, 2009 1:03 pm

Re: PR11 - Convert from analog voltage to Celsius

Postby putu » Wed Jan 15, 2014 10:32 pm

Hi, For PR11, can i change the existing 2x16 LCD to a bigger LCD like a 4 liner? If so, what should be changed in the program code?
putu
Freshie
 
Posts: 4
Joined: Tue Jan 14, 2014 10:27 am

Re: PR11 - Convert from analog voltage to Celsius

Postby ober » Thu Jan 16, 2014 11:13 am

Yes, you can! Just in case, do check whether the pins are compatible with common use 2x16 parallel LCD. As for library, I guess you need to modify the function to move cursor to 2nd line, 3rd line and also 4th line. The rest should be the same. Try and see.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1409
Joined: Wed Apr 15, 2009 1:03 pm


Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 14 guests

cron