Connect Raspberry pi and arduino

Hello,

I want to control my arduino with my raspberry pi, and I know that there are a lot of options like firmata, i2c, ... But i want to use my arduino for two things: Switching an AC light, and controlling a tv. Controlling the AC light is no problem, but i'm not sure how to send infrared signals without programming it on the arduino itself.
I can perfectly connect my arduino and Rpi with firmata, but i'm not sure if i'm able to control a tv this way. Does anyone have a solution? Maybe a way that i can still program on the arduino itself.
Also my original idea was to use voice control, so if this would still be possible that would be awesome.

Thanks alot!

I'd use Configurable Firmata:

Then create plugins for the IR and voice control; you might have to use an Arduino with more memory, though. A Mega with SRAM expansion would probably work well.

Although - if you already have an idea on how to playback IR signals to control an LED, you could probably send the same to Firmata from the RPi - in this case, the RPi would be programmed with the patterns, and then it would send the patterns to Firmata to toggle the IR LED and such.

Voice control might also be possible without going to extremes - but that would depend on the module; if you have a smart enough module, that does the recognition, etc by itself, it will probably just toggle a set of GPIO pins, or send the data back to the Arduino via SPI or something - which could then be relayed back by Firmata (again - all in theory - you might still have to make a Firmata plugin and use CF).

Last possibility: Ditch the Arduino for this task - hook the IR module to the Raspberry Pi directly, and use the microphone input on the Pi for voice recognition (using some voice recognition library software).

Thanks for the response.

I will read the configurable firmata link more in depth, but maybe it would be easier to use one of the other options so I don't have to buy a new board. Unless I have no other option ofcourse!

To send the IR signals I used this method: Sending IR Codes | Using an Infrared Library on Arduino | Adafruit Learning System
It uses a libraby, and that's my problem, i don't know if that works with firmata and if so, how.
I have the same problem with only using the Raspberry Pi, controlling the AC light will be no problem. But can i send those IR signal with only the Pi and how?

No libraries do not work with Firmata.

Neither with configurable firmata?
Then my best bet would be to search another way for the IR control, because with only the RPi i can't use the libraries aswell i guess?

You can receive and send IR data from the Pi you know.

sudo apt.get install lirc

Oh really? I will look into that, thanks alot! Then i could just get rid of the arduino and use it for something else!

Look at the last video on this page to see a Pi sending out IR to a Lego EV3 system.
http://www.thebox.myzen.co.uk/Raspberry/Dummies_Projects.html

Hmm thanks alot, then it will work this way!