PDFPrintE-mail


Beam photoelectric infrared Sensor
View Full-Size Image


Beam photoelectric infrared Sensor

( MISC )
SG$4.50


Slotted LM393 Beam Infrared Light Counter Photoelectric Sensor Module

Dimension:23mmx20mmx20mm
Chip: LM393, infrared head
Working voltage: DC 5 V

Features
1. It has a signal output instructions.
2. Single-channel output.
3. Output valid signal is low.
4. Sensitivity is not adjustable.
5. It can be used for work piece count, the motor speed encoder.

Can be place between Wheel Encoder Disc to detect speed.

**Might not fit all types of chassis, might need some modification.

 

Sample Code:

int encoder_pin = 2;  // The pin the encoder is connected          
unsigned int rpm;     // rpm reading
volatile byte pulses;  // number of pulses
unsigned long timeold;
// The number of pulses per revolution
// depends on your index disc!!
unsigned int pulsesperturn = 20;

void counter()
{
//Update count
pulses++;   
}

void setup()
{
Serial.begin(9600);
//Use statusPin to flash along with interrupts
pinMode(encoder_pin, INPUT);

//Interrupt 0 is digital pin 2, so that is where the IR detector is connected
//Triggers on FALLING (change from HIGH to LOW)
attachInterrupt(0, counter, FALLING);
// Initialize
pulses = 0;
rpm = 0;
timeold = 0;

}

void loop()
{
if (millis() - timeold >= 1000){  /*Uptade every one second, this will be equal to reading frecuency (Hz).*/

//Don't process interrupts during calculations
detachInterrupt(0);
//Note that this would be 60*1000/(millis() - timeold)*pulses if the interrupt
//happened once per revolution
rpm = (60 * 1000 / pulsesperturn )/ (millis() - timeold)* pulses;
timeold = millis();
pulses = 0;

//Write it out to serial port
Serial.print("RPM = ");
Serial.println(rpm,DEC);
//Restart the interrupt processing
attachInterrupt(0, counter, FALLING);
}
}


Availability

In Stock: 11

Usually ships in:

2-3d.gif


Customer Reviews:

There are yet no reviews for this product.
Please log in to write a review.


You may also be interested in this/these product(s)

Robot Car Chassis Kit w/ Encoder Disc
Robot Car Chassis Kit  w/ Encoder Disc
SG$19.70




Products Categories

We Accept


 


Shopping Cart

Your Cart is currently empty.

NOTE..


-> NO GST -> NO GST -> NO GST

Product Search



Advanced Search

Currency Selector




HTTPS Secure