Jump to content
Electronics-Lab.com Community

Design real time temperature monitoring


Recommended Posts

Hello everyone

I am new here for the guidance from experts. Actually, I am making a project that will take input from heat sensor and pass to the PIC micro-controller. I am using TFT display MLT028Q40-5 with controller through driver and this is working perfectly. I need help with the data to import from temperature sensor NTC. can any expert help me to solve the problem. I can provide more details if required. 

Looking forward for valuable Answers. Thank you so much.  

Continued to the previous question. can you please also help me to find best way of PCB design? Thank you again. 

Link to comment
Share on other sites


I do not know the PIC micro-controller so I can not help you directly. But there are videos on youtube that  maybe helpful. for example:

https://www.youtube.com/watch?v=yreD5sj-i80

Also for the basic calculations see:

https://www.instructables.com/id/NTC-Temperature-Sensor-With-Arduino/

Good luck with your project.

 

Link to comment
Share on other sites

  • 4 months later...
On 4/13/2020 at 3:11 PM, electrical211 said:

Hello everyone

I am new here for the guidance from experts. Actually, I am making a project that will take input from heat sensor and pass to the PIC micro-controller. I am using TFT display MLT028Q40-5 with controller through driver and this is working perfectly. I need help with the data to import from temperature sensor NTC. can any expert help me to solve the problem. I can provide more details if required. 

Looking forward for valuable Answers. Thank you so much.  

Continued to the previous question. can you please also help me to find best way of PCB design? Thank you again. 

ADC_GetConversion(adc_channel_t channel): This routine is used to select desired channel for conversion and to get the analog to digital converted value.

 

CODE:

----------------------------------------------------

 

#include "mcc_generated_files/mcc.h"
#include "lcd.h"
#include "stdio.h"

/*
                         Main application
 */

// This function creates seconds delay. 
// The argument specifies the delay time in seconds
void Delay_Seconds(unsigned char z)
{
    unsigned char x,y;
    for (y = 0; y < z; y++)
    {
        for (x = 0; x < 100; x++)__delay_ms(10);
    }
}

//**************Declare Global Variables**************************************
uint16_t convertedValue = 0;
float  voltage ;
char Buffer[20];


void main(void)
{
    // Initialize the device
    SYSTEM_Initialize();
    // initialize the LCD
    LCD_Initialize();

      
     LCDPutCmd(LCD_CURSOR_OFF);  //LCD Cursor off
     LCDPutStr("ADC with MCC");  //Display String "ADC with MCC"
     LCDGoto(0,1);               //Go to second line
     LCDPutStr("Turn POT on AN0");  //Display String "Turn Potentiometer on AN0"
     Delay_Seconds(2);    // 2 seconds delay
     DisplayClr();        // Clear the display
     
          
    while (1)
    {
        convertedValue = 0;
     
      ADC_StartConversion(channel_AN0);
      while(!ADC_IsConversionDone());
        convertedValue = ADC_GetConversionResult(); 
       
       voltage = (convertedValue * 5.0)/1023; // convert ADC count into voltage
       LCDPutStr("Voltage = "); //Display "Voltage" on the screen
       sprintf(Buffer, " %.3g", voltage ); // Convert voltage to string, rounded to 3 decimal points number
       LCDPutStr(Buffer); //Display the Voltage on the screen
       LCDPutStr("     "); // Clear after comma 
       LCDGoto(0,0);               //Go to first line
     
     }
}
/**
 End of File
*/

 

--------------------------------------------------

Comment:

Instead of 

voltage = (convertedValue * 5.0)/1023; 

you can add your conversion equation of NTC sensor.

such as

temperature=B/(ln(convertedValue/r¤))

Here the convertedValue is the measured resistance of NTC.

B is the Beta value - need to be calculated.

ln is the natural logarithm.

r¤ is the reference resistance at a certain K temperature.

ADC-with-MCC.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...