TV-B-Gone bike light mod
TV-B-Gone is a TV remote with only one button. When you press it, TV-B-Gone will cycle through 100 infrared off codes for most common TVs. Within at most a minute, most TVs you point it at should turn off (or on, as some off codes double as on codes).
TV-B-Gone was invented by Mitch Altman at Cornfield Electronics. It was released into open source, and later developed into a DIY kit with Limor Fried at Adafruit Industries. She also published a wealth of information on the TV-B-Gone kit : beautifully illustrated assembly instructions, explanations on the hardware, the software, and the rather involved process of collecting new TV codes. Nearly all of it applies to this mod. <--read it!
The "Smart E-Line" brand of battery-powered bicycle tail lights (RL403R) make a good casing for the TV-B-Gone kit. They are inexpensive and come complete with batteries, a button, and a bike mount. All that had to be done was to reduce the size of the circuit board to about a third to fit the light and its connectors.
The new board is single-sided and, like the original, fitted with through-hole parts, which are easier to solder than SMD parts. IMHO the board is well suited for first attempts in etching your own circuits.
To save space, some elements were left out from the original kit. No new parts were added. Omitted were
- the ICSP connector; not much of a problem as the MCU is socketed and can be taken out to be reprogrammed
- the diagnostic LED; function checks can be done by looking through an electronic camera, which are sensible to infrared
- the fourth IR LED - there was no space left. Still, three LEDs should give good range.
- the push button and battery holder, which are parts of the bike light
- "Smart E-Line" bike rear light (RL403R); switch button and batteries included
- circuit board:
- IC1: 8-pin IC socket to hold a
- ATTINY85V-10-PU - 8 pin microcontroller, DIP wired, low-power version
- XTL1: 8.00 MHz ceramic oscillator
- C2: 220 uF capacitor, 6.3V. I found a 100uF capacitor to work fine with the given 2-AAA power source.
- C1: ceramic 100 nF capacitor
- R1: 1 kOhm resistor
- R3: 10 kOhm resistor; this is the Europe/US+Asia region selector and should be left out if you are in the latter part o the world.
- 3x narrow beam IR LED, e.g. Everlight IR333-A. Narrow-angle LEDs are more suitable for this mod, as the bike light cover spreads the beam
- T1-3: NPN transitor, EBC pinout, e.g. 3904 or 2222
- Q1: PNP transistor, EBC, e.g. 2907 or 3806.
- Download and make the circuit board. I won't go into details on PCB making here, there is better advice around.
Drill the holes. Most are 0.8 mm, the resonator has 1.0 mm holes. Pre-drill the two mounting holes with 1 mm, then widen to 2.0 mm. These two also need to be countersunk: from the blank side of the board, use a 3.0 or 3.5 mm drill.
- In the casing, clip the little pin between the battery contacts
- Try to fit the board in the casing. Carefully file it down if it does not fit right away. Clean it before soldering.
- Cover the battery pads liberally in solder to make a better connection with the casing. This may get a little hot. If you are doing the always-on mod (see below) solder the battery wire first.
- put in the mounting screw under the IC socket
- Solder IC1, 8-pin IC socket, attention to the orientation of the notch
- solder XTL, ceramic oscillator
- solder C1, ceramic capacitor
- put in the second screw
- Solder C2, electrolytic capacitor. Its negative pole, marked with a white band, points towards the LEDs. leave about 3mm of clearance to the board, so you can reach the screw better
- Solder resistor R1, 1 kOhm, crossing the negative rail (the upper trace that connects to the outer pins of T1-T3).
- If you are in Europe, solder resistor R3, 10 kOhm. It serves as a selector for EU transmission codes over US/Asia codes.
- Solder the single PNP transistor Q1. Its flat edge points to the outer side of the board.
- Solder the NPN transistors P1-P3. Their flat sides points towards battery contacts.
- Solder the infrared LEDs. Their flat edges and short wires point to the inside of the board. Hint: The transparent red cover has three simple lenses. It may be worth a try to leave the LEDs standing off about 10mm off the board, and carefully bend them to be placed under the lenses. This is not strictly necessary but fiddling with it might increase the range.
- cut all the leads really short so that they don't interfere with the case. Retouch those that look bad after cutting with the soldering iron.
- check with a multimeter at least that there is no short circuit between the + and - rails.
- insert the batteries and the push button, screw the board into the case
- Put in the programmed ATtiny. The #1 pin, marked with a notch or groove, goes down towards the end of the socket which also has a notch.
- On pushing the button, the microcontroller should cycle through its codes now, which takes about a minute.
- Have fun.
The standard kit with the standard firmware will run all codes once on pressing the button, than go into a low power mode.
You may want a kit that is always on, running through the codes until the battery runs out or you switch it off.
For that, you need a slightly modified firmware and hardware:
- Cut the negative rail at the connector pad. You can drill a hole there, or file the copper away
- Cut the button contact part off. Cut close to the resonator contacts
- Solder an 8 cm wire to the negative connector
- Solder a 4 cm wire to the negative rail were the button contact was
- Screw in the board as usual
- Fit a single pole switch large enough to stick out, but small enough to fit besides the board. (MIYAMA MS-611 A with a 6x9 mm base fits)
- solder one of the wires to the middle switch pin, the other wire to an outer pin. The on position is diagonally adjacent to the outer pin.
- Glue the switch into place. There is only a small surface for glue, so high strength, two-component epoxy glue might be needed. Avoid quick dry glues like cyanoacrylates, they are too fluid, will get into the switch, and ruin it.
- Mark the on position on the case.
Programming the microcontroller
The software for the ATtiny is available at adafruit.com. To get it on the chip, you need a programming device, like e.g. the AVR ISP mkII. This is most easily done before putting the MC in the TV-B-Gone, and as a matter of fact the only way for the bike light mod, as it has no ISP (in-system-programming) connector. You can use the adaptor described here
Under Linux, running 'make' will build the software, 'make full' will flash it using avrdude. For the AVR ISP mkII you simply set:
AVRDUDE_PROGRAMMER = avrispmkII
AVRDUDE_PORT = usb
If errors occur during flashing, try to add "-b 1200" to AVRDUDE_FLAGS.
Layers in EAGLE
To print the board for etching, disable all layers but 16-18 (Bottom, Pads, Vias). Relevant for editing are also 19 (Unrouted), 20 (Dimension), 21 (tPlace), 23 (tOrigins), 25 (tNames) and 45 (Holes). For a commercial board maker, you also need 29 (tStop) not to put solder mask on the battery and button contacts.
TV-B-Gone and its modifications are distributed under Creative Commons Attribution, Share-Alike (CC BY/SA). This means that you are free to use this information for any purpose, including commercial ones, under two requirements:
- you are required to attribute the original creators and the name "TV-B-Gone"
- you are required to distribute your product under an identical licence and make it clearly visible you do so.
Neither did I write the software for this thing, nor invent the circuits; all I did was a new layout for the board, and that's about all I can potentially help you out with. So if you have any other questions, they are probably already answered at adafruit's great TV-B-Gone pages or their quite active forums.
Will there be kits for this mod? Probably not. Feel free to enquire at se (at this domain), but I don't expect a number of requests that would make this feasible for me.
se-it.eu, July 29, 2014