I have a ir detector like here:

If i hook it up and use my apple remote then i see in my serial monitor it works.
I also have a IR detector that looks like a led, if i replace it with that then it doesn't work.
I have the setup like this:
5V
|
|
10K
|
|
-------------- pin 2
|
|
[Infrared-sensitive photoresistor]
|
|
gnd
I don't have a datasheet of my led like looking detector, so what's the best thing to do?
if i replace it with that then it doesn't work.
What doesn't work?
An LED is not a detector, you must do different things with them.
I have the setup like this:
I bet you don't, that diagram shows a 10K connected to ground with pin 2 connected to ground as well.
So what have you got and what do you want to do?
It just looks like a led, the shape.
http://www.reconnsworld.com/ir_ultrasonic_basicirdetectemit.html
I forgot the [Infrared-sensitive photoresistor] in the diagram, i updated it now.
I got this one working:
As in if i press a button of my remote is see a array of on/off values.
But i want also the other one to work, the one that has a led shape.
The lead that goes with the flat on the circumference is the collector and it should go to the 10K?-"Pin2" junction, the emitter to GND.
You may want to shield it from ambient light (put the sender and receiver in a box or something) or use some filtering when testing. IR photodiodes and phototransistors have a certain susceptibility to visible light, too.
it doesn't work, maybe it's not a 5volt.
maybe it's not a 5volt.
No these things have no working voltage.
Maybe the peak wavelength response is different or maybe you have connected it the wrong way round or maybe 10K is too low.
Try connecting it to an analogue input and see if it is actually working.
I always disconnect everything when i'm done with arduino to build up from scratch when i go work on something again.
I don't get it to work anymore as it used to..
After that i did some tests, i ended up with:
V5
|
|
10k
|
|
+----- Analog pin 2
|
|
GND
So no IR detector!
I get those values, is my arduino broken?
465
76
222
735
486
82
198
727
509
87
184
720
536
94
166
710
553
102
245
743
455
74
231
736
477
79
206
728
If that is truly what you get when reading Analog pin 2 which is connected to ground (the resistor is not doing anything) then the analog input pin is fried.
Dose the same happen for all pins?
Why would the resistor not do anything?
And yes this happens to all analog pins
.
Also when i use this with no wires at all then i still get a output value of around 200, why is that?
#define PIN A1
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(analogRead(PIN));
}
Why would the resistor not do anything?
Because the pin and one end of the resistor are both connected to ground. It is therefore totally irrelevant what the other end of the resistor is connected to. Be it nothing at all or 10000 Volts it makes no odds the pin is still connected to ground.
Also when i use this with no wires at all then i still get a output value of around 200, why is that?
Because your inputs are floating. This is normal for a working system. If you haven't got a ground when you think you are connecting the input pin to ground then this is what you get. If you have got a ground and get this on all your pins then you input pins are broken and you will ave to get a new chip.
I tested a pot meter on the analog input and there if i adjust the pot meter it goes from 0 to 1023.
So i guess my ports are fine then.
Also you said
No these things have no working voltage.
I just broke a normal led (i knew that could happen), but it's only the receiver that has no working voltage right?
Anyway i think i broke my emitters,i put them on a pot meter and looked at them with a camera but i can't detect any light.
...input pins are broken and you will ave to get a new chip.
Since the pot meter is working fine i don't need it i guess, but so if a pin breaks you don't have to buy a new board but only a chip?
I tested a pot meter on the analog input and there if i adjust the pot meter it goes from 0 to 1023.
So when you said:-
After that i did some tests, i ended up with:
V5
|
|
10k
|
|
+----- Analog pin 2
|
|
GND
So no IR detector!
I get those values, is my arduino broken?
You indeed had not got it wired up like you thought or showed in that diagram. I can only give advice assuming what you tell me is true.
but it's only the receiver that has no working voltage right?
You don't apply a voltage to the receiver to make it work, so in that respect it has no "working voltage" like say an LCD module has a working voltage. Like every component there is an absolute voltage which will destroy the device. Likewise an LED does not have a working voltage, it has a forward voltage drop at a specified current draw but no working voltage.
Anyway i think i broke my emitters,i put them on a pot meter
How? That is a good way to blow up the pot as they can only take a limited amount of current. What value did you use? I would say a pot is a bad way to test a IR emitter. The best way is to connect it to 5V through a 220R resistor, measure the voltage drop across it.
but so if a pin breaks you don't have to buy a new board but only a chip?
Yes
I tested my infrared detector again.
by one of them my default value is between 2 and 4 and when i press my remote i get a value of around 30.
3
4
3
2
4
2
29
30
30
3
3
2
2
3
That's with a 10k resistor.
If i test the other detector then i don't detect any action.
If i try 290ohm resistance then also constant 0 and i don't detect any action form my remote.
Also when i go back to 10k, i not always spot a result like analog values of 30.
How can i get a descent range?
also, about the emitter, i will do this tomorrow
The best way is to connect it to 5V through a 220R resistor, measure the voltage drop across it.
to test a IR emitter. The best way is to connect it to 5V through a 220R resistor, measure the voltage drop across it.
The led looking ones give:
-0.06
0.35
The rectangle looking one gives:
4.07
So i guess my led looking ones are broken?
Also the short leg should be in the direction to the ground right, no matter what?
[ ]
| |
| |
| -------GND
Also the short leg should be in the direction to the ground right, no matter what?
No it depends on the makers. Yes most have a short leg for the negative connector but not all.
You find out by looking at the data sheet, which in your case you don't have.
The led looking ones give:
-0.06
0.35
The rectangle looking one gives:
4.07
So i guess my led looking ones are broken?
Those tests are for an emitter not a detector, all you are showing is the LED looking one is not behaving like an emitter.
Those tests are for an emitter not a detector, all you are showing is the LED looking one is not behaving like an emitter.
I did that test on the emitter (as far as i know)
I will try again when i'm home