The IR Speed Grove is an infrared sensor module designed to detect the speed of moving objects. It operates by emitting infrared light and measuring the time it takes for the light to reflect off an object and return to the sensor. This module is widely used in applications requiring speed measurement, such as motor speed monitoring, conveyor belt systems, and robotics. Its compact design and ease of integration make it a popular choice for both hobbyists and professionals.
The following table outlines the key technical details of the IR Speed Grove module:
Parameter | Value |
---|---|
Operating Voltage | 3.3V to 5V |
Operating Current | ≤ 20mA |
Detection Range | 3mm to 80mm |
Output Signal | Digital (High/Low) |
Response Time | ≤ 2ms |
Operating Temperature | -25°C to 85°C |
Dimensions | 20mm x 20mm x 10mm |
The IR Speed Grove module has a 4-pin interface. The pin descriptions are as follows:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply pin (3.3V to 5V) |
2 | GND | Ground pin |
3 | OUT | Digital output pin (High when object detected) |
4 | NC | Not connected (reserved for future use) |
VCC
pin to a 3.3V or 5V power source and the GND
pin to the ground of your circuit.OUT
pin to a digital input pin on your microcontroller or other processing unit.OUT
pin will output a digital signal:OUT
pin if the signal is unstable.Below is an example of how to use the IR Speed Grove with an Arduino UNO to measure the speed of a rotating object:
VCC
pin of the IR Speed Grove to the 5V pin on the Arduino.GND
pin of the IR Speed Grove to the GND pin on the Arduino.OUT
pin of the IR Speed Grove to digital pin 2 on the Arduino.// IR Speed Grove Example Code
// This code reads the digital output from the IR Speed Grove and calculates
// the speed of a rotating object based on the time between pulses.
const int sensorPin = 2; // Pin connected to the OUT pin of the IR Speed Grove
volatile unsigned long lastPulseTime = 0; // Time of the last detected pulse
volatile unsigned long pulseInterval = 0; // Time between two pulses
void setup() {
pinMode(sensorPin, INPUT); // Set the sensor pin as input
Serial.begin(9600); // Initialize serial communication
attachInterrupt(digitalPinToInterrupt(sensorPin), measureSpeed, FALLING);
// Attach an interrupt to detect falling edges on the sensor pin
}
void loop() {
if (pulseInterval > 0) {
// Calculate speed (e.g., in RPM) based on pulse interval
float speed = 60000.0 / pulseInterval; // Speed in RPM
Serial.print("Speed: ");
Serial.print(speed);
Serial.println(" RPM");
delay(500); // Update every 500ms
}
}
void measureSpeed() {
unsigned long currentTime = millis(); // Get the current time
pulseInterval = currentTime - lastPulseTime; // Calculate time between pulses
lastPulseTime = currentTime; // Update the last pulse time
}
No Output Signal
Unstable Output
OUT
pin and ensure proper grounding.Inaccurate Detection
Interference from Ambient Light
Can the IR Speed Grove detect transparent objects?
What is the maximum speed the sensor can measure?
Can I use the IR Speed Grove with a 3.3V microcontroller?
How do I clean the sensor?
By following this documentation, you can effectively integrate the IR Speed Grove into your projects and troubleshoot any issues that arise.