Introduction: $3.50 DIY TV-B-Gone Micro

Picture of $3.50 DIY TV-B-Gone Micro

I previously made a slideshow on my DIY TV-B-Gone, and many people requested I make an Instructable. So, the first in a series of DIY TV-B-Gone clones, is the TV-B-Gone Micro!

Technically, because TV-B-Gone is a brand name, this is a "TV-B-Gone clone."

The TV-B-Gone is a neat little device that can turn almost any TV on or off. It uses a microcontroller hooked up to IR LEDs to output a library of on/off codes. Adafruit sells a kit, and has the code as well as the schematic on their website.

Here's a micro clone of the TV-B-Gone that runs on a coin cell battery, is slightly bigger than a quarter, and costs about $3.50 (compared to $20) to make!

Step 1: Materials and Tools

Picture of Materials and Tools
Here is a list of what you will need.

Materials: All of these prices are if you buy only one of each part. If you buy in bulk, like I did, it will actually have a cheaper unit price. For me the total was less than $3.50, for you maybe more if you only buy one of each part.

You will also need some 2032 batteries to power it. DON'T FORGET!

  • AVR programmer (I used a USBtinyISP, a good, cheap programmer made from a kit)
  • Computer with internet access; I predict you are using one right now :-)
  • Soldering iron with solder
  • Helping hands tools, very helpful
Now let's get started!

Step 2: To Use an Oscillator or Not...

The first thing you need to do is decide whether to use to use an oscillator. Here is the info to let you make your choice:

Advantages of and Oscillator:
  • It is much more accurate and doesn't vary near as much as the internal oscillator. This can make the difference between it working and not.
  • It adds about 50 cents extra cost.
  • It takes up more space.
  • It adds slightly more complexity.
I highly recommend you use one, but it is not required. I'll include instructions for both ways.

Step 3: Prep for Programming

Picture of Prep for Programming

If you have a programming board, you can skip this step. If you are using a USBtinyISP or similar, use a breadboard to wire the chip to the proper connections of the programmer. More instructions on how to do this can be found here. The pinout for the chip can be found on the datasheet here.

Step 4: Program the Chip Part 1: Fuses

Picture of Program the Chip Part 1: Fuses

"Fuses" are a very small part of the microcontroller's memory that tell it how to operate, such as which oscillator to use, enabling the reset pin, and so on. Will will need to change the fuses to run off of an external oscillator. I used, which is a free AVR fuse calculator. I included images of this, but you don't need to use the calculator because I listed the commands here.

I use AVRdude to interface between the programmer and my computer. A tutorial on how to use AVRdude can be found here.

If you are using an oscillator, use

Avrdude -c usbtiny -p attiny85 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

If you are not, use

Avrdude -c usbtiny -p attiny85 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

Proceed to the next step for programming the real code!

Step 5: Program the Chip Part 2: Code

Picture of Program the Chip Part 2: Code

The first thing you will want to do is connect the oscillator on the breadboard. Because it is now set to run with one, it has to have one to be programmed with one.

Download the firmware v1.1 from at This is for their kit, but I used it to program this and it worked. Unzip the folder and find the tvbgone.hex file. Copy this and put in C:\users\username where AVRdude can find it. Now, in AVRdude, type

avrdude -c usbtiny -p attiny85 -U flash:w:tvbgone.hex

and wait for it to put the code on the chip. Now let's get building!

Step 6: Begin Construction!

Picture of Begin Construction!

Bend pins 1 and 8 around so that they nearly touch, and solder them together. These are Vcc and RESET, which will both be connected to the button.

Step 7: Add the Button

Picture of Add the Button

Cut off two of the four leads of the button, making sure you get two that are pointing to the same side. Flip the chip upside-down and solder one lead of the button to pin 8 as shown in the picture.

When the button is pressed, it will give the chip power. When the button is un-pressed, the chip gets no power and will turn off.

