5

I'm looking for a library to decode RAW IR signals from an IR sensor (looks like a black LED, two legged) rather than an IR module (3 legged, rated for a particular frequency - such as 38kHz).

Is there a library that supports IR sensors?

A picture of the two possibilities can be seen here

EDIT: This isn't a duplicate of my previous post, it is related to the same project however. On my previous question I asked what could be the cause. I've found out what it is - frequency. My previous IR detector was an IR module and not an IR sensor. The difference could be seen here

omribahumi
  • 189
  • 4
  • What difference does the sensor make? That is just a hardware issue. The incoming pulses will still be the same. – Nick Gammon Oct 02 '15 at 16:13
  • 3
    @NickGammon The difference is how the pulses are presented - a receiver amplifies and filters the signal, so you get a sequence of simple on-off pulses. With a detector you get whatever IR light is coming in. It's then up to you to filter out the light that is pulsing on and off at the carrier frequency to determine when the on is and when the off is. That could be done in software, or it could be done in hardware. Best to do it in hardware and use a matched receiver for your transmitter. – Majenko Oct 02 '15 at 16:48
  • @Majenko exactly. I didn't elaborate on the problem I want to solve: I have an IR module which decodes my remote as NEC. Retransmitting it with the same library doesn't work. Debugging a bit more shows that the remote sends pulse modulation at 830Hz. Could a 38kHz module decode this? – omribahumi Oct 02 '15 at 16:58
  • That's a whole different question. Better post a new question instead of adding this in the comments. – Gerben Oct 02 '15 at 17:32
  • @Gerben seems too technical to be over here. Posted on electronics – omribahumi Oct 02 '15 at 18:27
  • 1
  • This seems related to your question about A/C doesn't detect IR codes sent from Arduino. Although in that post you seemed confident you had detected the codes. Now you are not? Please explain why you are opening another question about your air conditioner and the IR remote, without referencing your earlier question. This helps see the project in context. – Nick Gammon Oct 02 '15 at 21:21
  • This question also seems very similar to control air conditioner using arduino - in itself double-posted. – Nick Gammon Oct 02 '15 at 21:21
  • @NickGammon in the previous question I was looking for what's causing it not to work, now that I've found out (it's the frequency). The reason I found out is by using an IR sensor rather than an IR module. What I'm looking for now is an IR library that works with IR sensor and not IR module, to make sure the codes were decoded properly. See my other question in electronics. – omribahumi Oct 02 '15 at 23:55
  • @NickGammon also, I just answered my previous question – omribahumi Oct 03 '15 at 00:02
  • No, you posted a mistaken analysis of your other question. You need to stop posting new questions and concentrate on understanding the actual problem. This question is based on fundamentally mistaken ideas and should be deleted. – Chris Stratton Oct 03 '15 at 18:55
  • Several cars and universal remote controls have this feature of autolearning sender codes by pairng keys in the learn mode. Why not do the same? – Tony Stewart EE75 Nov 30 '17 at 05:58

3 Answers3

1

I had a similar project a few months back and spotted this Arduino Library:

https://github.com/z3t0/Arduino-IRremote

and it is invaluable.

For your instance, you want the RAW Data which you can achieve using an Example included in the Library named: IRrecvDemo.

The wiring is easy and straight forward

An IR detector/demodulator must be connected to the input RECV_PIN.

Which is 11 by default but you can definitely change it :3

and the other two Legs of the IR detector/demodulator go to the power source.

Mero55
  • 201
  • 1
  • 6
1

IRremote (already recommended) - but to save you some time, use the IRRecvDump example to grab the raw codes you need for sendRaw(). They need to be averaged out across 10-20 reads. I log the output to a file, and use a perl script to do it for me, since it is painful to type this into a calculator a million times. The resistor you connect to the sensor affects its sensitivity - I used 330ohm, and have ~10 metres range from a 3V3 remote inside, 4-5 metres outside in sunlight. I would give you the script, but it's on my desktop. Let me know if you need it - or just use python, which is so popular nowadays (indent-or-fail... feh. what about people who don't like setting up the tab-space continuum, and don't have fancy editors...mumblemumble) Edit: my raw codes absolutely needed to be averaged out, or they were useless. Any negative values in the array can just be made positive, don't fret.

user400344
  • 348
  • 1
  • 10
0

I'm looking for a library to decode RAW IR signals from an IR sensor

AGirs includes a comprehensive library designed to work with raw IR signals. I've used GirsLite in an Arduino and IrScrutinzer in Windows to do advance IR protocol snooping.

BartmanEH
  • 230
  • 1
  • 11