3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Battery saving TV-B-Gone with region/range selection switches

Battery saving TV-B-Gone with region/range selection switches
«
  • assembled TV-B-Gone_JeonLab 2.JPG
  • 1st TV-B-Gone with supercaps.jpg
What is the TV-B-Gone?
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 adsRemove these ads by Signing Up
 

Step 1Circuit modification

Circuit modification
The original design of the TV-B-Gone by Adafruit uses the pin 6 of ATtiny85v as region detection.  With a 10k pull-down resistor connected to the pin 6, the device generates codes for European TV models. Otherwise, floating the pin 6, it works for North American models and most Asian models as well. 

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.
« Previous StepDownload PDFView All StepsNext Step »
21 comments
Mar 5, 2012. 2:51 PMMrGentlemen says:
Thy

1. Yes
2. Yes
3. I habe try it with AVR studio 5.1, basecom and some other , but it diesnt worked

4.done
5.done
6.done
7. I got some error messages:

main.c:271: warning: passing argument 1 of 'putnum_uh' makes integer from pointer without a cast

vrdude: ser_open(): can't set buffers for "LPT2"

make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:02

what did i need to do now?
Mar 5, 2012. 7:19 PMMrGentlemen says:
As you can see here, I have an PCI LPT card installed.
It has two ports...one on the outside, one intrnal.
I think the outside ones are LTP2, witch i have set in the makefile and are connected with the programmer.

These are the only LPT-ports i have,
Mar 5, 2012. 9:05 PMMrGentlemen says:
I have allways opened just the main.c file.
Did you mean I need to have the 4 files opened in the background at the same time in PN and compile from the main.c file?

I have try it this way, but i got an error message again:
> "make.exe" program
avrdude -p attiny85 -P LPT2 -c stk500v1 -b 19200 -B 1 -U flash:w:tvbgone.hex
avrdude: ser_open(): can't set buffers for "LPT2"
make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:01
Mar 5, 2012. 9:12 PMMrGentlemen says:
Oh I forgot...
the programmer i use in one for ATmegas.
This one:
http://www.rn-wissen.de/index.php/AVR-ISP_Programmierkabel
Mar 7, 2012. 12:24 AMMrGentlemen says:
I have fix it now.
I have change it to stk200 wich is compatible with my ISP programmer, but i got now an other error message:

> "make.exe" program
avrdude -p attiny85 -P lpt1 -c stk200 -b 19200 -B 1 -U flash:w:tvbgone.hex

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:01


I have checked the connection, but im not sure what connection i need...XTAL1 and XTAL2 or ADC2 and ADC3 to connect to the AVR-board
Mar 7, 2012. 12:35 PMMrGentlemen says:
thanks, without your help it would be inpossible =)

I have a pci parallelport with 2 ports and in the hardware device the are shown as LPT2 and LPT3 (i dont know why because LPT1 doesnt exist).
I try again to change to LPT1 and 9600 baud and report back.
Mar 5, 2012. 1:18 PMMrGentlemen says:
Hi JeonLab,

can you help me to compile the modified Firmware to flash it to the tiny?

I have tried to compile it by myself, but i cant done it because im a newbie in compiling.

would bve great if you can help me.
Feb 28, 2012. 7:29 AMMrGentlemen says:
(removed by author or community request)
Feb 29, 2012. 2:33 PMMrGentlemen says:
(removed by author or community request)
Feb 27, 2012. 8:58 PMMrGentlemen says:
Hi Jeonlab,

I Have a question bout your circuit.
Where did the connections from LSP1 and LSP2 from the circuit are going to?

thx
Feb 28, 2012. 6:43 AMMrGentlemen says:
Thx
This means , i need to connect the GND and VCC-connections wiht the LSP connections and connect all together to the power supply, right?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
6
Followers
3
Author:JeonLab(Visit My blog!)
I have no wings which I badly wish to have. Until then, I will think, design and make things.