DIY TV-B-Gone SHP (And Save $45)

by dark sponge in Circuits > Microcontrollers

142852 Views, 236 Favorites, 0 Comments

DIY TV-B-Gone SHP (And Save $45)

SAM_0008.JPG
SAM_0001.JPG
SAM_0004.JPG
SAM_0005.JPG
SAM_0006.JPG
SAM_0007.JPG
SAM_0009.JPG
SAM_0010.JPG
SAM_0022.JPG
SAM_0023.JPG
SAM_0024.JPG
A while ago I posted my $3.50 DIY TV-B-Gone Micro, which was great and all but didn't have near enough juice. The TV-B-Gone SHP is supposed to be able to turn of TVs from 100 meters away, but cost $50. So for about $5, I made a clone of one that seems to work pretty close to that limit. It's also very tiny compared to the commercial one.

Technically, because TV-B-Gone is a brand name, this is a "TV-B-Gone clone."

I used an ATtiny 85v as the "brains" of this, programmed with Adafruit's original code. It runs off of a 9v battery with a 5v regulator to power the microcontroller. The the LED array has 12 infrared LEDs in it, and the microcontroller is connected to a transistor that can power the whole array. The 12 LEDs blast out almost every TV on-off code, allowing you to turn pretty much any TV on or off. A 3mm green LED blinks between each code to show that it's working. When the battery is removed it is significantly smaller than the original TV-B-Gone, allowing for easy hiding.

Also, I'm entering in the microcontroller contest. If you think I'm worthy enough, give me a vote!

Materials

DSC02831.JPG
TV-B-Gone SHP schematic.png
Materials

