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:

  1. 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.
  2. I am unsure of the protocol used by my camera. I have found it difficult to find documentation on the same.
  3. How can I replace the 9-Volt battery for something smaller?
  4. 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?
  5. For such a project, will I need additional hardware?
  • Welcome to Arduino.SE. :) If you're looking for general introductions and tutorials, then the official Arduino website is usually the best place to look at first. You're welcome to ask the more specific questions here, but please try to ask each one separately. It helps us keep the site better organised. Thanks! Commented Mar 4, 2014 at 1:58
  • Ah. Apologies. As you can see I'm quite new here. I shall take care in the future. I will try and clarify my question as it seems it's quite complicated to understand. Commented Mar 4, 2014 at 5:27

3 Answers 3

  1. Using the Arduino shouldn't be any different than any other microcontroller.
  2. The IRremote library is my go-to library for any IR related stuff.
  3. 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.
  4. 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:

  • Phew. That's a lot of information. Do you think I will need any additional hardware for the same? Commented Mar 4, 2014 at 5:44
  • additional hardware for what?
    – sachleen
    Commented Mar 4, 2014 at 7:07
  • In order to complete the remote i.e have a button which can signal the micro controller to control the LED into transmitting the correct bit pattern which is then detected by the camera at a distance of approximately 1-5 meters. Sorry for the ambiguity. Commented Mar 4, 2014 at 8:42
  • You could probably do without the Schmidt trigger but that should be enough.
    – sachleen
    Commented Mar 4, 2014 at 18:33

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()
  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.

  • Thank you for your answer. The receiver is in the camera. Hence the confusion. Unfortunately my friend is in India and I'm currently living in the US so coordinating for us is largely impossible. I asked him once and was able to procure materials and necessary documentation. I am writing this post for the both of us as he would like to improve his design as well which currently uses ATmega328 with 9 Volt battery. Commented Mar 4, 2014 at 5:40
  • Also, I have some experience with electronics but not a lot with Micro controller so I can build an IC and to some extent maybe design it too but I do need somewhere where I can start. Commented Mar 4, 2014 at 5:44
  • @AdityaSomani You should've mentioned that. That's really outside the scope of the question, and I don't know enough about your camera. Unless you can find some data online, you'll need to have an actual remote available to reverse engineer the signals. There's no universal camera shoot protocol. Commented Mar 4, 2014 at 21:30
  • Oh I see. I'll try and find a data sheet for the camera or talk to my friend about the same. Thanks. Sorry again for the confusion. Commented Mar 5, 2014 at 0:37
  • @AdityaSomani That's okay! Commented Mar 5, 2014 at 0:38

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.

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.