Instructables
Picture of Arduino TV-B-Gone
Some time ago i found the tv-b-gone kit on the internet, and i really wanted one of those! Problem: I don't live in USA so the shipping costs were huge! After some search on google  I'we found that this guy adapted the code from the ATtiny85v chip inside the TV-B-gone to the arduino. So here it is, a tutorial for those who have an arduino laying around and some other stuff:

-breadboard
-IR LED
-1K resistor
-2n4401 transistor
-jumper wires
-pushbutton

More details and files on my website




 
Remove these adsRemove these ads by Signing Up

Step 1: Make it!

Picture of Make it!
          First, connect the 5v pin from the arduino board to the second horizontal rail of the breadboard and the GND pin of the arduino to the first one. Now, place your pushbutton, LED , transistor and resistor on the breadboard according to the schematic. Connect one of the pushbutton's pin to the ground and the second one to the digital pin 2 on the arduino board.
         Now for the transmitter part, you will have to connect the collector pin of the npn transistor to the 5v rail , the base to the digital pin 3 and the emitter to the anode (+) pin of the  LED. The cathode will be attached to GND trough a 1k resistor.
         *Note:If you're in Europe, you'l have to connect the digital pin 5 to ground trough a 1k ohm resistor.

         Your breadboard should look like this now:

Step 2: Programming the Arduino board:

Download the Arduino sketch and open the TVB.pde file with the Arduin IDE. Three other tabs should open next. Now just upload the code frome the TVB.pde on the arduino and connect everything together! Enjoy Shutting down the TV's from shops and restaurants!

  
Rocker5172 months ago

There are a bunch of errors in the code.


sketch_jun10a.ino:33:18: error: main.h: No such file or directory
sketch_jun10a.ino: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)':
sketch_jun10a:89: error: 'IRLED' was not declared in this scope
sketch_jun10a:98: error: 'IRLED' was not declared in this scope
sketch_jun10a:110: error: 'IRLED' was not declared in this scope
sketch_jun10a.ino: In function 'void setup()':
sketch_jun10a:194: error: 'LED' was not declared in this scope
sketch_jun10a:195: error: 'IRLED' was not declared in this scope
sketch_jun10a:196: error: 'DBG' was not declared in this scope
sketch_jun10a:200: error: 'REGIONSWITCH' was not declared in this scope
sketch_jun10a:201: error: 'TRIGGER' was not declared in this scope
sketch_jun10a:209: error: 'NA' was not declared in this scope
sketch_jun10a:210: error: 'DEBUGP' was not declared in this scope
sketch_jun10a:213: error: 'EU' was not declared in this scope
sketch_jun10a:214: error: 'DEBUGP' was not declared in this scope
sketch_jun10a:218: error: expected `)' before ';' token
sketch_jun10a:220: error: expected primary-expression before ')' token
sketch_jun10a:220: error: expected `;' before ')' token
sketch_jun10a:221: error: expected `)' before ';' token
sketch_jun10a:223: error: expected primary-expression before ')' token
sketch_jun10a:223: error: expected `;' before ')' token
sketch_jun10a:231: error: 'EU' was not declared in this scope
sketch_jun10a.ino: In function 'void sendAllCodes()':
sketch_jun10a:242: error: 'REGIONSWITCH' was not declared in this scope
sketch_jun10a:243: error: 'NA' was not declared in this scope
sketch_jun10a:247: error: 'EU' was not declared in this scope
sketch_jun10a:256: error: expected `)' before ';' token
sketch_jun10a:257: error: expected `;' before ')' token
sketch_jun10a:260: error: 'NA' was not declared in this scope
sketch_jun10a:268: error: expected `)' before ';' token
sketch_jun10a:269: error: expected `;' before ')' token
sketch_jun10a:278: error: expected `)' before ';' token
sketch_jun10a:280: error: expected primary-expression before ')' token
sketch_jun10a:280: error: expected `;' before ')' token
sketch_jun10a:281: error: expected primary-expression before 'x'
sketch_jun10a:283: error: 'x' was not declared in this scope
sketch_jun10a:284: error: expected primary-expression before ')' token
sketch_jun10a:284: error: expected `;' before ')' token
sketch_jun10a:288: error: expected `)' before ';' token
sketch_jun10a:289: error: expected `;' before ')' token
sketch_jun10a:294: error: expected `)' before ';' token
sketch_jun10a:296: error: expected `;' before ')' token
sketch_jun10a:359: error: 'TRIGGER' was not declared in this scope
sketch_jun10a.ino: In function 'void loop()':
sketch_jun10a:378: error: 'TRIGGER' was not declared in this scope
sketch_jun10a.ino: In function 'void delay_ten_us(uint16_t)':
sketch_jun10a:399: error: 'DELAY_CNT' was not declared in this scope
sketch_jun10a:400: error: 'NOP' was not declared in this scope
sketch_jun10a:403: error: 'NOP' was not declared in this scope
sketch_jun10a.ino: In function 'void quickflashLED()':
sketch_jun10a:412: error: 'LED' was not declared in this scope
sketch_jun10a.ino: In function 'void sleepNow()':
sketch_jun10a:436: error: 'TRIGGER' was not declared in this scope

Rocker5172 months ago

Can I use 2 LEDs for extended range? If so, will I need to modify the code?

Supermeow8 months ago
What type of infrared LED works best?
On a side note, unless you are using more than one led in series ( I found that 3, 1.5 volt LEDs works best for 5 volts), you can burn out the LEDs really quick! Also, series means:
Input + (LED) - to + (LED) - to + (LED) - to ground
Lt. Rooney9 months ago
I've hit several problems trying just to verify the code. So for anyone else, apparently some compilers don't like the way NApowerCodes and EUpowerCodes are declared, you need to add a "const" after "*" or it won't recognize the variable as a constant:
const struct IrCode * const NApowerCodes[] PROGMEM = {
extern PGM_P * const NApowerCodes[] PROGMEM;

Now I've gotten no end of trouble with NApowerCodes apparently being undefined:
"/usr/share/arduino/TVB.ino:381: undefined reference to `NApowerCodes'"
There's no reason why this should be that I've found, though, it's defined in WorldCODES.cpp. Any thoughts on how this should be?
oluzon10 months ago
do you think i could upload the code too an attiny85, to make it smaller
pepetito1 year ago
i copied the main.h into my ide and hit upload and it gave me a bunch of erros like no void loop or setup help?
EdDruino (author)  pepetito1 year ago
Sorry that was my mistake...I meant TVB.pde. You only have to open the TVB.pde and everything should open by itself. upload the pde file on the arduino only
David971 year ago
Hi, Just wondering what the point of the transistor is as most LEDs dont draw enogh to burn out a pin?
EdDruino (author)  David971 year ago
It's not about burning the pin, the transistor is there because a simple arduino pin does not "give" enogh current to power the led at it's full capcity..So the transistor is there to make the TVB more powerful.
ZRSigs1 year ago
Hey I tried using this setup and I am having trouble. I have everything wired up and connected and I have the firmware flashed and I have even tested to make sure that the led is working using my cell phone camera. But I cant get the thing to turn off any TV's, no matter how close I seem to get to it and having it pointed directly at the TV. Can anyone tell me what they think is wrong?
2013-05-15_18-30-32_603.jpg
ZRSigs ZRSigs1 year ago
oh and the boards LED does flash so I know the codes are being sent.
EdDruino (author)  ZRSigs1 year ago
Are you from europe? If you want to turn on/off TVs from there you have to connect the digital pin 5 to GND trough a 10k resistor. Hope this will fix your problem...
I can't get the sketch to upload, it keep giving tons of errors.
i kept having errors too when I tried to upload it to my arduino micro and as soon as I gave up and used my uno all the errors went away.
eliobou1 year ago
Why a transistor ?
can i use a 2n3904 Transistor
How do people make circuit drawings like this one?
EdDruino (author)  4lifenerdfighter2 years ago
Hi, you can make drawings like this using CADsoft Eagle or, like i did, using a nice free and easy program called Fritzing
Ah, yes Fritzing. I couldn't remember the name. Thanks!