Step 8: Add the Resistor

Picture of Add the Resistor

Bend pins 5 and 6 together, and solder them. Cut one lead of the 150 ohm resistor very short, and solder that end to pins 5 and 6, with the body of the resistor facing down the chip as shown.

The resistor limits the amount of current that the microcontroller can give to the transistor. Pins 5 and 6 are the outputs, and bending them together doubles the amount of current they can source to 20 ma. This is probably not needed, but is used as a precaution.

Step 9: Add the Transistor

Picture of Add the Transistor

Bend the outer two legs of the transistor outward, and cut the center (the base) short, as shown. Also cut the lead from the resistor short, too. Orient the transistor as shown in the picture (flat side up) and solder the base to the lead from the resistor.

The transistor allows the microcontroller, which can source only 10 ma per pin, to drive these LEDs, which can draw up to 100 ma. When a current goes through the base, it allows power to flow through the LEDs (at the collector) to ground (the emitter) in this circuit.

Step 10: Start the Ground Bus

Picture of Start the Ground Bus

Bend the emitter (left lead) of the transistor at a right angle as show, and solder it to pin 4, the gnd of the microcontroller.This will be connected to ground of the battery later.

Step 11: Add the Resonator

Picture of Add the Resonator

If you decided not to use a resonator when you were programming, you can skip this step and leave pins 2 and 3 unconnected.

Bend the outer two pins of the resonator inward, and the inner pin upwards. Solder the the outer two to pins 2 and 3 of the microcontroller. Bend the leftover emitter lead from the transistor over, and solder it to the middle pin of the resonator to connect it to ground.

Step 12: Solder the LEDs Together

Picture of Solder the LEDs Together

Set the two LEDs next to each other, with the blue one on the left and the flat sides facing up. Bend the top lead of the the clear one to the left, and the bottom lead of the blue one to the right. Solder them in parallel, and cut the excess as shown.

From now on, most of the pictures will be wrong. I did it a different way, then experimented and found that this one was better. Pretend the LEDs in the rest of the pictures are like this, sorry for the inconvenience!

Step 13: Add the LEDs

Picture of Add the LEDs

Solder the negative lead of your LEDs to the collector of the transistor, and leave the positive pointing down the side as shown.

Step 14: Add the Capacitor

Picture of Add the Capacitor

Bend the positive of the capacitor out and along the side of the capacitor, and cut it short. Bend the negative out for about 2mm and then bend it straight up. Fit the capacitor in and solder the positive of the capacitor to the positive of the LEDs as shown.

The capacitor filters the power from the battery to provide a smooth voltage for the microcontroller even with the LEDs flashing really fast.

Step 15: Form More Connections

Picture of Form More Connections

Bend the negative of the capacitor over and solder it to pin 4 of the microcontroller. This connects it to the ground of the circuit.

Step 16: Form More Connections Part 2

Picture of Form More Connections Part 2

Bend the positive wire from the LEDs around the capacitor as shown. Take an extra length of lead from something you cut off earlier, and solder it into place so that it connects the positive of the LEDs to the unused lead of the button. This connects the LEDs to the positive of the battery.

Step 17: Add the Battery Holder

Picture of Add the Battery Holder

Fit the battery holder under the circuit as shown; it should line up perfectly. Solder the positive and the negative as shown in the picture.

The positive goes to the far end of the button, giving power to the LEDs and, when pressed, the microcontroller.

The negative goes to the negative of the capacitor, grounding what needs to be grounded.

Step 18: Optional: Add an Indicator LED

Picture of Optional: Add an Indicator LED

Unless you hold up a camera to the front, there is no indication that it is going. Here's a modification to add a visible light LED that blinks between each code to show what it's doing.

3mm LED - $0.06
Another 150 ohm resistor - $0.05

