1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Pull My Hair out, Optical Tachometer - PIC16F628A

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by DustinB, Mar 22, 2010.

  1. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Well since this is my first post I guess I should do a short background. I'm just getting started in electronics and I think I may have found a new hobby. I decided to get into this with a project I saw online, an optical tachometer to get the headspeed of an rc helicopter. The creator did all the code in picbasic and it's all functioning properly. I will be doing future programming in C as I have a background in C++ and C-like scripting.

    The problem I'm having with this project is the circuit. In the instructions it has a couple different circuits separated. I wanted to make this all on one board, but it isn't functioning properly.

    Here is the project: Homemade Optical Tachometer

    When I follow the instructions and lay it all out on the breadboard it all functions perfectly, however when I tried it on a pcb with the attached schematic I did it does not function properly.

    The motor circuit functions as well as the IRLED and sensor. The problem is the LCD screen has one row of solid black squares and does not output anything other than that. I heard this is the "ready mode" of the LCD. So, somehow the LCD is not receiving data to display I guess. I compared the layout with the instructions on the site and all the connections seem right. Does anyone see anything that could cause this behavior? This thing is driving me crazy. I've been going over this time and time again for a week.

    Thanks for any ideas, things to check, etc...

    BTW, the LED, SEN, PWR are all 2 pin headers.
     

    Attached Files:

    Last edited: Mar 22, 2010
  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Have checked the pcb layout for the LCD, the track looks OK.

    Can you post a pic of your wiring from the pcb to the LCD

    The black blocks on the LCD display suggest its not being initialised.
     
    Last edited: Mar 22, 2010
  3. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE

    hi,
    I know the pin outs of the LCD pcb..:)

    I would like to check the wires are going from the main pcb to the LCD pins where you think they are going.

    You say that the remainder of the main pcb functions actually work.??

    Do you have access to a scope.?
     
  6. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Well that's what I meant. The numbers to the right of the lcd pins on the main pcb are where the wires are going to on the LCD pcb.

    Yes, everything else functions correctly. I do not have access to a scope. I did see a way to make a free one connecting to a sound card. I guess I could try and get one going if needed, wouldn't know where to begin using a scope though.

    I appreciate you looking at this. I've been reading a lot and trying everything I could think of, yet it still isn't working. If I setup the PIC layout in the project page on the breadboard with the LCD it works fine. When I add it in with this PCB layout it doesn't. I've read over all the datasheets and everything several times. It all seems right. I've got to be missing something.
     
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Where are you located.?
     
  8. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    LCD pin3 , you disconnect ground and place a diode like 1N4148 with anode to pin3 and cathode to ground.
    generally people use a preset to keep pin3 at approx 0.7V.
    automatically you get the characters , provided the wiring is correct .
    Peculiarly we observe that the pins are not in an order needed for LCD for straight connection. That is the very reason Ericgibbs asked for the actual wiring info.
    please ensure that the pin numbers of LCD as mentioned on pcb artwork are explicitly maintained.
    keeping contrast pin (3) of LCD at ground level, you get only BLACK BOXES.
    all the best
     
    Last edited: Mar 22, 2010
  9. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    I'm in houston, tx in the US.
     
  10. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    I was going to offer that you send me the project to debug for you, the States is a little too far..:rolleyes:

    Some States side member may help you out.

    Do you have a decent digital voltmeter.?
     
  11. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Thanks for the offer.

    Yes, I have a fluke 87 III. I tried to read some voltages, but I didn't know anything about what I could be reading on the out pins of the PIC. I'd love to be able to troubleshoot it myself, just need to know what I'm looking for.
     
  12. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    could you see my reply please?
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    OK,
    With the project powered up.

    Connect the meter negative to a 0V point on the main pcb.

    Set the meter to 5V 'dc'

    Measure and post the voltage on all the pins of the LCD pcb

    Note: pins 11,12,13 14 may fluctuate a little.
     
  14. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    I'll have to check in a couple hours when I get home. I did do that on some of the data pins, I can't recall exactly which ones had which voltage, but if I recall correctly the data pins ranged from 0.08v to about 2v on the pic chip. I will post the voltages of the LCD pcb pins tonight.

    Thanks
     
  15. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    Eric,
    Don't you feel keeping contrast pin (pin3) of an LCD display at Ground is the reason for the black boxes, assuming that he gave the connections correctly?
     
    Last edited: Mar 22, 2010
  16. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    If the data pins are around 0V to 2V that sounds suspect.

    Its late evening in the UK, so if no one else steps in to help, I'll catch you tomorrow...
     
  17. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    I already checked the contrast on that. I wired in a 10k pot and adjusted the contrast. Still didn't help, doesn't appear to be receiving any data. When I had the PIC circuit separated everything was working fine, including with the contrast pin on ground.
     
  18. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    while other parameters are yet to be checked, keeping ground on pin3 doesn't show up the characters
     
  19. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Good idea mvs sarma. I checked the datasheet again for the LCD and it does call for positive voltage. Will add that to things to test tonight.

    Thanks
     
  20. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    you may place one 0.1uF disc or multilayer cap across pins 5 and 14 of the pic. this is needed as perhaps the power supply gets noisy as the motor rotates
     
    Last edited: Mar 22, 2010
  21. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    I'll have to pick up a cap to try. I was able to get the voltages.

    PIC Chip pin voltages:

    PIN / Voltage
    1 / 0v
    2 / 5v
    3 / 5v
    4 / 5v
    5 / 0v
    8 / 5v
    14 / 5v
    17 / 0v
    18 / 5v

    LCD PCB Voltages:

    PIN / Voltage
    1 / 0v
    2 / 5v
    3 / .19v
    4 / 5v
    5 / 0v
    6 / 0v
    11 / 5v
    12 / 0v
    13 / 0v
    14 / 5v
    15 / 3.65v
    16 / 0v

    I'm also attaching a picture of my breadboard.
     

    Attached Files:

    Last edited: Mar 22, 2010

Share This Page