need help with a project

Thread Starter

foxawy

Joined Dec 10, 2011
14
Hi, i need some help, the project is to take i/p from an lm35 temperature sensor and display it on LCD with a pic16f877a and use it to control a fan, the project also includes a humidity sensor but since i cant find anyone around so i will neglect that part. thx
 

tracecom

Joined Apr 16, 2010
3,944
Hi, i need some help, the project is to take i/p from an lm35 temperature sensor and display it on LCD with a pic16f877a and use it to control a fan, the project also includes a humidity sensor but since i cant find anyone around so i will neglect that part. thx
You need the LM35 and the PIC correctly connected to power. You need the output from the LM35 correctly connected to an ADC input on the PIC. You need some code in the PIC to read the digital conversion and format it for display on the LCD. You need a serial converter to take the output from the PIC and convert it to display on the LCD. You need a way (hardware or software) to tell the PIC at what temperature you want the fan to turn on and turn off. You need a switch (relay or solid state) and the interface to the PIC to operate the fan. And you need the code in the PIC to operate the switch.

As you can see, it's a fairly complex project. What have you done so far?
 

Thread Starter

foxawy

Joined Dec 10, 2011
14
First, THX for the guidelines i will be making them my work plan.
I am just starting and the project was supposed to be in group of five,but i am working alone so far, anyway the hardware and the connection part is not the prob the code is,and i didn't understand the part about the serial converter between the PIC and the LCD.thx
 

tracecom

Joined Apr 16, 2010
3,944
i didn't understand the part about the serial converter between the PIC and the LCD.thx
Most LCD displays are set up for parallel input (HD44780 format), but unless your microcontroller has lots of available outputs, you will have to send serial data to the display. Therefore, you will need a serial to parallel converter to interface the PIC with the display.

ETA: OK, I see that the PIC you plan to use is a 40 pin chip, so you probably will have enough outputs to send parallel data to the display, and if that is the case, you won't need a serial to parallel converter.

I take it this is a school project and you are supposed to be a member of a five person team. Correct?

Are you constrained to use a PIC, or are other μC's allowed?
 
Last edited:

Thread Starter

foxawy

Joined Dec 10, 2011
14
yeah i have enough o/p pin to use parallel , i am electronics engineering major but this is my first time to use PIC and uC's up until now all my work was analog electronics. and i am sorry but i think that i have to use the PIC16f877a , i thought about using arduino but its not available, thx a lot for the help. i have another tutorial today so i will ask for more details.thx again.
 

thatoneguy

Joined Feb 19, 2009
6,359
What language are you using? C? If so, Mikro C or Boost C?

Or Hi-Tech/Microchip C?

It's pretty straightforward if you have a copy of the datasheet and I have some sample code to post just for that from the KICDEM2 board, which had the 16F877A, LCD. The code should be plug and play if you put the parts on the same pins. That, or simply search for PICDEM2 Plus demo code

Hope that helps!
 

Thread Starter

foxawy

Joined Dec 10, 2011
14
i am using mikro c , i thought about using mplab to simulate but i don't have any knowledge of it and don't have time to learn, i will search and try to use the picdem2 , and i am very thankful for any help.
 

thatoneguy

Joined Feb 19, 2009
6,359
There are a few threads currently active on here about reading ADC with PIC, one is for LCD, the other is for a solar tracker, take a peek at them, they could be of help a well.

If you get stuck post again and we'll get you going, but we'll need a copy of your source code to work with.
 

Thread Starter

foxawy

Joined Dec 10, 2011
14
that is exactly what i am doing now , but i have a question would i need to amplify the signal coming from the lm35 sensor or not.
 

thatoneguy

Joined Feb 19, 2009
6,359
No, the sensor puts out a voltage between 0 and 5V

If the range is too small, you can change the +Vref and -Vref of the ADC to expand the small range.
 

Thread Starter

foxawy

Joined Dec 10, 2011
14
sorry ,its been a few crazy days i got two more projects something to do with xbee modules and the other is an IC for RF system ,anyway i am now trying to test a code part , i am writing on mikroc and using IDE pic simulator , the problem is that the simulator only takes HEX files and the fiels are .c
 

Thread Starter

foxawy

Joined Dec 10, 2011
14
i am almost finished with the project but i still need help to use the IDE pic simulator, and displaying on the lcd.
 

Thread Starter

foxawy

Joined Dec 10, 2011
14
i finished and the simulator displays the data on the LCD . but in real life the lcd lights up and nothing happens.
 

thatoneguy

Joined Feb 19, 2009
6,359
i finished and the simulator displays the data on the LCD . but in real life the lcd lights up and nothing happens.
Make sure you have delays between commands and when switching between command mode and text mode on the LCD.

There are timing diagrams all over the net for the Hitachi chipset. I've forgotten them right now. :eek:
 

Thread Starter

foxawy

Joined Dec 10, 2011
14
please help the deadline is in 1 hour , the command LCD_inti() doesnt work for us although the whole program is working on the simulator and the LCD works fine on the IDE simulator
 

thatoneguy

Joined Feb 19, 2009
6,359
Can you post your LED relevant code?

Are you leaving a long enough delay between power on to sending commands? Some are sensitive in that regard as well.
 
Top