First, take your LED and bend the positive lead (not on the flat side) straight out. Keep the negative lead (with a flat side) pointing the same direction and cut it so that it's about 3mm long. Solder this to pin 7 of the microcontroller, with the positive lead facing toward the switch.

(look at picture 2)

Next, cut the positive lead very short. Cut one lead of the resistor very short also, and solder the two together. Bend the other lead of the resistor around to the positive battery terminal, cut it, and solder it into place.

(pictures 3 and 4)

Now when you press the button, the LED will blink between each code. It will also blink 4 times quickly when all the codes have been sent.

Step 19: Add a Battery and Have Fun!

Picture of Add a Battery and Have Fun!

Slip in a 2032 coin cell battery, and have fun blasting TVs with a small, compact, and DIY device! Because the wires are exposed, be careful not to let anything conductive short out the connections. A good way to protect the circuit would be to infuse and cover the circuit with hot glue or sugru.

Note: I am not responsible for what you do with this, act at your own risk.

If you make one, please send me pictures!

Don't forget to rate and leave comments, I like comments :-)

Step 20: Update: Using a V1.2 Preprogrammed Chip

Picture of Update: Using a V1.2 Preprogrammed Chip

Due to the requests for preprogrammed chips, I made a modification to the design so that you can use Ladayada's preprogrammed chips with v1.2 firmware. It requires a PNP transistor instead of a NPN, and the way every thing is hooked up is different. I have not tested it, but it should work.

Buy the preprogrammed chip here for $5:

The circuit layout will be slightly different than the one for the Instructable.


elusebate (author)2016-01-10

hi great tutorial,but i dont know where did i go wrong.
i build both to breadboard (with resenator and without (versio 1.1))
but nothing happens. no blink no nothing.

is this because i used Attiny85-20pu instead Attiny85v-10pu


hinkey (author)elusebate2016-01-26

It seems Attiny85-20pu clock speed is faster than the Attiny85v-10pu and uses slightly more power 2.7 - 5.5 volts which therefor it should work and flash it through an arduino @ 16mhz. (Attiny85v-10pu = 8mhz & 1.8 - 5.5 volts)

hnrchrdl (author)hinkey2017-10-26

I want to build it with a Attiny85-20pu, too, because the 10PU is not available . Can I use the exact same components, like the 8mhz resonator, the same capacitor, etc? Thanks.

etorres v (author)2017-03-08

Hey, i don't have resonator of 8Mhz. i can put a of 4Mhz?

rccarz5. (author)etorres v2017-08-25


dkshxudk (author)2017-03-16

How to program these instructions from Arduino Uno?

RKD1993 (author)2016-08-08

Hi ! how can i change the code to use it in other avr micro like atmega32 or others??

EmilyB139 (author)2016-07-21

hi! I was wondering if it would be possible to make this same circuit using 4 leds, and if so would I have to change the resistors? Also, do you know if it would be possible to change something so this runs on 1.5 volts?



EmilyB139 (author)EmilyB1392016-07-21

never mind on the 1.5 v battery question, I've found something in the garage that will work.

nyalaguy (author)2016-07-20

Is it possible to build something similar for a garage door?

MuaazH (author)2016-06-11

i have test not work :D

Xcs011 (author)2016-06-11

Hey, could someone drop me an email at""
To explain in more depth either how to upload hex using arduino or how to get my hands on a preprogrammed adafruit TVB chip as the link above no longer works. Thanks

IMX1508y (author)2016-06-10

For this could you use a 100 ohms resistor

SashaktP (author)2016-04-05

How to Program using arduino

OosKarM (author)SashaktP2016-05-16

you've solved?

OosKarM (author)2016-05-16

Can u send me you email? or something for contact to you.


yousuf_2 (author)2016-05-13

heloo Brother its rely amazing trik
i want to Buy 5 pcs
you dilvr for me in Dubai?
i will pay you all Expance,
whatsapp +971506378534
email ch.yousuf7 @ gmail . com

