need help with a project

Discussion in 'The Projects Forum' started by foxawy, Dec 10, 2011.

  1. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    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
     
  2. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    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?
     
  3. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    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
     
  4. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    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: Dec 10, 2011
  5. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    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.
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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!
     
  7. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    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.
     
  8. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    i am trying now to learn how to interact with the PIC's ADC to take the input from the sensor.
     
  9. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
  10. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    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.
     
  11. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
  12. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    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
     
  13. foxawy

    Thread Starter New Member

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

    Expert

    Jul 17, 2007
    22,182
    1,728
    You need to compile and link your .c programs in order to get the hex files.
     
  15. foxawy

    Thread Starter New Member

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

    AAC Fanatic!

    Jun 6, 2011
    2,692
    2,756
  17. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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:
     
  18. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    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
     
  19. foxawy

    Thread Starter New Member

    Dec 10, 2011
    14
    0
    the Lcd dosent initialize and keeps showing those blocks in the 2nd row
     
  20. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
Loading...