The TV-B-Gone was conceived by hack-hero Mitch Altman. It is designed emit the ‘OFF’ code for the majority of TVs in Europe and the US. Basically it is a TV remote control which only has the power button. It is designed to turn off inappropriate TVs, such as unwatched ones in public spaces. It is a commercial product, but Mitch has also worked with Adafruit industries to have an open-source design.

I am using v1.2 as shown on the LadyAda website. I had already programmed the ATTiny85 microcontroller, as mentioned in the previous post. This was built onto breadboard to check that it was working OK, but it did not include all the components, such as the IR LEDs.

The next stage was to build the circuit onto strip board. This would be the full design with all the components. My stripboard prototype is shown here – the layout is probably not optimal, but its small enough. I only used two IR LEDs, rather than 4 (as I only had two), but I added a red LED to show that they were working.

I have designed a PCB for this but wanted to prove that the circuit works before going too far and ordering a load of PCBs….

Top side of the prototype.

Solder side of the prototype.

I am in the UK so needed the optional 10k pulldown resistor on pin 6 of the microcontroller. This makes the EU TV codes run. If you are in the US then do not use this resistor and the US codes will be used.

I went out to find some TVs and try turning them off. I spent a while doing this but it did not work.

So now the fun fault finding begins. Firstly I have not been using exactly similar parts as the Adafruit design, due to the fact I did not have them and thought I had decent replacements. I hooked up the circuit to my oscilloscope and checked the waveform. The first thing I could see was that the power supply voltage was dipping down quite a lot when the IR LEDs were on. I helped to improve this by adding a 100uF capacitor on the power lines near the LEDs (I had only used 10uF). This helped a bit.

I checked the voltage across the IR LEDs and it was not swinging from +Vcc to ground, rather just being pulled down to around 2V (from a 4.5V supply). Hence the IR LED was probably not fully switched ON. SOLVED: This was due to the red LED used to indicate that the IR LEDs were working. The red LED would switch on at a lower voltage and then take a lot of the current and hence stop the IR LEDs working correctly. When the red LED was removed then the voltage applied to the IR LEDs was much better (in the region of 3V with a 3.8V supply (3 x AAA batteries)).

The other difference was the fact I had used different transistors: for the MPS2907A PNP, I used a BC558 PNP and for the 2N3904 NPN, I used a BC548 NPN. I checked the datasheets for differences, mainly related to the collector current.

1

2

MPS2907A can cope with600mAof current,but the BC558 can only cope with100mA-Thiscould be an issue.

2N3904can cope with200mA,but the BC548 can only cope with100mA-probably less of an issue?

The last issue could be that I had used a 330ohm resistor for the PNP transistor base, rather than the 1k suggested. SOLVED: Differences in the transistor make very little difference, as long as they can cope with the currents required. I swapped the BC558 for a BC640 PNP transistor, which can deal with 1A of current.

The TV-B-Gone still did not work, even with these changes.

I checked to see if the IR LEDs were working. This can be done using a digital camera as this will show the LEDs flashing a purple colour (cheaper digital cameras are sensitive to infra-red light). I did this and saw that I was getting flashes of light, so the IR LEDs were working.

Using a phone camera to see the flashing IR LEDs

Image from the phone camera – purple/violet colour flashes.

So we have a very-close-to-working circuit that still does not switch off any TVs. This needed more reading up. When I read the actual c file of the main code I hit upon one answer. Basically I had not changed any of the fuses on the microcontroller. This meant the device was still using the internal RC oscillator. In order to get accurate timings an external crystal resonator is used (on the Ladyada forum the answer is “always use a resonator or crystal”).

Also, by default, the microcontroller comes with the oscillator ‘divide by 8’ fuse set ON. This means with an 8MHz crystal we are running the code at just 1MHz. This might not matter in some situations, but here timing is critical. With both the 8MHz external oscillator used and no divide by 8 the the device worked! Great. Now to turn off TVs.

