Infrared Speed Motor Sensor

SEN-052
47 In stock
R 51.11
Ideal for sensing the speed of your robot. Our robot chassis comes with 2 encoder disks (plastic disks with holes in them) fitted to the robot motors.  This module fits over the encoder disk counting the holes in the disk, the number of holes per second detected by this module...
R 51.11
Terms & conditions

Ideal for sensing the speed of your robot. Our robot chassis comes with 2 encoder disks (plastic disks with holes in them) fitted to the robot motors.  This module fits over the encoder disk counting the holes in the disk, the number of holes per second detected by this module determines the speed of your motors.

Encoder disks can also be bought separately.

A small sensor for measuring motor speed or other objects that can pass through the detector's slots. Each time an object blocks the light from passing from one side of the slot to the other, a pulse is produced at the output. The output signal is pre-conditioned using a comparator to provide a clean low or high signal.

Infrared Speed Motor Sensor Spec

* Reader opening: 10(h) x 12.5(w) mm
* Supply voltage: 3.3 - 5V
* Output: Low or High
* Dimensions: 23 x 20mm
* Mounting holes ø3.2mm, c-c 14mm

Code

/*
Connection for Uno or other 328-based platforms:
  left wheel encoder (DO)  -> Digital pin 2
  right wheel encoder (DO) -> Digital pin 3
*/
#define LEFT 0
#define RIGHT 1

long coder[2] = {0,0};
int lastSpeed[2] = {0,0};
void setup(){
Serial.begin(9600);
attachInterrupt(LEFT, LwheelSpeed, CHANGE);
attachInterrupt(RIGHT, RwheelSpeed, CHANGE);
}

void loop(){
static unsigned long timer = 0;
if(millis() - timer > 100){
Serial.print("Coder value: ");
Serial.print(coder[LEFT]);
Serial.print("[Left Wheel] ");
Serial.print(coder[RIGHT]);
Serial.println("[Right Wheel]");

lastSpeed[LEFT] = coder[LEFT];
lastSpeed[RIGHT] = coder[RIGHT];
coder[LEFT] = 0;
coder[RIGHT] = 0;
timer = millis();
}
}

void LwheelSpeed(){
coder[LEFT] ++;
}

void RwheelSpeed(){
coder[RIGHT] ++;
}
Write a review
| Ask a question
Write a review
| Ask a question
The cookie settings on this website are set to 'allow all cookies' to give you the very best experience. Please click Accept Cookies to continue to use the site.
Infrared Speed Motor Sensor
You have successfully subscribed!
This email has been registered