Announcement

Collapse
No announcement yet.

Arduino Sensor RPM

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Arduino Sensor RPM

    Hi All,

    Here is the info on the RPM Sensor.

    Click image for larger version

Name:	RPM_Opto.JPG
Views:	1
Size:	24.7 KB
ID:	50993
    Circuit - Signal is connected to digital pin

    Click image for larger version

Name:	IMG_8052 (800x604).jpg
Views:	1
Size:	38.4 KB
ID:	50994
    Photo - Yes the bike wheel shaft does come out of the workshop wall.
    The resistors are on a small circuit board under the bracket.

    Sketch:

    /* RPM sensor using a Reflective Object Sensor OPB705WZ from OPEK Technology
    Using pulseIn() to measure a high pulse length in micro seconds
    Reflective surface is aluminium dsk with two black quadrants painted on
    Convert pulse time to RPM. Print out duration and RPM to serial monitor.
    */



    int pin = 7;
    float RPM;
    unsigned long duration;


    void setup()
    {
    Serial.begin(9600); // initialize serial communication at 9600 bits per second:
    pinMode(pin, INPUT);
    }
    void loop()
    {
    duration = pulseIn(pin, HIGH); // read HIGH, duration = 1/4 rotation
    if(duration > 5000) // duration of 5000 micro seconds limits speed to 3000 RPM. This stops erroneous data caused by transient spikes
    {
    RPM = (15000000.0/duration); // (1000000uS * 1/4 * 60s) / duration = 15000000.0 / duration keeps calculation simple
    Serial.print(duration);
    Serial.print(" micro seconds ");
    Serial.print(RPM);
    Serial.println(" RPM");
    delay(10); // delay
    }
    }

    I hope this sketch is readable. Any suggestions welcome.

    Peter

  • #2
    Hello Peter,

    i have build my RPM sensor, with a simple reed switch...
    when magnets of bicycle wheel fly by, the reed-switch closes..
    arduino can count this simple signal
    you need only an adjustable holder for the reed switch

    a reed switch is simplest way,
    i tried light detecting sensors too, but that was cumbersome in installation

    at this time i am not yet calculating the RPMs, but i count the magnets fly by,
    my cap pulser circuit discharges every x magnets went by

    FYI: my wheel is in range of 80-100 RPMs only, with 16 supernorth poles

    Comment


    • #3
      here the reed switch holder, clamped with wood stripes and one brass screw..
      http://www.energyscienceforum.com/me...-snv12745.html
      http://www.energyscienceforum.com/me...nv12745-2.html
      http://www.energyscienceforum.com/me...heel-no-2.html

      Comment

      Working...
      X