TV-B-Gone is a small gadget that can turn on and off virtually any TV in the world developed and sold as a kit by Adafruit. They also provide the source code and compiled firmware under Creative Common Share Alike license.
I would like to thank original developers at Adafruit for this great work and sharing ideas before starting showing my modification.
First trial
At first, I downloaded the firmware v1.1 and flashed an ATtiny85-20 and made it with only one transistor and two wide angle IR LEDs with two supercaps as shown below. The switch is connected to the supercap + so it will beam only when you press the button. It worked fine, but the problem was it drained the supercaps too quickly. The first reason is, of course, low capacity (compared to batteries) of the supercaps, but there are other reasons, too. I didn’t have a resonator at 8MHz, so I burned the oscillator selection fuse bit of the ATtiny85-20 as internal 8MHz. The internal oscillator has benefits of omitting an external component and programmable, but there are serious down side; its frequency can be unstable and varies depending on the temperature and power supply, AND it consumes more power at high frequency settings.
After this first trial, I added a 8MHz ceramic resonator and uploaded v1.2 firmware on an ATtiny85V-10 and found it can last double the time than ATtiny85V-20 using internal oscillator. One full cycle of pulsing all the codes takes a little less than a minute and with this latest testing configuration, more than 30 times of full cycle worked with 2 supercaps before the voltage dropped below 1.7V (two in series).
Need to save battery
I have thought about to turn off the device before the full cycle finished once it either turn on or off a TV. Adafruit's firmware database is designed as the codes for popular TV models emits first. So in most cases, long before it emits all the codes, my target TV is turned on or off. I thought about to add a power switch but that wasn’t very attractive to me.
Idea and solution!!
A couple days later, I suddenly got a good idea to utilize the Region Detection pin (pin6 of the ATtiny85v). Once the program detects the region from the level of pin 6 (float (internal pull-up): US, pull-down: EU), it is not used any more until all the codes pulsing is finished. So, in US mode for example, after it started pulsing and when you want to stop it, forcing the pin6 to ground will exit the do loop in software and the device will go sleep. I tested both US and EU mode with modified code and worked fine. This way, you can save battery.
Here in this introduction, I included a picture of the assembled TV-B-Gone JeonLab, but the circuit, which will be shown and explained step by step, is quite simple, so you may be able to assemble one on any prototype board or even on a bread board.
Remove these ads by
Signing UpStep 1: Circuit modification
There are three circuits showing in this step: North American (US) models only, European (EU) models only, and all-in-one model with region selection switch.
The PCB I made and showed in the Intro section is the all-in-one model.
As you can see in the circuit diagram, the NA (or US) model has no pull-down resistor on the pin 6. When you successfully turn on or off a TV in the middle of code generation (the visible LED blinking), simply push the button S2 will pull the pin 6 to the ground and the firmware will stop the process and go to sleep mode which doesn't consume the battery.
However, in EU model, the pin 6 is grounded by the pull-down resistor, R3, 10k, always. But pulling up the pin 6 by pressing the button S2 and connect to Vcc, the modified firmware will stop the process and sleep.
The UNI (all-in-one, NA+EU) model simply has both in one by adding a slide switch.











































Visit Our Store »
Go Pro Today »




"main.c: In function 'main':
main.c:317: error: 'for' loop initial declaration used outside C99 mode"
It then highlights this part of code:
"// For EACH pair in this code....
for (uint8_t k=0; k uint8_t ti;"
I am not very experienced in C so I don't know how to fix this myself.
1. Download WinAVR (http://sourceforge.net/projects/winavr/files/latest/download?source=files) and install.
2. Browse into where the WinAVR is installed: Start-All programs-WinAVR-20100110 and run Progrmmers Notepad
3. Open the source code and edit
4. Open the MAKEFILE and edit it (follow instruction in the post from my blog: http://jeonlab.wordpress.com/2011/11/22/makefile-setting-for-the-attiny4585-programmer-with-jeonlab-mini-or-arduino/
5. Go to Tools menu and click [WinAVR] Make all to compile. If you have any problem with compiling, look closely this MAKEFILE.
6. Now I assume you already have any kind of programmer (not software but a physical device to put your Attiny85 chip and connect it to your computer such as the one I introduced (http://www.instructables.com/id/ATtiny-programmer-using-Arduino-ISP/) or DASA or any other commercial product.
7. Insert an Attiny85 chip on the programmer and hook it to your computer.
8. From the Progrmmers Notepad, go to Tools and click on [WinAVR] Program to upload the hex file.
That's it!
Good luck.
avr dude_ getsync: not in sync
I tried other setups using Arduino IDE to upload a Blink sketch and it returned these errors:
Access is Denied com3
File not found
I am not sure what the problem is, but I think it lies within my Arduino. I will purchase a USBtiny ISP and try this again.
Good luck.
Please take a look at this post in my blog. My first try was exactly the same as what you want to do. I used v1.1 which works just fine. From Adafruit's website, download v1.1 and look at the circuit. You will easily figure out what to do.
then I ran this to upload the code: avrdude -p t85 -c gpio -v -U flash:w:tvbgone.hex