user358: I wish to build a remote for my Camera i.e Sony NEX 5R. It has a built in IR receiver and has several Sony as well as aftermarket remotes provided for it. Due to my interest in Micro controller design I wish to build one myself rather than use an aftermarket one.
A friend who did the same for his NEX 5 series camera posted a video of the same on Facebook, which inspired me to build my own. I plan to use an Arduino Uno R3 with the following additional components:

IR LED
NPN Transistor(for amplification)
Schmidt Triggers(for rectification)
9 Volt Battery

Ultimately I would like to swap out the Arduino for a standalone ATmega328 or ATtiny2313 but currently I have some issues as of now:

I currently do not have a schematic or a sample code which I can use. I have been trying to search the internet for the same but to no avail.
I am unsure of the protocol used by my camera. I have found it difficult to find documentation on the same.
How can I replace the 9-Volt battery for something smaller?
I would like to use a smaller micro controller but what differences will I encounter when trying to change my code for the smaller micro controller?
For such a project, will I need additional hardware?


user220: 1.) I'm not exactly sure what you mean by this. What I'd recommend is a ATMega328 for the heart of the chip. It's what is in the Uno, so with a exception of uploading code, for this project this will cut down on the size of your project. However, an Uno will work pretty much identical. If you do want to use a chip like this, this design looks pretty complete. You'll probably want to move to a PCB for your final product, but since you have a little electronic experience, I assume you can solder and know about this. Here is another tutorial for barebones.
2.) Again, what do you mean by "standard?" Like protocol? If so, there's no real protocol to use. This may be easy for a begginer. It's the remote and the receiver. If you want to go all geek you can also hack an existing TV remote to do the same task. That library should take care of everything you need (see code later).

A bit of code/wiring:
The circuit will depend on what receiver you choose. Most IR receivers have one pin for 5v, one for GND, and the last one is connected to a digital pin. Again, look at the information on the specific receiver you choose.
Some sample code with the library I listed:
#include <IRremote.h>

int RECV_PIN = 11;        //Using pin 11 for the signal pin
IRrecv irrecv(RECV_PIN);  //Creates a variable that will be used later to inference between library and code
decode_results results;   //Use it to store the value of the keycode

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}

You'll have to run this sketch to determine the value of the button you'll use on the remote. It should print on the serial window some sort of hexadecimal value IIRC that you'll have to convert into decimal if you want to use it inside the code to compare that to the button you want to use on the remote. The post I mentioned is a great resource: go and look at it.

3.) I don't recommend building a remote. Like I said, you can use existing TV remotes or buy one for this purpose. Start small, figure out how IR remotes work, and then build one later if you desire. A v2 is often required on Arduino.
4.) Don't bother for the receiver. It can be bigger. If you don't know how to to program it, this guide is a good reference. It has some files that you download to add it in the IDE to trick the IDE to think the chip is a board. Note: You'll have to program it with an Uno or similar to upload and to burn the firmware. (I would explain it more in case the site goes down, but you need the files there so it'll be pointless anyway.)
Also a quick tip: don't be afraid to ask your friend for some help. You don't need to rely on him, but if you get stuck ask him.
I don't know how to connect the Arduino to the camera, but you seem to know how to do that.

user379: Well, for your project you can simply buy/rebuild a TV-B-Gone made by Mitch, which he uses as a basic project to teach soldering all over the world.
You can "hack" the TV-B-Gone by adding a TSOP4838 that can work as an IR receiver (or use another device as a code recorder).

And as you can see here the TV B Gone features an ATTiny85. A really small and nice beast.
Here you'll find the source code for the TV B Gone. I'm not sure what format they use for their code database though.

user11: 
Using the Arduino shouldn't be any different than any other microcontroller.
The IRremote library is my go-to library for any IR related stuff.
Power shouldn't be an issue, look at the Moteino from LowPowerLab and check out his coin cell battery tests. It's definitely possible. Not with a full blown Uno, but with a bare chip, yes.
You want to burn the bootloader on the IC first, before you can start writing Arduino code. Check out this tutorial: From Arduino to a Microcontroller on a Breadboard. It's the same process for an ATTiny, you just have to look at the datasheet to see where to plug things into. Specifically, MOSI, MISO, SCK, and Reset pins. The Tiny AVR Programmer is also a good choice. It's meant for the 8 pin micros but it has an ISP header so you can use it for almost any chip.

This may be useful for more information about decoding IR signals:

EEVblog #505 - IR Learning Remote Control Hack
EEVblog #506 - IR Remote Control Arduino Protocol Tutorial


358: <p>I wish to build a remote for my Camera i.e Sony NEX 5R. It has a built in IR receiver and has several Sony as well as aftermarket remotes provided for it. Due to my interest in Micro controller design I wish to build one myself rather than use an aftermarket one.</p>

<p>A friend who did the same for his NEX 5 series camera posted a video of the same on Facebook, which inspired me to build my own. I plan to use an Arduino Uno R3 with the following additional components:</p>

<ul>
<li><p>IR LED</p></li>
<li><p>NPN Transistor(for amplification)</p></li>
<li>Schmidt Triggers(for rectification)</li>
<li>9 Volt Battery</li>
</ul>

<p>Ultimately I would like to swap out the Arduino for a standalone ATmega328 or ATtiny2313 but currently I have some issues as of now:</p>

