What H/W can be used for counting rpm

Discussion in 'Embedded Systems and Microcontrollers' started by sakishrist, Dec 4, 2009.

  1. sakishrist

    Thread Starter New Member

    Dec 4, 2009
    26
    0
    Hello,

    What are the choices of hardware to use to count the rpm of a DC motor with a PIC? Let's say that the thing spinning on the motor is a metallic disk ( http://www.youtube.com/watch?v=K1asNB0te0o ). Could this be done by this: [​IMG]

    Or maybe:
    [​IMG]

    Or maybe a Hall-effect sensor:
    [​IMG]

    So witch one of these is the best one to use? (by the way, I have the first two but not the last one so it would be great if you could describe the cons and pros of these). And are there other alternatives?

    Thanks
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    I'm not sure a broken 270 ohm resistor would be much use.
    The reed switch might work if you glue a couple (for balancing) of magnets to the disk but I don't know how fast they can switch on and off. This would be the easiest from a circuit point of view because they just switch on and off.
    Hall sensors would need a slightly more complicated circuit but are very fast.
    You could use use a reflective optical system which would be a similar speed and circuit as the Hall sensor system.
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I would favor using a photo-optical approach primarily because you would not need to attach a magnet to the spinning shaft. Adding a magnet would introduce an imbalance that would cause unwanted vibrations. You could add to magnets but rebalancing the spinning shaft or disc would still be a challenge.

    hgmjr
     
  4. sakishrist

    Thread Starter New Member

    Dec 4, 2009
    26
    0
    I do not think the first one is a resistor. :confused:

    As far as I could see moving a magnet close to that green thing would generate voltage (about 4 mV). So I was wondering if it would generate some higher voltage when moving at a higher speed so that the PIC could get a reading. Anyways, thanks for your help. I might buy a hall-effect sensor ...
     
  5. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    This looks like a broken leaded resistor to me.

    hgmjr
     
  6. sakishrist

    Thread Starter New Member

    Dec 4, 2009
    26
    0
    The one I got is not broken. When I tested it to see what's it's resistance I got a strange reading (65 ohms while the colors are: yellow blue red silver). I found it in a diskette drive. It was next to the DC motor and the DC motor had a tiny magnet on the spinning part of it that was passing right next to that green thing when spinning. And the diskette drive was working fine before I opened it. Could you please explain this to me?

    Thanks :)
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I don't believe that the resistor was there to detect the motor rotations. Resistors are not sensitive to magnetic fields. Maybe it is an inductor and the magnet on the shaft was influencing the net inductance as it passed in close proximity to the inductor. If it is an inductor then that would explain why its measured resistance did not agree with the stripes since they indicate the components inductance.

    hgmjr
     
  8. sakishrist

    Thread Starter New Member

    Dec 4, 2009
    26
    0
    So could that be used in a similar way, for higher rpm and with a PIC?
     
  9. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    There is a possibility but you would need to add more circuitry to condition the signal between the inductor and the PIC.

    hgmjr
     
  10. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    That top pic is almost certainly a 270 ohm 5% carbon resistor. The reed switch is not good for more than a few hundred RPM, as it is mechanical and therefore slow to operate and needs debouncing.

    What is the range of RPM? The optointerrupter works great at least up to 10,000 RPM.
     
  11. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    Actually I think you will find that #1 is a 270uH choke. I suppose if you attach a magnet to the rotating part it could be made to produce pulses.

    But I do agree with hgmjr, optical detection is the simplest neatest and most reliable solution.
     
  12. sakishrist

    Thread Starter New Member

    Dec 4, 2009
    26
    0
    Since I am not that good in electronics, could you tell me what's the circuit I may have to use with the inductor?

    The rpm I expect it to reach is about 5000.

    Is there any site that I could see how to setup optical detection?

    Thanks
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    You can get a free optical sensor from any old PC mouse (ball type) or strip from a VCR or fax machine.

    A search for "opto interruptor circuit" or "optical RPM sensor circuit" should show you how to connect it up.
     
  14. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    [​IMG]

    This is an Inductor........ not a resistor....
     
  15. sakishrist

    Thread Starter New Member

    Dec 4, 2009
    26
    0
    @THE_RB that's where I found one. :) Now I have a problem. There are 3 pins. The first one is gnd the second is for power supply but what's the 3rd one? I connected only the 1st two and it worked.

    @BMorse Will that be useful for what I want to do?
     
  16. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    The optical sensor in most mice is actually 2 sensors with a common pin, so you only need to use 2 pins.
     
  17. sakishrist

    Thread Starter New Member

    Dec 4, 2009
    26
    0
    Aha, and I was curious how it determines the direction of the movement. Now I get it.
     
Loading...