zoran.feyli.3 (author)2015-01-02

hi guys i am not good at that think but can you not buy one online

BrendenL2 (author)zoran.feyli.32016-05-08

What is the link?

What's the fun in that? :P

CalebN1 (author)2016-04-14

This is really awesome, dude. I currently have it built on a breadboard, as I was going to test it before making the connections permanent, but as luck would have it my tv was subject to a power surge which destroyed the receiver for the remote with lightning precision. So I was wondering, what is the range of this? I apologize if you said it in the Instructable, but if you did then I missed it.

SashaktP (author)2016-04-05

I mean how to upload the tv b gone files using arduino to attiny85

The_paradox_ (author)2016-03-11

Would using a preprogrammed chip from the tv b gone kit work if I made it the same way you did while using it?

The_paradox_ (author)2016-03-11

Would using a preprogrammed chip from the tv b gone kit work if I made it the same way you did while using it?

ersk1 (author)2015-12-16

It would be cool if put it in a lighter or a keychain flashlight!

slatinski (author)2015-10-10

the IR leds just glow constantly,no blinking...what could be wrong

NickyYTSRB (author)slatinski2015-12-02

they are blinking 38000 times per second :P you think that you can see that?

JemChalweDoPorzygu made it! (author)2015-08-27

Made instructable about it. Check my profile.

JemChalweDoPorzygu (author)2015-08-17

Why do you reset uC with High state? (connected to 5V instead of GND)

SirDuctTape (author)2014-09-20

I made this on a breadboard , but whenever I give it power, the status LED turns on, but the IR Leds don't blink. Does anyone know of anyway This can be Solved?

dj505Gaming (author)SirDuctTape2015-07-18

How do you know if it's blinking or not? I light I'd invisible to the human eye, and most cameras these days have IR blocking filters.

dj505Gaming (author)dj505Gaming2015-07-18

*is invisible

dj505Gaming (author)2015-07-18

This would be awesome in an Altoids Smalls tin! I already have an Adafruit TV b gone in a full size Altoids tin.

WilliamW24 (author)2015-06-20

does this shut off all tvs at once?

How do I make it with arduino?

dj505Gaming (author)WilliamW242015-07-18

It doesn't shut off every TV at once. How it works is all the on/off signals are stored on the chip and when you turn it on it cycles through them one at a time, so it can take up to one or two minutes to get all the TVs.

nodoubtman (author)2015-02-14

Hi! What's the firmware version you use?

thank U!

happydupa (author)2014-03-06

Aubtin. I was looking for an inexpensive programmer to make this Instructable. After a lot of looking, I came across this and bought it. It's only $4.99 and has free shipping.

Two things: It only comes with a 10 pin connector cable. But if you look at the pinouts of the 10 pin and the 6 pin cables, they have the same data lines. The 10 pin connector just has 4 extra unused ones. So it's pretty easy to run wires from the 10 pin connector to your programmer board and make it work. I did.

The second thing is that this instructable is written to use the USBtinyisp programmer. When I tried to use my programmer it failed. Here's the trick. You need to edit the AVR instructions to tell it to use a different programmer. Copy and paste this and then it will work:

Avrdude -c usbasp -p
attiny85 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

Followed by:

avrdude -c usbasp -p attiny85 -U

nodoubtman (author)happydupa2015-02-14

Thanks a lot man! I thought that the fuses were programming also... heheh :) i think i got wrong.. :) hahah


david.martnick (author)2015-02-08

I'm not sure why you used the resonator at all. The attiny85 has an 8 Mhz internal oscillator that is pretty accurate and if there are inconsistencies, you can calibrate the internal oscillator within +/- 1%, via

page 164. The only issue I can possibly see is that the temperature change can cause a frequency swing. Can you get back to me about this? I would like to build one of these in the next few days and if I can minimize components I would prefer to.

jdgabbard made it! (author)2015-01-26

