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

About: 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 experience o…

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!

Step 1: Materials

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!

Step 2: Prep for Programming

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.

Step 3: Program the Chip Part 1: Fuses

"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!

Step 4: Program the Chip Part 2: Code

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!

Step 5: Begin Construction!

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.

Step 6: Add the Voltage Regulator

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.

Step 7: Add the Capacitor

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.

Step 8: Add the Resonator

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.

Step 9: Add the Transistor

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.

Step 10: Add a Resistor

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.

Step 11: Make the LED "Triplets"

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.

Step 12: Make the LED Array

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.

Step 13: Unite the Two Halves

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.

Step 14: Add the Button

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.

Step 15: Add the LED

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.

Step 16: Add the LED's Resistor

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.

Step 17: Add the 9v Battery Clip

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.

Step 18: Find a Fresh 9v Battery and Have Fun!

...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!

Microcontroller Contest

Participated in the
Microcontroller Contest