Instructables
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!
 
Remove these adsRemove these ads by Signing Up

Step 1: Materials and Tools

Picture of Materials and Tools
TVBGONE schematic.JPG
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!

Tools:
  • 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!
1-40 of 295Next »
dudes1 month ago

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.

Victor8o51 month ago

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?

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.

8MHZ.jpg

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.

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

Crafterkid1232 months ago

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.

SirDuctTape2 months ago

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?

titan692 years ago
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 titan692 years ago
Edit

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.
oluzon titan691 year ago
I was still confused about steps 4 and 5, could either make a short video, or go more into depth?
titan69 oluzon3 months ago

Hi,

Sorry for the late reply, ill try to go more in depth as i dont have any Attiny85's to play around with at this moment to make a video.

For step 4, my Arduino software is on my desktop, so click on the arduino folder and navigate to

arduino-1.0.5-r2\hardware\tools\avr\bin

In the bin folder you should see a whole bunch of exe files, the one we will be looking for is:

avrdude.exe

For Step 5, we want to first see what com port we are using, so connect your Arduino, go to 'Device Manager' and you should see your port(mine is 3), remember your com port number for later:

Now in you arduino folder that you opened up earlier and navigated to

arduino-1.0.5-r2\hardware\tools\avr\bin

open up command prompt, to do this press ctrl+shift and right click at a blank spot in the bin folder, then in the dropdown menu click 'Open command prompt window here'. Now your command prompt will be pointing to the correct folder.

Now type:

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

Hit Enter and hope it works, remember to change your com port accordingly

dark sponge (author)  titan692 years ago
Glad you figured it out, sorry for the late reply. Thanks for leaving the how-to for other people!

Jut curious as to the range that people have gotten out of this rig. I'm looking to make one as small as possible without sacrificing too much range. Thanks!

harnon made it!8 months ago

Hello,

Nice 'instructables', thanks!

I put mine in a solar-powered-light-keychain box, re-using the battery and solar cell system. Let see how the powering goes with the time (everybody know the limits of these so called cheap rechargeable batteries). Anyway, had fun doing it !

I used the version without resonator because of the space inside the box. It is now at least 3 meters range (couldn't test more, my TV remains unused in the garage ... and the garage is 3 meters long ;o )

I used usbasp programmer and all worked fine.

Thanks again.

IMG_6470.JPGIMG_6473.JPG
happydupa made it!9 months ago

Hey dark sponge, just wanted to show you the cool TV-B-Gone I made from your instructable. I decided to build it on perf-board so that it would fit into the Altoids smalls case. I didn't want to open the case to press the button so I drilled a small hole in the cover (look close, it's right above the "A" in Altoids) and glued it using JB Weld. The button was kind of tough to press so I put a tiny drop of JB Weld on top the button just to give it some height. It's awesome.

Thanks again

CYMERA_20140306_174447[1].jpgCYMERA_20140306_174317[1].jpg
happydupa9 months ago

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. http://www.ebay.com/itm/161128775429?ssPageName=ST...

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
flash:w:tvbgone.hex

Aubtin9 months ago

I am planning on buying the equipment and all the components in the list to make this. I am new to this though, would this programmer work for the project?

http://www.ebay.com/itm/USBtinyISP-v3-0-Programmer...

Thanks

aaroncmears10 months ago

Hey, I'm trying to figure out how to make one of these, and I'm using an ATTiny85 (not "v") and a 5v voltage regulator with a 9v battery. How would I write the program to my ATTiny85 from the Arduino IDE? Or is it even possible? Thanks!

bneo99 aaroncmears10 months ago

I also used ATTiny85 not v and it works fine.... and are you using Arduino as ISP to program the attiny85? I used Arduino as ISP as the usbtinyISP I ordered from ebay is scheduled to arrive in a couple of weeks..... I don't think there's a direct way to upload/program the attiny85 using the IDE.... So, I installed avrdude on my OS (Lubuntu 13.10) and used these commands:

(writing fuse)

avrdude -cavrisp -pattiny85 -P/dev/ttyACM0 -b19200 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -v -v -v -v

flashing .hex file (.hex file must be in the directory the terminal is currently in)

avrdude -cavrisp -pattiny85 -P/dev/ttyACM0 -b19200 -U flash:w:tvbgone.hex

It worked without any error and I am happy to switch my home TV on and off for once.....

aaroncmears bneo9910 months ago

In trying this out, I got the fuses set alright (as you said, so I don't know whether or not I'll need the resonator with it), but I'm getting this error when I put the avrdude -cavrisp -pattiny85 -P/dev/ttyACM0 -b19200 -U flash:w:tvbgone.hex in there:

avrdude -cavrisp -pattiny85 -P/dev/tty.usbmodem641 -b19200 -U flash:w:tvbgone.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000

avrdude: Yikes! Invalid device signature.

Double check connections and try again, or use -F to override

this check.

avrdude done. Thank you.

Should I just override it with -F?

I think you may have set the fuses to use the external resonator....... and because there's no external resonator connected, the MCU wont work.... that's you get the