Very good article. I used this as the basis for my PCB build. Pictures are below.

One more thing, I noticed were at least one of the comments mentioned problems programming without the oscillator/crystal connected. You can program the chip first, then set the fuses. This will let you program the ATtiny on either a breadboard or a programming board before sticking it into the circuit. To do this I like to use a GUI for AVRDUDE called AVRDUDESS. Google it, it is great, and makes programming a snap.

Fennec74 (author)2014-12-30

Thanks :)

dudes (author)2014-11-04

I tried uploading the code and got these errors

sketch_nov04g.ino:32:18: error: main.h: No such file or directory

sketch_nov04g:326: error: duplicate 'const'

sketch_nov04g.ino: In function 'int main()':

sketch_nov04g:354: error: invalid conversion from 'uint16_t' to 'const prog_char*'

I have no idea what they mean or how to fix them, any help would be appreciated.

Victor805 (author)2014-10-30

I had to include the port and the transmission rate so it could work with my arduino, but I was able to upload the code without problems:

avrdude -c arduino -p attiny85 -P com3 -b 19200 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

avrdude -c arduino -p attiny85 -P com3 -b 19200 -U flash:w:C://tvbgone.hex:i

(I used the other fuse because I don't have a resonator)

The problem I have is it doesn't works, I followed and reproduced the schematic but without including the resonator, and I used a small LED to test it but the LED doesn't lights up continuously like I would expect from a remote control.

Is it the circuit diagram different when you don't use a resonator, if yes how do I connect it?

Victor805 (author)Victor8052014-11-03

I've been able to solve the problem: I bought a 8MHz oscillator (the big metallic one) as a substitute of the resonator, that solved all the issues.

Tip: If you are programming your Attiny at 8MHz you might want to leave the oscillator connected during all the process. In my case I got the "Yikes" problem whenever I forgot to connect the oscillator.

Victor805 (author)Victor8052014-11-03

Also I've noticed another thing, the switching action isn't controlled by the program, instead, in order o make it work you need to power the whole circuit. I don't have a problem with this, but I've found the code just runs once, when it has been run it just stops, and you need to turn off and then turn on the circuit in order to make it work again.

And the problem becomes larger if we have a capacitor going from positive to negative, that gives the chip some power to keep it on for some more seconds or minutes, depending on how big it is. That means if you turn it off and on again it wont do nothing, I've added a bleeding resistor of 10k to solve this, but the ideal thing would be to loop the code so it could run as long as the button is pressed.

Victor805 (author)Victor8052014-11-04

Well, I could also put the capacitor before the button and increase the value of the bleeding resistor.

Crafterkid123 (author)2014-10-02

could you make this one smaller without modifications or does it have to be all spread out and wide like that? Thanks. I wanna cram one inside a 2005/2010 sonic screwdriver toy.

titan69 (author)2012-09-28

Hi there, how would i change the fuses using an arduino uno, i get a blinking led working on the attiny85 using the arduino but cant seem to figure out how to do this step with only an aduino uno.

titan69 (author)titan692012-09-29


Figured it out, what i did was i used the ardunio-1.0.1 software and did the following:

1- Opened Arduino program and selected tools>board>Attiny85(external 20mhz clock)
2- Click open tab and click ArduinoISP.
3- Connected all wires of arduino uno to attiny85.
4- Then navigated to C:\Users\arduino-1.0.1\hardware\tools\avr\bin and opened this path in command prompt.
5- Entered the following command (remember to put your com port):

avrdude -p attiny85 -P com6 -c stk500v1 -b 19200 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

And everthing worked.

About This Instructable




Bio: Hi! I've loved electronics and electricity for as long as I can remember, and electric projects are something I do in my free time ... More »
More by dark sponge:DIY TV-B-Gone SHP (And Save $45)$3.50 DIY TV-B-Gone Micro$4 DIY TV-B-Gone
Add instructable to: