Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PLZ help me pic16f877a to showing temperature and turn on the fan if temp>27

Status
Not open for further replies.

erfan.khalilian69

Member level 4
Member level 4
Joined
Feb 7, 2011
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Kualalampur
Activity points
1,916
hi everyone PLZ help me to finish this project
Iam using pic16f877a and LM35 to show the temperture on LCD(16*2)
this project is almost finish I can show the temperture in LCD but I want to turn on the fan (LED as indicator) if temp goes above 27 degree
I wrote if else but it does not work i guess it because the program can't recognize the variable which is ADC value and is coming from sensor

plz help me
if you can help me tell me to upload the codes thanks


[/COLOR]plzzzzzzzzzzzz help the submission date is close ....
 
Last edited:

Hi,
there seems there's an error with this line in your "read_adc()" function.
The "while(ADGO==1);" statement is wrong, it shouldn''t end with anything - not even a semicolon.

only replace the whole of your "for" loop with this edition that has a corrected "while" statement.

for(i=2000;i>0;i-=1) //looping 2000 times for getting average value
{
ADGO = 1; //ADGO is the bit 2 of the ADCON0 register
while(ADGO==1) //ADC start, ADGO=0 after finish ADC progress
{
result=ADRESH;
result=result<<8; //shift to left for 8 bit
result=result|ADRESL; //10 bit result from ADC
result_temp+=result;
}
}

:-D
 
hi thanks for replaying
actually it does not relate to this
now the if else condition is working well for temperature
but for LDR i have still problem.
the problem is the value of light intensity is not right value which the LCD displays.
in addition I wrote if light is less than 30 turn on the lamp but actually while is less than 12 it activate the lamp. I know the problem is with LDR programing because temperature is working well
thank you for your help sir
 

everything is works well now thanks everyone
except the value of LDR which I thinks its related to value of the resistors which is connected to LDR (voltage divided rule )
do u have any idea how to control servo motors?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top