electrical211 Posted April 13, 2020 Report Share Posted April 13, 2020 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. Quote Link to comment Share on other sites More sharing options...
HarryA Posted April 14, 2020 Report Share Posted April 14, 2020 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. Quote Link to comment Share on other sites More sharing options...
G_i_o Posted August 23, 2020 Report Share Posted August 23, 2020 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.