This project uses the Radio Shack emitter/detector LED pair 276-142 – There is no modulation of the ir signal. The project includes detailed descriptions plus photographs of the Arduino and breadboard configuration.
Here is some more information about the RS ir emitter/detector pair
update 5/2014 – For current information, see the musical stairs project – using this IR library with sensors from Adafruilt: https://reactivemusic.net/?p=12300
original post
I was able to build a version of this using some ir receivers from radio shack. The receivers were different – one received a relatively narrow angle beam, while the other one seemed to pick up everything in the room. So, although this method works, it will require some hardware tweaking.
Here’s my Arduino code for this… Note that the code runs 2 beams but the photos and videos only show one in the circuit.
#include <IRremote.h>
// tz 12/26/2012
/* This works with the basic IR beam layout of an
IR emitter and IR receiver from radio shack - when you break the
beam, like with your hand the LED on D13 lights up.
*/
#define PIN_IR 3
#define PIN_DETECT 2
#define PIN_STATUS 13
#define PIN_DETECT_B 7
#define PIN_STATUS_B 8
int counter = 0;
int stat = 0;
int stat_B = 0;
IRsend irsend;
void setup()
{
Serial.begin(9600); // open the serial port
pinMode(PIN_DETECT, INPUT);
pinMode(PIN_STATUS, OUTPUT);
pinMode(PIN_DETECT_B, INPUT);
pinMode(PIN_STATUS_B, OUTPUT);
irsend.enableIROut(38);
irsend.mark(0);
}
void loop() {
// digitalWrite(PIN_STATUS, !digitalRead(PIN_DETECT));
irsend.space(0);
delay(1);
irsend.mark(0);
stat = digitalRead(PIN_DETECT);
digitalWrite(PIN_STATUS, stat);
stat_B = !digitalRead(PIN_DETECT_B);
digitalWrite(PIN_STATUS_B, stat_B);
delay(1);
counter++;
if(counter > 1000) {
Serial.print("A: ");
Serial.print(stat);
Serial.print(" B: ");
Serial.print(stat_B);
Serial.println();
counter = 0;
}
}
Wheel sensor , from a wired (not wireless) bicycle speedometer (aka cyclocomputer) The sensor must perform like a reed switch, which is binary, rather than use the magnet on the spoke to vary the inductance. We used a Sigma Sport BC 500, which costs $15, but the city of Portland gives them to residents free, to encourage bicycling! Ask a bike shop if they can sell you just the wheel sensor part, without the computer and display.