Each name is a link to a Mouser part you can click (you don't have to use Mouser, I just like them because of great service and how close to my house they are). You could also use an IC socket if you want to be extra careful with your chip or think you might reprogram it in the future.

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, VERY helpful (probably required for this project)
Now let's start making!

Prep for Programming

DSC02774.JPG
If you have a programming board, you can skip this step. If you are using a USBtinyISP or similar, use a breadboard to wire the chip to the proper connections of the programmer. More instructions on how to do this can be found here. The pinout for the chip can be found on the datasheet here.

Program the Chip Part 1: Fuses

Programming007.bmp
"Fuses" are a very small part of the microcontroller's memory that tell it how to operate, such as which oscillator to use, enabling the reset pin, and so on. Will will need to change the fuses to run off of an external oscillator. I used http://www.engbedded.com/fusecalc, which is a free AVR fuse calculator. You don't need to use the calculator because I listed the commands here.

I use AVRdude to interface between the programmer and my computer. A tutorial on how to use AVRdude can be found here.

Now type:

Avrdude -c usbtiny -p attiny85 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

Proceed to the next step for programming the real code!

Program the Chip Part 2: Code

DSC02772.JPG
Programming012.bmp
The first thing you will want to do is connect the oscillator on the breadboard. Because it is now set to run with one, it has to have one to be programmed with one.

Download the firmware v1.1 from Ladyada.net at http://ladyada.net/media/tvbgone/tvbgone11.zip. This is for their kit, but I used it to program this and it worked. Unzip the folder and find the tvbgone.hex file. Copy this and put in C:\users\username where AVRdude can find it. Now, in AVRdude, type...

avrdude -c usbtiny -p attiny85 -U flash:w:tvbgone.hex

...and wait for it to put the code on the chip. Now let's get building!

Begin Construction!

DSC02837.JPG
This first step is simple enough. Bend pins 1 and 8 around so that they nearly touch, and solder them together. These are Vcc and RESET, which will both be connected to the button.

Add the Voltage Regulator

DSC02840.JPG
DSC02843.JPG
Find the voltage regulator in your pile of parts. Lie the flat part along the corner of the chip and bend the middle pin underneath it as shown in the pictures. Bend pin 1 so that it meets the two pins you soldered together in the previous step. Solder this connection, and then solder the middle pin of the voltage regulator to pin 4 of the microcontroller, which is ground.

Add the Capacitor

DSC02845.JPG
DSC02846.JPG
DSC02847.JPG
DSC02849.JPG
The capacitor smooths out any peaks or lows in electrical current caused by the LEDs' rapid pulsing. Position it under the microcontroller so that its leads face the regulator side. bend the positive lead up and solder it to the 5v side (pin 1) of the regulator. Solder the negative end to pin 4 of the microcontroller, where pin 2 of the voltage regulator was also soldered.

Add the Resonator

IMAG0943.jpg
DSC02852.JPG
DSC02853.JPG
DSC02854.JPG
Position the resonator under the capacitor with the leads facing the opposite way as the voltage regulator's leads. Bend its outer two pins inward and solder them pins 2 and 3 of the microcontroller (the two middle pins of that side). Bend the resonator's middle pin up and solder it to the lead extending from pin 4 (ground) of the microcontroller.

Add the Transistor

DSC02855.JPG
DSC02857.JPG
The transistor allows a low-current pin of the microcontroller to control the high-current LED array. When current is delivered to the middle (base) pin, power flows from pin 3 (collector) to pin 1 (emitter) and ground the LED array to turn it on momentarily. Position the transistor at the same level as the voltage regulator, with the flat side facing outward and the leads facing down. Bend pin 1 (The emitter) and solder it to pin 8 of the microcontroller to ground it.

Add a Resistor

IMAG0945.jpg
DSC02858.JPG
DSC02860.JPG
This 150 ohm resistor connects the outputs of the microcontroller the transistor's base and limits the current flow from these pins. Bend pins 5 and 6 of the microcontroller together and solder them to one end of the resistor. Solder the other end to the middle (base) pin of the transistor.

Make the LED "Triplets"

DSC02865.JPG
DSC02863.JPG
Find your LEDs in the diminishing pile of parts. Solder the 6 wide narrow beam LEDs into two groups of three (making sure to connect positive to negative) and repeat with the wide angle LEDs.

Make the LED Array

DSC02871.JPG
DSC02867.JPG
DSC02868.JPG
DSC02870.JPG
DSC02872.JPG
DSC02873.JPG
Group the triplets together so that all of the negatives are on one side and the positives on the other. Bend them into a line on each side and solder them together. Cut off the last two pins when you are done; you should now have a 4 x 3 block of LEDs.

Unite the Two Halves

DSC02874.JPG
DSC02875.JPG
IMAG0942.jpg
Position the LED array in front of the other electronics with the positive side facing up and the negative side facing down. Bend down pin 3 (collector) of the transistor and solder it to the bottom negative row of the array.

Add the Button

SAM_0013.JPG
SAM_0015.JPG
IMAG0946.jpg
IMAG0947.jpg
DSC02883.JPG
DSC02884.JPG
Find your button and fit it between the positive of the LED array and the voltage in pin of the voltage regulator. Solder these two connection points. When the button is pushed, it allows power to the voltage regulator and therefor the microcontroller.

Add the LED

DSC02886.JPG
DSC02887.JPG
IMAG0944.jpg
Bend the two pins of the LED outward. Fit it on top of the microcontroller and run the negative wire underneath the wire coming from pins 1 and 8. Solder it to pin 7 of the microcontroller.

Add the LED's Resistor

IMAG0948.jpg
DSC02893.JPG
DSC02895.JPG
IMAG0949.jpg
This 150 ohm resistor limits current to the LED. Solder one end of it to the positive lead of the LED. Bend the other end around and solder it to the same cluster as pins 1 and 8 of the microcontroller. This is where it connects to positive power, and the microcontroller grounds it to turn it on.

Add the 9v Battery Clip

SAM_0018.JPG
DSC02896.JPG
DSC02897.JPG
Cut and strip the wires of your 9v battery clip. Solder the positive end of it to the top of the LED array. Solder the negative end of it to pin 4 of the microcontroller, the ground pin.

Find a Fresh 9v Battery and Have Fun!

SAM_0008.JPG
SAM_0001.JPG
SAM_0005.JPG
SAM_0004.JPG
SAM_0006.JPG
SAM_0007.JPG
SAM_0009.JPG
SAM_0010.JPG
...but not too much fun. The ability to blast TVs on and off from a great distance should be used with care. I am not responsible for what you use this for.

Right now the connections are exposed and could short out. You might want to consider covering it with hot glue or sugru.

If you make one, please send pictures! If you have any questions or comments, post them and I'll do my best to answer them immediately. I like comments :-)

Also, I'm entering in the microcontroller contest. If you think I'm worthy enough, give me a vote!