InfraRed Detector Not Working?

ChedderCheeser

Senior Member
I went to radio shack to get a infra red sensor. I got it. I wired it up. I programmed it:
Code:
#PICAXE 08M

Main:
	DO
		INFRAIN2 ; wait for and receive the incoming data
		SERTXD (#infra, CR, LF) ; Pass the data to the PC Terminal prog for viewing
	LOOP ; loop forever to keep receiving data with values from 0 to 127
I get NOTHING in the terminal, I THINK its the terminal... because, I was using terminal earlier, but it wasnt working... What do you guys think? I DONT have the resistors or the capacitor... It should still work... i have a ton of power smoothening capacitors... What to do???
 

westaust55

Moderator
As a starting point from reading the PICAXE manual 2, while the INFRAIN2 should work the manual states:
This command is deprecated, please consider using the irin command instead.
Next:
please:
1. post the circuit diagram and
3. A link to thedatasheet for Radio Shack IR device you are using
2. maybe even a clear photo of the wiring so folks here can check your circuit

Help us to help you.

The IR receiver I am familiar with is open collector output so WILL NOT WORK without a pull-up resistor.
Did you read the datasheet?
 

ChedderCheeser

Senior Member
ok.. can the resistor be 10K? p.s. datasheet... yea, about that... uh .. no. :/ I havent seen it... also, i will try it with the irin command. I'll let you know what happens. but as said before, 10k?
 

westaust55

Moderator
Yes, 10K should be be okay.

From this and some of your other threads/question you do however need to buy yourself some 4k7 resistors as well.
 

westaust55

Moderator
datasheet... yea, about that... uh .. no. :/ I havent seen it...
Is it: http://www.radioshack.com/product/index.jsp?productId=2049727?

and from this site:
http://www.gumbolabs.org/2010/05/29/radioshack-infrared-receiver-arduino/

seems like it is akin to the usual TSOP4838 device many of us use. The writer states:
This signal was upside-down from what I had expected. The data pin appears to be idling HIGH and the signal drives it LOW. I verified this on my multimeter just to be sure. After this, I looked it up online and it appears to be the expected behavior.
However, Chedder, you really need to try and purchase items for which a dsatasheet IS either included or a link given to the datasheet so YOU can read how to use it. CHeap items with no datasheet can end up in you (and us) spending considerably more time to get your project operating than might otherwise be needed.
 

ChedderCheeser

Senior Member
Yes! That is it! And yes, I connected it to an led to check. It is high. If i use a transistor to flip it... then would it work? I really need this to work... I cant get a refund. :D If not, then... :( Thanks.. but.... so.. will a simple flip flop do the trick?
 

westaust55

Moderator
No transistor should be necessary.

Just install a resistor and a small electro cap as shown in the PICAXE manual 2 (V7.7) page 125 (or 114)

The PICAXE IR commands will interpret the signal from the IR receiver.

If you use SERIN commands for some home brew IR comms then you must use the Txxxx rather than Nxxxx baud rate parameter.
 

ChedderCheeser

Senior Member
Code:
#PICAXE 08M
#Terminal 4800

Main:
	DO
		INFRAIN2 ; wait for and receive the incoming data
		SERTXD (#infra, CR, LF) ; Pass the data to the PC Terminal prog for viewing
	LOOP ; loop forever to keep receiving data with values from 0 to 127
well then why doesnt that work?
 

westaust55

Moderator
Code:
#PICAXE 08M
#Terminal 4800

Main:
	DO
		INFRAIN2 ; wait for and receive the incoming data
		SERTXD (#infra, CR, LF) ; Pass the data to the PC Terminal prog for viewing
	LOOP ; loop forever to keep receiving data with values from 0 to 127
well then why doesnt that work?
@Chedder,

You have everything in front of you whereas we do not.

Please provide:
1. a clear explanation of precisely what you are trying to do
2. Details and links to datasheets about whatever you are using to send the IR signal
3. Post your schematic for all parts that YOU have constructed
4. Upload here, a clear photo of your project

Then we can understand better.

Is it a Sony device you are using to send the IR signal? :confused:
If not, then the PICAXE inbuilt IR related commands will not work -see the PICAXE manual 2 - the IR commands are for the Sony SOIR scheme.


EDIT:
You might also like to have a read of this basic Infrared comms tutorial posted a while back:
http://www.picaxeforum.co.uk/showthread.php?t=17303
 
Last edited:

inglewoodpete

Senior Member
Try this peice of code to see if the receiver is detecting any IR:

Code:
Do
   Do: Loop Until Pin3 = 0
   SerTxd("Gotcha!", CR, LF)
   Do: Loop Until Pin3 = 1
Loop
 

hippy

Ex-Staff (retired)
well then why doesnt that work?
In a previous program you had SERTXD and that should have shown data on the Terminal display but did not; could it be the same thing is happening with SERTXD here ?

It could all be working but you're simply not seeing that it is working ?
 

ChedderCheeser

Senior Member
In a previous program you had SERTXD and that should have shown data on the Terminal display but did not; could it be the same thing is happening with SERTXD here ?

It could all be working but you're simply not seeing that it is working ?
read it, but thatnks for the link!
 
Top