Firstly click on Tools -> AVR Programming. This will bring up the above pop-up. Set the device to ATtiny85 and using the AVR Dragon. I needed to lower the ISP clock frequency to around 64kHz to get it to work reliably, but that might have been due to the length of the programming wires (now sorted out and much shorter).

Click on ‘Memories’ and browse for the flash memory. Point this to the TV-B-Gone firmware v1.2 .hex code and click ‘program’. Hopefully it should work. If not take a break and then check your wiring (honestly the break helps).

Next click on ‘Fuses’ and then click on ‘Read’. This should show the above setting for a ‘factory fresh’ microcontroller. Note the CKDIV8 is enabled and the SUT_CKSEL is set to internal oscillator.

The above photo shows the correct fuses to set – de-select the CKDIV8 and select EXTXOSC_3MHZ_8MHZ_16KCK_14CK_65MS for the clock select drop down menu. Set the fuses after programming or else you will not be able to use the AVR dragon to directly program the microcontroller again as the fuse means it will be expecting an external oscillator. You will need to use the ISP lead onto a board with power and an actual oscillator. I set the clock to be ‘external’ on one of my Attinys which now means I cannot program it without setting up an external clock source.

Here are some pictures of the final prototype which was used to turn off the TVs in my local Argos:

I have designed a PCB and will be getting some made up for a soldering session at Nottingham hackspace. Contact me if you would be interested in getting a full kit of parts with a programmed IC for £15 delivered within the UK, or click on the Buy It Now button below:

The Renewable Energy for Development group, part of The Centre for Renewable Energy Technology within Loughborough University, work on access to energy services for the 1.3 billion people without access to reliable energy supplies. They were working on mini-grid projects based in Kenya and in Bangladesh. These solar PV systems provided renewable energy for communities … more

Wild Stoves supply equipment for efficient outdoor cooking on wood. They run workshops on efficient burning of wood and sell equipment at a number of festivals over the summer. They wanted to be able to provide electrical power for the festivals they attend, but wanted all the equipment to be portable, all parts to be … more

Engineers Without Borders UK (EWB-UK) is a student run organisation trying to connect engineers with the field of international development. They do this through placements, training and outreach programs. We have run a number of solar photovoltaic and off-grid power hands-on workshops for various groups, including EWB-UK. This workshop was for the EWB- Sheffield branch … more

This was a practical workshop on solar photovoltaics as part of a day-long event relating to Energy and International Development. This course was organised by Engineers Without Borders UK and funded by the Royal Academy of Engineering (RAEng). The workshop was provided for the Royal Academy of Engineering’s engineering leadership award scheme, with around 20-30 … more

One response to “TV-B-Gone construction”

HI,
I was back in Ireland over the Christmas and your tv-b-gone was widely admired. They’ve got the same problems with TVs in pubs as we do here.
I got a few requests from buddies to make some up.
So… would you be willing to sell me three PCBs, if so, how much?
Peter G.

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Website

Re-Innovation

Renewable Energy Innovation specialise in electrical and electronic systems for renewable energy projects, mainly solar, wind and micro-hydro. We focus on renewable energy based stand-alone power supply systems (off-grid systems). This includes power and energy monitoring, battery charge control and wiring systems. Please contact us to talk about your project. If you require consultancy, design and implementation services for your renewable energy project please contact us.

Curious Electric Company

The Curious Electric Company specialise in creating electronic kits that help you monitor and measure the world around you, with clever data loggers and sensors you can take the pulse of your planet, collect and share data and knowledge with the world. Be informed - stay curious!

Bespoke Gear

Our sister business, Bespoke Gear have been building interactive pedal-power systems for over 15 years. Doing events and selling equipment to a wide variety of customers in that time we have learnt what works. We design and build high-quality, robust pedal-powered equipment and bespoke, interesting and interactive displays. If you are trying to promote environmental awareness, energy efficiency, getting people fit or just want something thats a bit different for your event then we might have something for you.