Use U-speed Module on Arduino

1.3K80

Intro: Use U-speed Module on Arduino

The principle of U-speed is the grooves of U shaped has an optical sensor and a light sensitive transistors respectively on both sides. The conduction state of receiver determines the output is high level or low level module. And then through the level number changes that occurred within a certain time to infer the motor speed. This module is widely used for motor speed measurement, pulse count, location, spacing, etc.

STEP 1: Part List

1 x U-speed
1 x Arduino

Several Jumper lines

STEP 2:

U-Speed module pin V – > Arduino 3.3v
U-Speed module pin G – > Arduino GND

U-Speed module pin S – > Arduino D3

STEP 3: Test Code


int sigState = 0;int sigPin = 3;void setup() {// put your setup code here, to run once:pinMode (sigPin, INPUT);Serial.begin (9600);}
void loop() {// put your main code here, to run repeatedly:sigState = digitalRead (sigPin);Serial.println (sigState);}

Copy the code to Arduino IDE on your computer and then upload it into the Arduino.

STEP 4: Test Result

When there is no obstructions, the serial port is to output 1, indicate the output level is high.

When there are obstrctions, the serial port is starting to output 0, and the LED on this module will light.



STEP 5: