Step 20: 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...

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!

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.

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.

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:

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.

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.

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.

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.

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):

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.

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 )

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.

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!

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:

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:

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?

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

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?)

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 for fun. Everything I've learned about electricity is either from exp...read more »