Thursday, September 22, 2011

Contact less IR tachometer using PIC16F628A

Tachometer is a device that gives the information about the rotational speed of any shaft or disc. It usually measures the speed in revolutions per minute (RPM). 
I want it to measure the speed of motor so for this i searched the net and found various design but unfortunately they don't worked for me, don't know why?. So i decided to make my own tachometer using PIC16F628A micro-controller and LCD.

Today i am going to make a simple tachometer that could measure the rotation speed of a PC power supply fan without making any physical contact (that's why it is contact less) with the rotating object. The range of this tachometer is 0 - 9999 RPM and displays the RPM on a 16x2 LCD. 

Working operation is simple; IR LED start transmitting and the receiver only receives them when they reflect back. So just count the pulses received and multiply it with 60 to get rpm.  For pulse counter, i am using timer 0 in counter mode.  

Receiver part is build around the receiver LED (photo diode), transistor, and resistor etc. normal condition, the photo diode offers high impedance (as usually used in reversed biased) and so the voltage across it will make the BC557 transistor in the receiver part cut off. The output Pulse will be at logic low. When there is a reflected pulse, the resistance of the photo diode will drop down and allow BC557 transistor to saturate. This gives a logic high Pulse output. The PIC 16F628A will count the pulses within the 1 sec interval to determine the RPM. 

Download: The schematic and code here.
Schematics:
Contact less IR tachometer using PIC16F628A

Snapshot of IR tachometer

Components Required:
U1-------------------------PIC16F628A
R1-------------------------100 ohm
R2-------------------------1.7K ohm
R3-------------------------1K ohm
R4-------------------------10K ohm
D1------------------------- IR LED
D2-------------------------photo diode
D3-------------------------1N4148
Q1--------------------------BC557
Mics:
16x2 LCD
4MHz crystal
22pF ceramic capacitor (2)

30 comments:

  1. Hi Malik.I can not download the code.link does not work.

    ReplyDelete
  2. I download code and schema.Thank you for sharing project.

    ReplyDelete
  3. THIS IS JUST PERFECT. NO COMPLAINS.
    u have all things figured out. this my favourite spot now.

    ReplyDelete
  4. Hi Malik,this is very nice project.I'm sure that it's possible to make speedometer out of your project with code modification,but I'm not so good in programing.Could you,please,give me an idea what to change in your code to make it measure the speed of the wheel and distance?I would like to make it for my motorcycle,so I also need to store last odometer value on eprom.Maybe you have something like that already?PIC16f628A would be just perfect for something like that.Thank you in advance,Tom.

    ReplyDelete
  5. yes, remove the ir rx and tx and use reed switch. and in coding use the timer in counter mode and adjust your counting limit. then do the math like:
    Let The radius of the front wheel is 30 cm. (This can vary with the brand or model.)
    Circumference of the wheel= 2πr
    (where ‘r’ is in cm)
    = 2×3.14×30
    = 188.4 cm or 1.884 meters
    Let’s assume that in 1 second the wheel completes one revolution. In other words, in one second, the bike has covered 1.88 metres. Therefore the speed in km/hour: N×1.88×3600/1000 = N×6.784
    where ‘N’ is the number of revolutions per second.

    ReplyDelete
  6. Thank you Malik,I think I can do that,I'll let you know about my progress.

    ReplyDelete
  7. hi malik thank you for posting this project...i got the codes and schemes..after extracting the rar folder there is lot of files,which all files are we need to burn in to pic....plz reply............

    ReplyDelete
  8. hello malik,how can i burn programs into pic...for this burner kit is necessory?

    ReplyDelete
    Replies
    1. PIC burners can be found at:
      http://electronicseverywhere.blogspot.com/search/label/PIC%20Programmer

      Delete
  9. Hello Malik, where i have to place those 2 22pF ceramic capacitor in the ckt?

    ReplyDelete
    Replies
    1. connect 4MHz crystal at pins 15 and 16 with 22pF capacitor.but remember connect one leg of the capacitors with crystal and others with ground. or just see the data sheet for connections.

      Delete
  10. will u plz post the use of all the components provided in the circuit diagram..plz reply

    ReplyDelete
    Replies
    1. please be specific.working operation is already mentioned.

      Delete
  11. hello malik....i am doing this project as a mini project.but i cant understand the program that is used in the project..plz help me?

    ReplyDelete
    Replies
    1. in short timer0 is used as a counter; it count the pulses for 1sec and multiply the result with 60 to get rpm.that it!

      Delete
  12. hello malik....the reading of tachometer changes with respect to the width of paper strip...so how can get more accurate value..plz give a solution..

    ReplyDelete
  13. hi malik i have a doubt, the photo diode will sense the ordinaty light ..so this will make some errors in the readings if ordinary light is there.can we eliminate this problem..plz reply....

    ReplyDelete
    Replies
    1. use black tape or something around the diode, also align the diode horizontally not vertically; in this way you overcome this problem.

      Delete
  14. hello malik,
    what is the estimated cost of this project?

    ReplyDelete
  15. helo malik,

    i just want to kno that is this project a same as project on measuring a speed through optocouplers..??

    ReplyDelete
  16. hi malik can you send me circuit schematic & code using 8051

    ReplyDelete
  17. please give me the c program of contactless tachometer using microchip

    ReplyDelete
  18. Hi im a newbie in this kind of stuff of pics but just wondering, if I put a higher crystal frequency like lets say 12 MHz, or even 20 MHz, does the measurement would update faster? Just a question!! thanx!

    ReplyDelete
  19. nop, timer0 is used as counter not timer. the things that matters are the one second delay routine n config words.

    ReplyDelete
  20. hello Mr. Malik, can i use pic16f84a with this project? instead of pic16f628a

    ReplyDelete
  21. Hi Malik ,
    What is your e-mail address.

    ReplyDelete