Mastering the Art of Input Speed Sensor: A Comprehensive Guide

The input speed sensor is a crucial component in various systems, including automotive, industrial, and robotics applications, for measuring the rotational speed of a shaft or wheel. This sensor can be an optointerruptor, which detects when something blocks light passing between two black posts, or a magnetic encoder, which uses a ferrous gear wheel, stamped disk, or cylinder, or an axially or radially magnetized ring magnet mounted on a rotation axis.

Understanding the Technical Specifications of Input Speed Sensors

The technical specifications of an input speed sensor can vary based on the manufacturer and application. However, some common specifications include:

  1. Output Type: The sensor can have an analog or digital output, depending on the application requirements.
  2. Resolution: The sensor’s resolution can range from 2° to 30°, depending on the number of slots or poles on the coded wheel or ring magnet.
  3. Accuracy: The sensor’s accuracy can be expressed as absolute or relative accuracy. The relative accuracy is defined only for speed measurements, while the absolute accuracy is a constant time offset that cancels out in the difference when calculating velocity.
  4. Operating Temperature Range: Input speed sensors are designed to operate within a specific temperature range, typically from -40°C to 150°C, to ensure reliable performance in various environmental conditions.
  5. Vibration and Shock Resistance: The sensor’s housing and mounting design must be able to withstand the vibrations and shocks encountered in the application environment, such as in automotive or industrial machinery.
  6. Ingress Protection (IP) Rating: The sensor’s IP rating indicates the level of protection against dust and water ingress, which is crucial for outdoor or harsh environments.
  7. Supply Voltage: Input speed sensors typically operate on a wide range of supply voltages, such as 5V, 12V, or 24V, depending on the application requirements.
  8. Output Signal Characteristics: The sensor’s output signal characteristics, such as pulse width, amplitude, and rise/fall times, must be compatible with the input requirements of the control system or data acquisition device.

Measuring Input Speed Using Pulse Outputs

input speed sensor

To measure the input speed, the sensor can output pulses at specific angular locations based on the time-varying magnetic input signal. The speed can be calculated as the inverse pulse distance, and the sensor’s integrated algorithms can provide rotation direction robustly even under adverse conditions such as temperature and signal variation, signal drift, and various vibration signatures.

The formula for calculating the input speed (in revolutions per minute, RPM) using the pulse output is:

Speed (RPM) = (60 × Pulse Frequency) / (Number of Slots or Poles)

Where:
– Pulse Frequency is the number of pulses per second (Hz)
– Number of Slots or Poles is the number of slots or poles on the coded wheel or ring magnet

Building a DIY Input Speed Sensor

For a DIY input speed sensor, you can use an optointerruptor or magnetic encoder, connect the sensor to a digital input on an Arduino or similar microcontroller, and write code to read the sensor’s output and calculate the speed based on the time between slots and the number of slots per revolution. The code can also handle situations where there is no speed at the beginning of a timing session or the coded wheel may stop on a slot or black area.

Here’s an example of how to set up a DIY input speed sensor using an Arduino:

  1. Hardware Setup:
  2. Connect an optointerruptor or magnetic encoder to a digital input pin on the Arduino.
  3. Ensure the sensor is properly aligned with the coded wheel or ring magnet to detect the slots or poles accurately.

  4. Software Setup:

  5. Write Arduino code to read the sensor’s output and calculate the input speed.
  6. Use the micros() function to measure the time between pulses and calculate the pulse frequency.
  7. Implement logic to handle situations where the coded wheel stops or there is no speed at the beginning of a timing session.
  8. Display the calculated speed on the Arduino’s serial monitor or an external display.

Here’s a sample Arduino code snippet:

// Define the digital input pin for the speed sensor
const int speedSensorPin = 2;

// Variables to store the time between pulses and the calculated speed
unsigned long previousTime = 0;
unsigned long currentTime = 0;
float speed = 0.0;
int numSlots = 60; // Number of slots on the coded wheel

void setup() {
  Serial.begin(9600);
  pinMode(speedSensorPin, INPUT);
  attachInterrupt(digitalPinToInterrupt(speedSensorPin), speedSensorISR, RISING);
}

void loop() {
  // Your main program logic goes here
  Serial.print("Input Speed: ");
  Serial.print(speed, 2);
  Serial.println(" RPM");
  delay(1000);
}

void speedSensorISR() {
  currentTime = micros();
  if (previousTime != 0) {
    float timeDiff = (currentTime - previousTime) / 1000000.0; // Time difference in seconds
    speed = (60.0 / (timeDiff * numSlots)); // Calculate speed in RPM
  }
  previousTime = currentTime;
}

This code uses an interrupt-based approach to measure the time between pulses from the speed sensor and calculate the input speed in revolutions per minute (RPM). You can customize the code to fit your specific requirements, such as adjusting the number of slots on the coded wheel or handling different sensor types.

Conclusion

The input speed sensor is a crucial component in various applications, and its technical specifications, such as output type, resolution, and accuracy, can vary based on the manufacturer and application. By understanding the sensor’s technical details and building a DIY input speed sensor, you can gain valuable insights into the rotational speed of shafts or wheels in your projects, whether in the automotive, industrial, or robotics domains.

References

  1. Solved: encoder and speed sensor – NI Community, 2013-08-29, https://forums.ni.com/t5/LabVIEW/encoder-and-speed-sensor/td-p/2539952
  2. How to use speed measuring module? – Sensors – Arduino Forum, 2017-03-25, https://forum.arduino.cc/t/how-to-use-speed-measuring-module/447415
  3. FUNDAMENTAL PROPERTIES OF SPEED SENSORS, Allegro MicroSystems, 2021-06-28, https://www.allegromicro.com/-/media/files/application-notes/an296240-speed-sensor-fundamentals.pdf?sc_lang=en