<ol>
<li>I currently do not have a schematic or a sample code which I can use. I have been trying to search the internet for the same but to no avail.</li>
<li>I am unsure of the protocol used by my camera. I have found it difficult to find documentation on the same.</li>
<li>How can I replace the 9-Volt battery for something smaller?</li>
<li>I would like to use a smaller micro controller but what differences will I encounter when trying to change my code for the smaller micro controller?</li>
<li>For such a project, will I need additional hardware?</li>
</ol>
 220: <p>1.) I'm not exactly sure what you mean by this. What I'd recommend is a <a href="https://www.sparkfun.com/products/9061" rel="nofollow">ATMega328</a> for the heart of the chip. It's what is in the Uno, so with a exception of uploading code, for this project this will cut down on the size of your project. However, an Uno will work pretty much identical. If you do want to use a chip like this, <a href="http://fritzing.org/projects/barebones-arduino" rel="nofollow">this design</a> looks pretty complete. You'll probably want to move to a PCB for your final product, but since you have a little electronic experience, I assume you can solder and know about this. <a href="http://playground.arduino.cc/Learning/AtmegaStandalone" rel="nofollow">Here is another tutorial for barebones</a>.</p>

<p>2.) Again, what do you mean by "standard?" Like protocol? If so, there's no real protocol to use. <a href="http://www.robotmesh.com/ir-kit-for-arduino?gclid=CM650djc97wCFexcMgodK0kAjQ" rel="nofollow">This may be easy for a begginer</a>. It's the remote and the receiver. If you want to go all geek you can also <a href="http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html" rel="nofollow">hack an existing TV remote to do the same task</a>. That library should take care of everything you need (see code later).</p>

<hr>

<p><strong>A bit of code/wiring:</strong></p>

<p>The circuit will depend on what receiver you choose. Most IR receivers have one pin for 5v, one for GND, and the last one is connected to a digital pin. Again, look at the information on the specific receiver you choose.</p>

<p>Some sample code with the library I listed:</p>

<pre><code>#include &lt;IRremote.h&gt;

int RECV_PIN = 11;        //Using pin 11 for the signal pin
IRrecv irrecv(RECV_PIN);  //Creates a variable that will be used later to inference between library and code
decode_results results;   //Use it to store the value of the keycode

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&amp;results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}
</code></pre>

<p>You'll have to run this sketch to determine the value of the button you'll use on the remote. It should print on the serial window some sort of hexadecimal value IIRC that you'll have to convert into decimal if you want to use it inside the code to compare that to the button you want to use on the remote. The post I mentioned is a great resource: go and look at it.</p>

<hr>

<p>3.) I don't recommend building a remote. Like I said, you can use existing TV remotes or buy one for this purpose. Start small, figure out how IR remotes work, and then build one later if you desire. A v2 is often required on Arduino.</p>

<p>4.) Don't bother for the receiver. It <em>can</em> be bigger. If you don't know how to to program it, <a href="http://highlowtech.org/?p=1695" rel="nofollow">this guide is a good reference</a>. It has some files that you download to add it in the IDE to trick the IDE to think the chip is a board. Note: You'll have to program it with an Uno or similar to upload and to burn the firmware. (I would explain it more in case the site goes down, but you need the files there so it'll be pointless anyway.)</p>

<p>Also a quick tip: don't be afraid to ask your friend for some help. You don't need to rely on him, but if you get stuck ask him.</p>

<p>I don't know how to connect the Arduino to the camera, but you seem to know how to do that.</p>
 379: <p>Well, for your project you can simply buy/rebuild a TV-B-Gone <a href="https://cornfieldelectronics.com/tvbgone/buy.tvbgkit.php?PHPSESSID=3phhip32unp1ku0di8qe9e6od0" rel="nofollow noreferrer">made by Mitch</a>, which he uses as a basic project to teach soldering all over the world.</p>

<p>You can "hack" the TV-B-Gone by adding a <a href="http://www.vishay.com/docs/82459/tsop48.pdf" rel="nofollow noreferrer">TSOP4838</a> that can work as an IR receiver (or use another device as a code recorder).</p>

<p><img src="https://i.stack.imgur.com/LezO4.png" alt="TV-B-Gone"></p>

<p>And as you can see here the TV B Gone features an ATTiny85. A really small and nice beast.</p>

<p>Here you'll find the <a href="https://github.com/adafruit/TV-B-Gone-kit/tree/master/firmware" rel="nofollow noreferrer">source code</a> for the TV B Gone. I'm not sure what format they use for their code database though.</p>
 11: <ol>
<li>Using the Arduino shouldn't be any different than any other microcontroller.</li>
<li>The <a href="https://github.com/shirriff/Arduino-IRremote">IRremote library</a> is my go-to library for any IR related stuff.</li>
<li>Power shouldn't be an issue, look at the <a href="http://lowpowerlab.com/moteino/">Moteino from LowPowerLab</a> and check out his <a href="http://lowpowerlab.com/blog/2012/12/24/moteino-coin-cell-battery-tests/">coin cell battery tests</a>. It's definitely possible. Not with a full blown Uno, but with a bare chip, yes.</li>
<li>You want to burn the bootloader on the IC first, before you can start writing Arduino code. Check out this tutorial: <a href="http://arduino.cc/en/Tutorial/ArduinoToBreadboard">From Arduino to a Microcontroller on a Breadboard</a>. It's the same process for an ATTiny, you just have to look at the datasheet to see where to plug things into. Specifically, MOSI, MISO, SCK, and Reset pins. The <a href="https://www.sparkfun.com/products/11801">Tiny AVR Programmer</a> is also a good choice. It's meant for the 8 pin micros but it has an ISP header so you can use it for almost any chip.</li>
</ol>

<p>This may be useful for more information about decoding IR signals:</p>

<ul>
<li><a href="https://www.youtube.com/watch?v=vOzaDQmAW0g">EEVblog #505 - IR Learning Remote Control Hack</a></li>
<li><a href="https://www.youtube.com/watch?v=BUvFGTxZBG8&amp;feature=youtu.be">EEVblog #506 - IR Remote Control Arduino Protocol Tutorial</a></li>
</ul>