avrdude: Device signature = 0x000000

error. To fix this, you will need to provide a 8mhz external signal into the MCU to program it

aaroncmears bneo9910 months ago

Alright, thanks! And is the fuse setting for with or without the resonator?

bneo99 aaroncmears10 months ago

The one i provided is with the external resonator... and after setting the fuses you will need the resonator connected before actually flashing anything into its memory

Thanks for all your help so far, I haven't had any luck finding resonators (crystal or ceramic) anywhere local. I could potentially order one from the internet, but I'd rather avoid it if I could for time's sake. How would I go about setting the fuses to on the attiny85 to 8mhz from my Arduino without a resonator?

TYOM11 months ago

I Have been trying to use arduino to program this but nothing has worked, if anyone has the the code for the arduino or can help me please reply.

bneo99 TYOM10 months ago

I don't think we can use the Arduino IDE to flash it (there should be a way but I'm not sure) So, I installed avrdude on my OS (Lubuntu 13.10) and used these commands:

(writing fuse)

avrdude -cavrisp -pattiny85 -P/dev/ttyACM0 -b19200 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -v -v -v -v

flashing .hex file (.hex file must be in the directory the terminal is currently in)

avrdude -cavrisp -pattiny85 -P/dev/ttyACM0 -b19200 -U flash:w:tvbgone.hex

bneo99 made it!10 months ago

Following the same schematic, i changed it to pcb version (1st time etching pcb (used toner transfer (ironing) and ferric chloride as etchant) for higher durability...... used an IR LED that I salvaged from random parts as the sole LED as the IR LEDs I ordered from Ebay is only going to arrive in a couple of weeks.... bought the wrong capacitor but it still works, resonator and ATTINY85 from rs components and the rest(everything exclude mcu, resonator, battery) from a local online electronic shop

P1050686.JPG
rutabaga_man10 months ago

i had started this a few years ago but kept running into problems programming the chip, so i just fixed the problem and the chip is programmed. so i am wondering how hardy the chips are when it comes to soldering. (how easy is it to burn them out with heat?)

happydupa11 months ago
Dark Sponge, you rock! I've wanted one of these forever but couldn't justify the high cost of a pre-made one. I can't wait to start building. One request. I hate the coin batteries. Can you tell me if I can substitute a 9v for the coin? If not, can you suggest how I would modify the circuit to accept one?

Thanks!
dark sponge (author)  happydupa11 months ago
You can replace it with 2 AA batteries in series or build something similar to this, which uses a 9v instead. http://www.instructables.com/id/DIY-TV-B-Gone-SHP-And-Save-45/
oluzon1 year ago
i did everything excatlly likeyou did except i used arduino to program attiny, then i used a program to upload the hex file to my attiny, i tried doing the circuit twice, but it stilll dosent work, help?
kcatx1 year ago
Nerver mind I got it working I was looking at the pics and it looks like u connet something to pin 7 but then I looked at the schematic and saw there was nothing connected
kcatx1 year ago
Hey I need some help I built the tv b gone on the bread bored and it worked great and now that I have soldered it together it won't work do u think I fryed my attiny85 I am using 1.1 firmware
aaron01271 year ago
Hey can i buy one of those ic chips from you preprogramed?
Great instructable!
i've made my own TVBG on my breadboard and it's work!
I added 2 IR so, totally there 4 leds and powered by 2 AA battery. Can't wait to try this with the big screen TV in school LOL
psp36011 year ago
Hi,
I just finished putting the v1.1 together on a breadboard to test it and I was wondering if I could add two IR LEDs for a total of four, would I have to increase the battery voltage from 3v to something like 4.5v? (Wouldn't be much of a problem since I'm going to use AA batteries, just need to use a 3 battery holder instead of 2) or would I just have to add a transistor?

Thanks,

Great instructable by the way!
I just built one and I'm having a bit of an issue that I can't figure out. I tested the chip on a breadboard and it worked. I built the micro and the first time I pointed it at a TV it turned on. Then it wouldn't shut the TV off. After trying a few times with no luck I started checking out the LED's through a camera. Whenever I press the button something different happens. Sometimes they will "blip" once, sometimes they flash a couple of times then stop, and every once in a while they blink like they're running through the sequence. I've triple checked all the connections and everything appears to be in order. I'm also assuming that it's wired up correctly because it did work that first time. I tried ruling out a faulty button by bypassing it with a jumper but got the same result. Anybody have any thoughts about what might be going on?
dark sponge (author)  thegoodjeremy1 year ago
Yes! I had a similar problem when I first breadboarded it. Putting in a filter capacitor fixed it. I then found the lowest value that would still get rid of these stops. Try using a much larger filter cap and see what happens.
Dylon1241 year ago
Is the 22uF capacitor used only to decouple the voltage from the cro2032 battery. Because you may not need it since the battery's voltage is pretty stable. good job though!
crusso1 year ago
Great instructable!!!!!
Just one question: would it work with an ATTINY85-20PU?
1-40 of 295Next »