Out of frustration over TV stations and advertisers's intrusive actions raising volume during commercials, and inspired by Adafruit's tutorial on IR Detectors, I built a mouse trap with a Mic and an IR sending LED that could be set to a HI/LO level beyond which the gadget would send an IR code to either lower or higher volume if those limits were exceeded.

Attached are a couple of shots of the gadget.

It consists of a mic feeding an amplifier with adjustable gain and sensitivity ,with the output to an analog input of an Atmega328 programmed to send a pre-set HI/LO IR codes if exceeded.to an IR LED.

A 4Quad comparator compares the signal level with a voltage divider of 4 resistors adjusted to a logarithmic Db levels,and the output to 4 led's as volume bar.

The Two pots are for gain control and LCD backlight. A regulated 7805 power supply and indicator light are shown at the bottom right and a 6pin ISP was wired at top right to be able to reprogram the chip. A pin 13 red led by the IR LED shows IR activity

I was reading about "TV Be Gone"(TVBG), and a few thoughts came to mind about a match with my design above.

Your incorporating the code of a universal remote in TVBG caught my attention since my own gadget is burdened by the need to grab ,program and send code to potentially each of 5 sets at home, and eventually if the gadget is commercially marketed , the IR coding might potentially present a problem to the common, uninitiated and non technically minded crowd.

Questions:

1- Can TVBG chip be programmed with code for the ON AND OFF functions of the universe of TV's it covers, instead of just the OFF function, by the addition of another button ?

2- Is it possible to provide a chip to control VOLUME UP/DN instead of just POWER ON/OFF?

My thought then would be to incorporate TVBG in my design(with your permission of course) and triggering it with my sketch, depending on pre-settable volume levels instead of with the push buttons. ( The chip would need to have both the UP and DOWN set of codes and its sketch somehow be accessible to be triggered from my sketch)

Wrestling with my gadget in this and the TVBG forum I finally resolved the frustrations I had in grabbing and re-transmitting code in some of my TV's,using the IR LED Tutorial.

It turned out that the code transmission success is a function of both the pulse code, obviously, but equally important, the Carrier frequency.

The conventional carrier frequency used in the literature is 38Khz and the 10/3 on off periods producing that frequency.

Two of my TV's at home , a Sony and an RCA were particulary not responding.After hours of trials and research I came across SB Projects site http://sbprojects.com/knowledge/ir/rca.php stating that Sony Protocl typically uses 40Khz carrier for their remotes and surprisingly RCA Protocol use 56 Khz !

This necessitated modifying the coding of the sketch with a location switch to accomodate the two different locations and carrier frequencies.

A two way switch, reading the state of two pins on the chip, was my easiest way out but more locations could probably be handled with a rotary switch or such. Working on it, as well as the addition of two buttons for Vol UP and Vol Dn override buttons using interrupts .

Attchached are more recent shots of my gadget taken with a higher resolution camera. these will come in two posts since onl 3 attachments are allowed per post.