IR emitter and receiver to illuminate LED

Hi guys,

Im working on a college project to use infrared emitter and recievers to turn on LED's. The use of IR sensors is to act somewhat as a proximity sensor. The closer you get to the IR sensors the brighter the LED gets.

I am a novice when it comes to electronics and also to the amazing arduino kit.

Im having trouble both with the circuitry and also the programming side.

Any help would be very very helpful to get me started.

Many thanks

Taggy

I'm not sure if it's feasible to use a simple receiver as a distance measurer. As far as I know, if you use a simple emitter and detector, the beam's either broken or not, and the object is either "there" or "missing".

There are ready-made modules like the Sharp GP2Y0A21 which give you a distance, and then it's straightforward to turn that distance into a value for the led's brightness. Are you allowed to use such an off-the-shelf device?

JimboZA:
I'm not sure if it's feasible to use a simple receiver as a distance measurer. As far as I know, if you use a simple emitter and detector, the beam's either broken or not, and the object is either "there" or "missing".

There are ready-made modules like the Sharp GP2Y0A21 which give you a distance, and then it's straightforward to turn that distance into a value for the led's brightness. Are you allowed to use such an off-the-shelf device?

This is the sort of thing I'm looking to replicate. The video below looks to be more analogue rather than digital, or to be more accurate, to be controlled by the arduino.

Essentially I'm hoping to replicate something like the link below.

I can use anything I can get my hands on, but as I'm only a student I don't have a big budget.

Im struggling to even get the basics right using the breadboard.

Any help would be well appreciated.

UPDATE:

Hi guys, I managed to get my circuit working by analogue configuration.

I have wrote some sort of code to take the out from the IR receiver and use it to control the LED's but im struggling to do so.

SO FAR i have got thus;

"
int sensorPin1 = A1;

int ledPin = 2;

int sensorValue0 = 0;

void setup() {
pinMode(ledPin, OUTPUT);
}

void loop() {
sensorValue0 = analogRead(A1);
if (sensorValue0 > 1000 ) digitalWrite(ledPin, HIGH);
else digitalWrite(ledPin,LOW);
}

"

I think the ambient light is what's interfering with the sensors now. is there a way to overcome this ?

Unfortunately, the values you are getting from analogRead are just the averages of IR signal and are probably changing due to the timing of when you are pressing the button. It is a (moudulated) digital signal.

To get a better understanding, study the following site:

To get proximity working you need to look at an IR device that is actually designed for proximity (via search).

However, if you are just looking to detect if something is present/near, then your approach would be OK & digitalReads would suffice. A common PIR sensore is designed for this purpose.

Hi,

Yeah I'm just looking for the sensors to detect an object breaking the beam. When the IR senses an object it then send the signal to the arduino and then laminates the LED's.

Nothing much more complicated than that.

The LED's will be configured in a pixel/Node basis.

2 x 2 led's to forma node. Then 4 x 4 to construct a pixel.

Each 2 x 2 will relay back to the arduino to be monitored/controlled.

So far i have only managed to get the 2 x 2 working by analogue. The code written does not seem to control the LED's yet.

Any suggestions again would be extremely helpful.

Could you explain more about the size, scale, actual project and physical environment.