robforrest
Posts: 5
Joined: Wed Dec 28, 2011 6:21 pm

Re: Spoofing an IR receiver to connect to an amp

Wed Dec 28, 2011 6:34 pm

Hi All,

I'm getting really excited about this whole R-Pi thing, its looking great so far.

My first project is going to be using the R-Pi as a media server.  Its going to sit just behind my amp, connect via HDMI, run a small web server that will serve as a front end to m-player.

I'm pretty confident that I can get all this running but I was wondering if I could use a GPIO to control the amp. My amp has got a plug on the back to accept an external IR receiver and I guess I could just bit bang the IR codes across.

My questions are,

1/ Has anyone got any experience doing this?

2/ Is there anything pre-built out there which would avoid or simplify the sending of an instruction?

3/ and does anyone know how/where I can find a wiring diagram for what I can only presume is a 3.5mm jack.

For reference, my amp is this http://www.amazon.co.uk/Onkyo-.....01VEI290 

Thanks muchly

Rob

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Spoofing an IR receiver to connect to an amp

Wed Dec 28, 2011 8:18 pm

Sending IR out is trivial. Receiving is much more difficult. (I looked into this as we had a customer request for the BCM2835 about that four week ago).

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Spoofing an IR receiver to connect to an amp

Wed Dec 28, 2011 9:09 pm

That responses makes me feel that it is not as easy as slapping a cheap-o usb receiver and somehow telling the computer to wait for a specific ASII input from that usb port
Dear forum: Play nice ;-)

robforrest
Posts: 5
Joined: Wed Dec 28, 2011 6:21 pm

Re: Spoofing an IR receiver to connect to an amp

Thu Dec 29, 2011 7:59 am

That's fine, I'm not interested in receiving IR signals at all.

The main purpose of this is to be able to control the amp via the same web interface as the media server, for instance being able to turn the volume up.  For this, all I would ever have to do is send IR.

When you say that it's trivial, am I then right in thinking that I can just bit bang it, or is there something more going on than that?

Thanks again,

Rob

bsmulders
Posts: 18
Joined: Wed Nov 23, 2011 6:13 pm

Re: Spoofing an IR receiver to connect to an amp

Thu Dec 29, 2011 8:48 am

I have some experience with a PIC16F using a TSOP1736 (peaks at 36kHz) for receiving and a simple IR led for sending.

Sending was easy, just bitbang the RC5 protocol (http://en.wikipedia.org/wiki/RC-5) to the GPIO port the LED is connected to. It's not that hard if you are used to reading time schematics. I do think that using Linux might be tricky because you don't have any time guaranties.

Receiving is a bit tricky. You can either use timing, which again, is hard on a general purpose OS like Linux. You can also wait on the next bit-flip. After receiving all the bits you can use the RC5 protocol to decode the message.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Spoofing an IR receiver to connect to an amp

Thu Dec 29, 2011 1:36 pm

I have tough about doing it using an SPI output. I did not try it but I think it can be done. Most SPI interfaces support 32 bits. To transmit 10 IR bits you take 30 bits and divide them up in 3-bit sequences. So you set the SPI clock to triple the baud rate. Then you set one? two? bits high of the three bits to emulate a high IR pulse. The main advantage is that signal rate is set by the SPI clock speed and independent of you OS accuracy or response time. Anybody with a PIC could try it out. I don't have the time but would like to know if it works.

robforrest
Posts: 5
Joined: Wed Dec 28, 2011 6:21 pm

Re: Spoofing an IR receiver to connect to an amp

Thu Dec 29, 2011 2:35 pm

@bsmulders Thanks for that, that was the exact response I was looking for, a whole load of information there.

@Gert, I'm not sure that would work. If I understand that previous link correctly then IR signals are Manchester encoded meaning that even if 3 consecutive bits are set to high then the output would involve several periods of high and low and would probably end up confusing things. I think I'm just going to have to do a bit of trial and error with the timing of it all.  Just got to wait until the R-Pi is ready to buy...

bsmulders
Posts: 18
Joined: Wed Nov 23, 2011 6:13 pm

Re: Spoofing an IR receiver to connect to an amp

Thu Dec 29, 2011 3:21 pm

Using the SPI output could be a good one.

A slight setback might be the fact that RC5 doesn't really send one bit but a burst of 32 cycli at 36kHz instead.

You can check some sample code on the following link: http://www.voti.nl/DB038/ (DB038 manual, A4, 1-on-1, page 60 through 64). The 'rc5_bit_send' method demonstrates how to send a burst.

Small detail: Some remotes work at 36kHz, some at 38kHz, some even using different protocols. Try to find out what type your device is using.

Return to “Other projects”