Professional Documents
Culture Documents
workshop
living
food
play
outside
Table of Contents
Infrared Tachometer using Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 1: Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
http://www.instructables.com/id/Infrared-Tachometer-using-Arduino/
Step 1: Components
1. Arduino Duemilanove
2. IR LED BM1331
3. IR Phototransistor BPT1331
4. Resistor 10k Ohm
5. Resistor 150 Ohm
6. Cables, pin sockets, perfboard
7. Motor & Wheel Assy : This is not the main interest in this project, basically any arrangement that provides a wheel with adjustable speed will do. Here I used a
styrofoam disk driven by a used walkman motor connected to an AC/DC adaptor through a potentiometer. Clamps, base, etc are just from the backyard. The only
important thing is to make window on the wheel such that the IR LED & phototransistor can see each other sometimes while the wheel is turning.
http://www.instructables.com/id/Infrared-Tachometer-using-Arduino/
http://www.instructables.com/id/Infrared-Tachometer-using-Arduino/
state1 = HIGH;
else
state1 = LOW;
digitalWrite(13,state1);
if (state2>state1){
currentTime = micros();
// Get the arduino time in microseconds
diffTime = currentTime - prevTime; // calculate the time difference from the last sensors meet-up
rps = 1000000/diffTime;
// calculate how many rev per second - good to know
rpm = 60000000/diffTime; // calculate how many rev per minute
unsigned long currentMillis = millis();
// print to serial at every interval - defined at the variables declaration
if(currentMillis - prevMillis > interval){ // see if now already an interval long
prevMillis = currentMillis;
Serial.print(rps); Serial.print(" rps "); Serial.print(rpm); Serial.println(" rpm");
}
prevTime = currentTime;
}
state2 = state1;
}</p><p>/* only for testing to determine the sensorthreshold value
delay(500);
Serial.println(sensorvalue);
*/
}</p>
Tricky thing was while defining the sensorthreshold value. I did this: comment the main routine, and uncomment the testing section as follows. That way arduino will write
to serial monitor and update the sensor value in your screen every 500 ms. Turn and stop the wheel so that the sensors are blocked and look what number appears (in
my case around 37-40), then turn and stop where the sensors can see each other through the window and look what number in the screen now (in my case 14-19). Then
set a number as sensorthreshold variable value that you now know what is a good number to distinguish between "see" or "do not see" (I set 30 in my case, because my
"do not see" is 37-40 and "see" is 14-19, setting between 20-36 can do the same function also, but not really safe because the value may sometimes be 35 or 21).
Below is the code modification for checking the good number for sensorthreshold variable:
<p>....</p><p>void loop()
{
sensorvalue = analogRead(0); // read from pin 0
/*</p><p>
if(sensorvalue < sensorthreshold)
...</p><p>
state2 = state1;
}</p><p> */</p><p>// only for testing to determine the sensorthreshold value</p><p> delay(500);
Serial.println(sensorvalue);
}</p>
http://www.instructables.com/id/Infrared-Tachometer-using-Arduino/
Related Instructables
How to use IR
Sensor using
Op amp and
Arduino by zx
lee
Arduino-Based
Optical
Tachometer by
CMPalmer
Tachometer by
MauricioR
Sound Card
Tachometer by
wotboa
http://www.instructables.com/id/Infrared-Tachometer-using-Arduino/
DIY LED
Tachometer
(video) by
abo_hosni
Advertisements
Comments
http://www.instructables.com/id/Infrared-Tachometer-using-Arduino/