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

12
  • What difference does the sensor make? That is just a hardware issue. The incoming pulses will still be the same.
    – Nick Gammon
    Commented Oct 2, 2015 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
    Commented Oct 2, 2015 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
    Commented Oct 2, 2015 at 16:58
  • That's a whole different question. Better post a new question instead of adding this in the comments.
    – Gerben
    Commented Oct 2, 2015 at 17:32
  • 1
    Possible duplicate of A/C doesn't detect IR codes sent from Arduino
    – Nick Gammon
    Commented Oct 2, 2015 at 21:16

3 Answers 3

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.

1
  • OP said he doesn't have the 3 legged module but just a raw sensor (2 legs).
    – jeteon
    Commented Apr 16, 2019 at 8:23
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.