Introduction: Build a Transistor Circuit Board for Controlling Air Conditioner Remote Control With Arduino

I was supporting a group of student on their graduation project. One of the difficulties they faced was on controlling an A/C unit with Arduino microcontroller.

The first experiment we tried to work it out was by record the A/C remote control beam signal for each needed button by using the IRrecvDump code with IRremote library for Arduino ( Then, use these signals to send it to the A/C unit directly. The main problem we faced was on analyzing the ON/OFF signal code. The ON/OFF signal code curries more than one signal code. This includes switch signal + fan speed + thermostat degree. Some times this could include the conditioning mode, as well, such as Dray, Cool, Fan etc. Basically, this was unsuccessful method to work with all A/C remote controls.

The second experiment was by hacking the remote control by adding a sort of wires then attached to Arduino over a relay. Modern remote controls are quite sophisticated and not easy to hack. One mistake in soldering could cause fail of that remote. So, it was too risky to hack and modify the original A/C remote control. However, we did some soldering test on unused remote control until we succeed. Then we wire it up to a number of relay module to control it with Arduino. But relay is quite expensive so that we needed to do a cheap hack without spending much money. Also we want to use less wires to be attached to Arduino to get extra space to add more features.

After first and second experiments we come up with a successful way to control the A/C unit. In this experiment, we got rid of using relay also we didn't need to risk our original remote control. So that, we put our hand on a Universal A/C remote control. Then do some hack to that remote to control the A/C through Arduino interface. This will give us a chance to control different type of A/C. The one we hacked is capable to control 1000 A/C manufacturer type.

Step 1: Gathering Tools

First of all, you will need to prepare some tools. I'm using:
* Clamps and holders: this helps me to hold the circuit board while soldering.
* Soldering iron set.
* pliers (long & cutter).
* Scalpel blade: I use it to unseal the protective layer over the copper in the A/C remote control, to make it easy to solder a wire to it.
* Jumper wires: a suitable one to connected to Arduino board.
* resistors: I'm using 22K to protect the NPN transistor from overheating and/or damage.
* NPN transistors: any kind of NPN. Use the multimeter to figure out the E B C pins.
* Pins strip & its headers: those are goes to the base and remote control for the interaction.
* Multimeter: I use it for double check the wiring and for finding the NPN transistor pins.
* PCB board: I'm using stripboard type. It is easy to deal with, also, less soldering.
* Marker pen: It used to identify parts on circuit board.
* Drill set with its attachment: I use it for drilling hols into PCB boards. Also for cutting the back cover of the remote control for header pins.
* Drill holder (optional).
* Some screwdriver: for removing the remote control back cover. I'm using a plastic tool kit (that uses with mobile phones), it leaves no scratch on the remote body.
* Tape: I use it for holding the remote control LCD screen and protect it.
* A soft sponge tape: I use it to protect the back of the board base from any direct contact. Also for leveling remote on base.

Step 2: Open the Remote Control & Locate Buttons Line

This is a bit tricky step. First you have to use a screwdriver (screwdriver plastic) to open the remote control chest. Then, you will need to identify both lines for each button.

Some remote controls has a common line for all buttons (see this This is too easy to hack.
Mostly, modern remote controllers has complicated set of lines. Which could has a shared line that can be common and main (signal) sequentially with each other.

In this step, I identified each combined line with different colors.
From the picture, you will notice that each button has two different colors (e.g. to press on ON/OFF button we have to contact the Red & purple lines).

Also, because I'm using this remote with Arduino, I discard the use of the buttons on bottom, which they set the timing and manage the Air Conditioner to start or stop on a specified time. As this can be easily programmed with Arduino it self. These buttons are identified with color GRAY, which is the common line. So I didn't take it into account.

The final colors combination are PURPLE, RED, BROWN, GREEN, BLUE and YELLOW.

Next step, we will included the header pins to the A/C remote control board.


Step 3: Drilling & Soldering

In this step, you need to locate a perfect spot for adding the header pins. Also you have to notice where it should be go through the back cover of the remote control.

I located this spot because it is easy to reach most lines.

In addition, add some tape to the LCD screen to hold it and protect it while soldering and drilling.

* Use the marker pen to locate holes for the header pins.
* Double check that pins are goes fine every time you make a hole.
* Putting a tape shows how the header looks like before you carry on.
* After checking that it fit nicely, make sure there is nothing on the way that can be stuck from both side of the board.
* You have to use a scalpel to remove the layer over the copper in front of the selected pins.
* Start to bend some pins to make a direct contact with lines. Then apply some solder.
* In some case, you will need to use a tiny wire (like those on headphone cable) as bridge.
* For those away lines, try and drill hols next to selected pins and so for lines.
* Apply some glue to hold the header pins from move or broke.

Step 4: Finishing-up & Sealing the Remote Control

After finish from soldering, now it is time to grave a slot at the back cover of remote control.
You will need a small drill. I'm using my Dremel Cordless Rotary Tool.

* First, try to locate and mark where the header pins go trough. You have to be patient.
* When necessarily, remove any extra parts from the heard way.
* Try not to make oversize slot hole, otherwise, you may face some problems when placing on base.
* Have a look at the slot from the back to make sure everything is fine.
* Finally, place back both covers together.

Step 5: Designing the Remote Controller Baseboard

I'm quite weak with electronic circuit. Here I seeked for some help from my brother. He has more experience with circuit boards than me. Also, without doubt, YOUTUBE helps me a lot.

In this step, we needed to design a cheap & easy to build circuit board that deal with A/C remote control as a fixed base.
After googling & doing some search, we barely found a perfect way to control the an A/C unit. Most projects shows how to hack a remote control and leave it open. Which it cannot be used as normal handheld remote control as before. In addition, many projects uses a relay module to short the buttons circuit. This could be quite expensive and/or ended with an ugly look and nosy.

However, all what we need is a small and easy to build circuit. Which can be able to open and close the circuit to make the short connection. So we are using an NPN transistor to do this.

For some information & tutorials about NPN and differences between NPN & PNP transistors, have a look at this video:

* You need to identify the E, B and C pins of that NPN. I used the multimeter to do so. (Sorry, I didn't explain this here. You can youtube it)
* B goes to resistor (10K& - 22K&) then to Arduino digital pin.
* E is the common pin between all NPN transistors. This will go to Arduino GND pin.
* C connected directly to each pin on the A/C remote control lines.


Next step shows how to build the base for A/C remote control that connected to Arduino board.

Step 6: Building the Baseboard

It is so obvious here that PCB stripboard helped me a lot. I didn't need to do much soldering. Also, it looks more organized in a perfect way.

Based on the previous step, I built the baseboard by soldering the NPN and resistors. Also, I add the wires which connected to Arduino digital pins.
Now it is time to locate the perfect place where the remote control placed on baseboard.
* Add the pins strip to the remote back heard.
* Place it in the center of the base.
* Make sure to keep away from the NPN & resistors.
* Mark it if necessarily.
* Make notches to separate some copper on the PCB stripboard.
* Apply soldering.
* Add wires, then solder it as well.

Step 7: Programming & Coding

Now here come the time to program it. You can use the BLINK sketch on the Arduino example code as a start.

- First of all, in setup function, you need to initialize the digital pins as an output. Also make sure all pins are set to "LOW". This will prevent from pressing on any key by mistake when Arduino star-up.

void setup() {               
  // initialize the digital pins as an output.

 pinMode(2, OUTPUT);      // PURPLE
  pinMode(3, OUTPUT);      // RED
  pinMode(4, OUTPUT);      // BROWN
  pinMode(5, OUTPUT);      // GREEN
  pinMode(6, OUTPUT);      // BLUE
  pinMode(7, OUTPUT);      // YELLOW

  digitalWrite(2, LOW);    // set the pin to OFF
  digitalWrite(3, LOW);    // set the pin to OFF
  digitalWrite(4, LOW);    // set the pin to OFF
  digitalWrite(5, LOW);    // set the pin to OFF
  digitalWrite(6, LOW);    // set the pin to OFF
  digitalWrite(7, LOW);    // set the pin to OFF

- To switch ON the A/C unit, first, identify the button color then pin number. After that, add this code to loop function. From the picture above, notice the ON/OFF pins on arduino are D3 (RED) and D6 (BLUE). Those pins should set to "HIGH" for 10ms then to "LOW".

void loop() {
  digitalWrite(3, HIGH);   // press button
  digitalWrite(6, HIGH);
  delay(10);              // wait for a response to take effect
  digitalWrite(3, LOW);    // release button
  digitalWrite(6, LOW);

  while(1 == 1) {          // to prevent loop on Arduino


- I added the while condition to stop Arduino from pressing on key constantly.

- If you want to set the A/C temperiture 3 degres up, then you will need to add for loop. But first, identify which pins control that button. In this case they are D4 (BROWN) and D5 (GREEN).

for(int i = 0; i < 3; i++) {
    digitalWrite(4, HIGH);   // press button
    digitalWrite(5, HIGH);
    delay(10);               // wait for a response to take effect
    digitalWrite(4, LOW);    // release button
    digitalWrite(5, LOW);
    delay(1000);           // wait one second between each press

- I added anther delay within one second to simulate the real press on remote keys by hand. This will leave a brake time until the A/C unit response to the previous signal.


Additional notes:
* Make sure all the pins on Arduino set to "LOW" when it is not needed.
* Arduino has a continuance loop function which will not stop or terminate until you force it to.
* A Universal Air Conditioner remote control has a hundreds number of codes to deal with different units. Make sure you set it to your own unit before use it with Arduino.
* You can put a label on the back of your A/C remote control to identify each pin with Arduino pins.
* Using the baseboard makes the remote control easy to carry when its no need to place it on its base.
* Beside the prices of Arduino, wires and PCB board, the A/C Universal Remote Control cost is about 12$. The total cost, including all stuff, is around 65$.

Future work:
This is not a complete project. It has some issues. E.g. when the Arduino set A/C unit to a specific configuration then someone takes off the remote from its base and reset it to a different configuration. In this case, Arduino has no idea what new configuration it has been set.
As a solution, we can add Arduino Mini to the remote control ( This will record any new configuration that has been set in time the remote control is not on its base.
Also, there can be added a wireless Xbee module, so that, we can get rid of the baseboard. So with any key pressed, it will send the new configuration to the main Arduino interface.

I hope this could help you in your projects.
Please leave a comments if there is any
incomprehensible step.



alexon2001 made it!(author)2015-07-08

Hello again,

What I did
was to go back to a simpler circuit with and NPN switch (“Electronics - Using
an NPN Transistor as a Switch” in Youtube). Once I got that working, I
incorporated the A/C circuit. I also added a LED (not necessary) to see when
the A/C was turned on or off.

You can see
the result in the pictures (IGNORE ALL THE LITTLE RED CABLES – they are there
to hold the minibreadboard in place :-D).

PIN 2: goes
to a 2K resistor (you used 22K resistors in your circuit but most people
recommend 1K (aprox) resistors for this kind of NPN transistors), which goes to
the middle pin on the NPN transistor (base). The emitter pin is connected to
ground. The collector pin is connected to the A/C, to close the circuit and
activate the ON/OFF button (it’s the white cable that goes out of the picture –
the other white cable goes to ground).

PIN 3 (not
necessary): goes to a 330 Ohm resistor, which goes to the LED’s anode. The catode
goes to ground (pretty standard).

The code is
quite similar to the one you wrote, but simpler (only ON/OFF, no changing of
parameters such as temperature or fan):

void setup() {

// initialize the digital pins as an output.

OUTPUT);// AC circuit

pinMode(3, OUTPUT);// LED

digitalWrite(2, LOW);//
set the pin to OFF

digitalWrite(3, LOW);//
set the pin to OFF


void loop() {


digitalWrite(2, HIGH); //
Press ON/OFF switch

digitalWrite(3, HIGH); //
Turn LED on

delay(300); // wait 300 milliseconds

digitalWrite(2, LOW); //
release A/C button

delay (2500) // Wait 2,5 seconds

digitalWrite(3, LOW); // Turn LED off

for (int x = 1;x<15;x++){

delay (60000) // Wait 1 minute (x 15 times)



digitalWrite(2, HIGH); //
Press ON/OFF switch

digitalWrite(3, HIGH); //
Turn LED on

delay(300); // wait 300 milliseconds

digitalWrite(2, LOW); //
release A/C button

delay (2500) // Wait 2,5 seconds

digitalWrite(3, LOW); // Turn LED off

for (int x = 1;x<30;x++){

delay (60000) // Wait 1 minute (x 30 times)



Arduino AC Circuit 01 SM.jpgArduino AC Circuit 05 SM.jpg
alexon2001 made it!(author)2015-06-23

[Jun 2015 - don't know if anyone is still
reading the comments :-)]

Hello Snakebite, thanks a lot for
this great project. I'm trying to do the *exact* same thing with my A/C remote
and my Arduino One, but I can't get it to turn activate the ON/OFF switch.

I've followed the
instructions to the letter (except, in my case there are only 2 lines, the
minimum needed to activate the ON/OFF button), but setting the two Arduino digital
outputs to HIGH doesn’t seem to do anything. I guess I don’t really see how
sending a pulse to the corresponding NPN transistors is the same as closing the
circuit of the on/off button (I’m dense that way).

I’ll give it another look, because clearly it should work (as per your video).

snakebite_82 made it!(author)2015-06-30

Hello Alex,

I apologize for not making updates to my project, that due to my work.

First of all, I appreciate your comment.

Just to mention, your project does not have to look exactly the same as mine. Be carful when dealing with NPN transistors because they are different.

Based on my experience I guess the NPN transistor you are using have a different poles. I would suggest to refer to this link and check which type of transistor you have:

You have to identify each pole (Collector, Base and Emitter), then get back to the 2nd diagram at Step5 to understand where each of these poles connected to.

This is an extra tutorial link that may help you identify the NPN transistor poles:

If you still have difficulties, please send me a picture of your project so I can check your connections.


jsoriano7 made it!(author)2014-02-14

Is it also appplicable in a different micro controller? Because I am using Arduino Micro instead of the one that you use in this project.

snakebite_82 made it!(author)2014-02-14

Thanks for your comment.

The answer is YES, you can use it with any kind of microcontroller, unless you can be able to set its pins into HIGH and LOW values.

jsoriano7 made it!(author)2014-02-15

i got confused with the diagram @step 5 and the output of PCB board (back) @step 6. why does the resistor and npn transistor look like that.

snakebite_82 made it!(author)2014-02-15

well, I'm quite not sure which part makes you confused.

  • If you mean why we have resisters connected with transistors, then I as I said that I'm not an expert in electronic circuits. So my brother advised me to use a resistors attached to the transistors because transistors could get so hot and might burn up.
  • If you mean the different number of transistors between both the digram and the real board, then I will say that the digram is just to show how the connection goes. As I said in step 5 that you can add more transistors and resistors as suitable for your project.

You have to know that the digram in step 5 is just an EASY example of how to wire everything together along with the microcontroller, and that does not typically represent the real output PCB board in step 6.

OmerS made it!(author)2013-12-08

I'm a beginner and i'm trying to do something similar with n3904 npn transistors.
I was wondering if you don't have to saturate the base, to prevent noise?
When i turn-off the arduino pin that controls the base, it still letting a little bit of current to flow and that affects the transistor.


snakebite_82 made it!(author)2013-12-16

Thanks for your comment.
Well, I don't think I face the same issue as yours. But I'm guessing there could be a contactless somewhere in your circuit.
I apologise that I'm not an expert in electronics, but I usually find my way through google. Also, I don't have this project anymore, because I gave it away to my students that time.

I would suggest that you upload a pic of your schematic/circuit so that someone could provide a solution. That would help you, me and anybody need to build a similar project.

Thanks =)

Build_it_Bob made it!(author)2013-04-25

Very nice project ...I look forward to see if you do a control with the xbee also.

ehassan made it!(author)2013-01-20

thank you soooo much for this :)

Lectric+Wizard made it!(author)2012-05-18

after rereading I noticed you say it correctly in step 5 , just need to fix the diagram.Cheers!

snakebite_82 made it!(author)2012-05-18


I guess I managed to figure out the problem. I updated the diagram now.

I appreciate you comment. Please feel free to comment on any issue(s) in my steps (as this is my first post where there should be a mistakes).

Thanks again!

Lectric+Wizard made it!(author)2012-05-18

Are you using the Arduino to "push" the buttons on the remote control & in turn control the a/c unit ? If so I think your schematic is wrong. The Arduino should be connected to the base of the transistors not the collector as you show. The collector should go to the R/C control line, usless I'm missing something here ...

About This Instructable




Bio: I'm a Computer Science and IT teacher. I teach a university students how to be a professional programmers and to deal with new technologies ... More »
More by snakebite_82:Adil Controller, Arduino based wireless controllerBuild a transistor circuit board for controlling Air Conditioner remote control with Arduino
Add instructable to: