tachometer -16F877

Discussion in 'The Projects Forum' started by xw0927, May 12, 2012.

  1. xw0927

    Thread Starter Member

    Dec 19, 2010
    114
    0
    hi,i am newbie to microcontroller,so i am not quite understnading how to write the code.this is my first time mini project,basically the project is relate about a tachometer,and when we move it,a tachometer will sense the pulse and then record by using counter,and display in lcd-speed and distance.BUt how we can built own encoder?HAve any schematic for encoder?
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,094
    3,033
    One easy option is a prebuilt optical sensor pair, an IR diode and detector facing each other across a narrow gap. You turn a disc thru the gap, and holes or gaps in the disc edge generate a signal. Does that sound like what you need? FWIW, old VCRs often contain some of these.
     
    xw0927 likes this.
  3. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Most pedal cycle tachometers have a magnet on the wheel and a reed switch on the frame. Not very high tech but simple.
    Old fashioned computer mice (with the ball) have at least 2 of the encoders that wayneh mentioned. The optical mice that I've taken apart have one for the scrollwheel.
     
    Last edited: May 12, 2012
    xw0927 likes this.
  4. wayneh

    Expert

    Sep 9, 2010
    12,094
    3,033
    That reminds me - a cheap bicycle computer can be adapted to a wide variety of similar timing tasks. All the "hard stuff" is done for you in a small, cheap, low-power device. All you need is to interface it appropriately, for instance by using a frequency divider to bring your signal into range, less than 10Hz or so.
     
    xw0927 likes this.
  5. xw0927

    Thread Starter Member

    Dec 19, 2010
    114
    0
    I had discussed with my lecture,due to the deadline of my project is next two weeks,he asked me just buy an encoder and used it in my project,but now the problem is I dont know how to use encoder,and the program how to write in pic to measure the speed???here is the atttachment of my schemtatic and the program-source code. View attachment tach-.zip
     
  6. absf

    Senior Member

    Dec 29, 2010
    1,492
    371
    There's a mistake in your PIC oscillator circuit. The capacitors are 1000uF and it wont be able to oscillate. Change them to 22pF will do.;)

    You dont need a hw encoder/decoder to convert RPM to voltage for your analog input AN1. You can setup the PIC to count pulses using interrupts and some simple maths to convert them to RPM.

    But if you want to go the HW way you'll need a LM2917 F-V converter and you can refer to the LM2917 datasheet. Good luck with your project.:D

    Allen
     
Loading...