|A bit of fun, TV-B-Gone!|
I recently purchased a The Adafruit USBtinyISP AVR Programmer Kit from Adafruit. If you are unsure as to what this is, have a look at my article here. Although I want to use this programmer to try out some of the AVR based projects detailed on the internet, I figured that I needed to have a project to test the programmer with. I also thought that having a universal remote control might be useful in my job.
Who am I kidding? I am 35 years old going on 10. When I read about the TV-B-Gone open source project I was giggling inside.
To describe what this project does… Think about every time that you have been subjected to a TV in a public space that you are neither interested in or is interrupting either your peace or conversation. Quite simply a TV-B-Gone is an Infra-red transmitter that will switch off all the major brands of TV with a single button. If you don’t want a TV blaring above your head, you simply switch it off.
The TV-B-Gone originally was sold as a key fob sized gadget. Mitch Altman (the inventor of the TV-B-Gone) eventually released details of an open-source version of the gadget and higher power variants such as the kit Adafruit sells became available. The device is controlled by an AVR microprocessor of which firmware (the program loaded onto it) is available on the web.
I thought that this would be a great little project to cut my teeth on with the AVR programmer and as Adafruit sell a complete kit, I ordered one alongside my USBtinyISP AVR Programmer Kit.
You can see from the stock photo what a completed kit can look like. Its a fairly simple design, and as supplied, the kit is capable of being used as is without any casework. The circuit board is sized so that it can be double taped to the back of a double AAA battery holder (supplied in the kit) and controlled by the single momentary contact switch mounted at the back of the board.
Four high power infra-red LEDs are mounted to the front of the assembly, two narrow beam, the other two wide angle emitters. These are designed to operate televisions across a large area. Adafruit claim an effective range in excess of 150ft in this version of the kit. That’s long range mischief in any language.
Also included in the $19.50 kit from Adafruit are
IC1 ATTINY85V-10-PU Microcontroller (preprogrammed when purchased in a kit) x1
IC1' 8-pin socket x1
XTL1 8.00 MHz ceramic oscillator. x1
C2 100uF or higher capacitor with 6.3V or higher rating x1
C1 Ceramic 0.1uF capacitor (104) x1
R1-R4 47 ohm 1/4W 5% resistor (yellow violet black gold) x4
R5 1.0Kohm 1/4W 5% resistor (brown black red gold) x1
LED2, LED3 Narrow beam IR LED. Everlight IR333-A x2
LED1, LED4 Wide beam IR LED, Everlight IR333C/H0/L10 x2
LED5 3mm LED 1
SW1 6mm tact switch button x1
Q1 Q2 Q3 Q4 NPN PN2222 x4
JP2 10 pin box header x1
BATT 2 x AA battery holder x1
PCB Circuit board (Adafruit’s own) x1
You can also opt to purchase just the circuit board and the integrated circuit from Adafruit for $10 each. You may have the rest of the components in your parts bin for instance.
For my TV-B-Gone I wanted the project to be mounted in a case, I wanted to be able to pack it up with the rest of my training kit as believe it or not, I also have a serious use for this project. I often go off-site to train in environments other than my classroom. Often the conference rooms that I train in have AV equipment, but frequently the remote controls are missing.
The case that I went for was a fairly cheap but sturdy Miniature General Purpose ABS Box 1551 Series from Maplin Electronics Ltd. Finding the case was done by the fairly scientific method of visiting a store and measuring up the Printed Circuit Board (PCB) by eye until I found one roughly the correct size. The order code is N80BQ and they sell for £2.58. The box was as far as I was concerned a perfect size, it fits comfortably in my pocket and is very…erm…discrete.
The box I decided on however did not have enough space in it to house the TV-B-Gone kit including its AA battery pack. I actually found it quite hard to find an affordable, compact box that would hold everything. Instead I decided to opt for a smaller battery size. I opted for a size N battery, these are about 3cm in length, about 60% of the size of an AA battery, They are still 1.5v batteries so whilst they wont last just as long, the size was near perfect for my choice of case.
Maplins again were the source for the battery holders. JB84F is the product code for the holders I used, I did have to grind out the sides of the project box in order to make them fit. I used my Dremel to do this. I had do do some more grinding of the thick screw posts in the case and a little off of one corner of the PCB.
A word to the wise here if you buy one of these kits. The kit supplied to me from Adafruit includes a ATTINY85V-10-PU, processor. This they have pre-programmed with 46 TV IR codes. However if like myself you live outside of the US, you may need to reprogram the chip to include codes that are more commonly used in your geographical area.
The kit includes a 10 way header that you can plug your programmer into and Hex files are available on the internet to update the kits firmware (software on the chip). However to do this using the kits PCB as an interface is not possible with the full circuit soldered together.
What I found though was that as long as the four 47ohm resistors are not in the circuit, the USBtinyISP AVR Programmer Kit works just fine. When testing out firmware, I found that I could lift out a leg of each resistor using the tip of my soldering iron, program and then re-solder the legs in place. I wouldn’t want to do this too many times as eventually the resistors will break, but for a few attempts to find the firmware that you like, this is fine.
Putting the whole lot together was a reasonable fit in the case, As I mentioned before, a few mm had to be ground out here and there to make everything fit. I also opted to mount the switch and the green status LED on the underside of the PCB. This made it a little easier for me to mount the board in the tight fitting case.
If you click on the image for a more detailed view, you can see some of the areas that were ground away to make space, although the work looks ragged in the image, bear in mind the hole unit measures 80mm x 40mm x 17mm, so in real life with my less than perfect eyes all looks a lot neater.
I did make a small mistake when drilling the 3mm hole on the top of the box for the status LED leaving a slightly larger hole than was necessary, again though this is not very obvious unless you look closely.
Using the TV-B-Gone
Using the TV-B-Gone is very easy. You press the single button on the top of the unit and point it in the direction of a TV you wish to control. The green status light flashes to indicate that the TV-B-Gone is transmitting. What it does is pretty crude, it simply spews out the same signals that your TV remote send to power off the Television. Stored on the device are quite a few of the most common codes that are transmitted one by one. It takes a minute or two to send all the codes on the unit.
The effect of the unit is quite comic if you use it in an electronics store. A bank of televisions on a store display switch off in groups (quite a few TV’s share each remote code) until all but one or two are left. This as you can imagine is very frustrating to the store staff! Not that I, an official grown up would do such a thing.
My only disappointment so far has been that I have not yet found a firmware file that controls my own TV or the data projectors that we use in the training center that I work in. Our Projector remote controls go missing on a regular basis and I really hoped that I would not have to rely on using ladders to switch off our ceiling mounted units. I may yet experiment with more firmware versions in the hope of finding one that works.
All in all, the TV-B-Gone is a highly entertaining little gadget to build. Because the kit is so complete, uses through hole components and reasonable quality PCB materials it is both easy and forgiving for first time builders. The kit is not particularly complex parts wise so building it is a quick job, preparing the case was the longest part of the physical build for me.
If you don’t live in the US, the hardest part of this project is going to be installing and mastering the programming software. There are plenty of instructions to do this on the web depending on what software you decide to use.
The TV-B-Gone forums are a good resource to read through, particularly to find links to different firmware downloads. This kit is an open source design, so you can download the schematic and build such a device on prototype board or by printing your own PCB if you have the skills. However with such a compact and complete kit available from Adafruit you might like me decide to save yourself some time and effort which you can lavish on the perfect stealth case for your new toy!
The home built kits also have a much greater range than the single LED key fob device that you can buy as a complete product, though a more powerful larger device can be bought here from Cornfield Electronics if you really don’t want to build your own.