I want to develop a 8051 based PID temeperature controller.i will be using IC temperture sensor LM35DZ .
Please send me the code in C for the same on my mail id ritula.thakur@gmail.com.
Writing code in C is not my cup of tea.Im gud in developing hardware but when softwware comes i get panicky.so please please help me. I any one has the full code please mail it to me as soon as possible. i shall e highly obliged
Thanks in advance
To be moore precise abt my project. The temp sensor LM35DZ will be sensing the actual temperature of process and this temp will be converted into digital form by ADC 0809 and sent to microcontroller.The user can set the desired temp through keyboard.There is also LCD interfacing which will display the actual tempertaure and set temp.Th eprogram in C will containg PID algorithm to operate a relay which is connected to heater and thus accordingly turn it ON and OFF.
/*u=kp*(e+Td*diff(e)+Td*int(e))
y0=analog input 1;
r0=ref=set point or reference;
T=sample time;
qd=diff constant=Kp*Td/T; //Td:diff time
qi=integral cosntant=Kp*T/Ti; //Ti:Integration time
Kp=prop gain;*/
float pid (float r0, float y0)
{
e0=r0-y0;
D=qd*(e0-e1);
if (((u>umin)|(e>0))&((u<umax)|(e<0))) //antiwindup integral
I=I+qi*(r0-y0);
u=Kp*e0+D+I;//pid control signal
if (u>umax) u=umax; //antiwindup PID
if (u<umin) u=umin;