Turning On PC Speakers Whenever There Is Music Playing

If you’re like a lot of people, most of the time your computer speakers are on without actually playing any music. This wastes a bit of power, and [Bogdan] thought he could create a circuit to cut down on that wasted electricity. The result is a very tiny auto-on circuit able fit inside a pair of speakers.

The circuit is built around the ATtiny13, very nearly the smallest microcontroller available with an on-board ADC. When music is played on the computer, the ATtiny senses a bit of voltage in the audio line and switches a relay to power the speaker.

Of course, there is always the problem of music with a high dynamic range; if the sound played from the computer has too low of a volume, the ATtiny might turn the speakers off even if music is playing. [Bogdan] solved this problem by adding a timer to his code; if nothing is detected by the ADC for three minutes, the speakers turn off.

44 thoughts on “Turning On PC Speakers Whenever There Is Music Playing

    1. You’re correct, though the difference here of course is that he is powering off “external” speakers.

      Presumably this is a typical external speaker set which is plugged into a power brick or has some transformer built into it, this circuit is just switching that on/off.

      I didn’t notice if he did any analysis of the power consumed before/after. So do the speakers actually consume much less power on (but silent) vs. off (but still plugged in). How much add’l power does this small circuit consume.

      Switching his external amplifier to something more efficient (like Class-D) might make more sense from power saving point of view.

      1. The circuit here is powered from a computer’s usb port. The relay turns on the whole amplifier(including transformer). So when it’s off, the power consumption is zero.
        The circuit itself consumes less then 10mA (Tiny + LED) when monitoring the signal. And it is totally off when the computer is off.

      2. I’ve got an old set of analog 5.1 computer speakers. When on but no audio you can turn it up and listening carefully you hear the static noise. Anyway, it pulls around 15W with no audio.

      3. It should be noted a lot of (all?) laptops implement this. My two year old laptop does a reasonable job of capturing fast mouse click buzzes etc then going back to ‘sleep’. I’d be curious to know how they do it (in software?).

      4. I’ve thought about building something like thi for a while. My surround sound system draws 40w on standby, 50 on but silent.

        The difficulty for me is the circuit would need to recognise a signal not just on analogue audio lines, but also coax and optical digital lines; I suspect any simple circuit would damage the audio signal.

  1. Nice idea. As a person who works for a PC audio company–this the same concept as power management for the audio chip itself (power it off when not in use). We of course have the ability to actually know when the OS is attempting to play or record audio, but otherwise it’s about the same.

    Reducing pop’s and missing fractions of a second of the audio from the start-up (particularly very short sounds, like the click of a mouse on a folder) is somewhat of a challenge under the best circumstances, so I would imagine it is here too, but probably not one that matters to Bogdan.

    1. seems like a transistor or two and a counter would be able to do the same thing… but then the cost of the uC might well be less, unless you already had those bits in your junk drawer…

      Either way, nicely done.

    2. I have no idea if it is the most practical solution. But it is the most flexible. It is terribly easy to change the timings and threshold level.
      Building this circuit with analog parts, timers and counters makes it more complex(more parts) and it might not be less expensive.

  2. Assuming the 20-watt speakers on my desk right now (powered up, thank you), and the average $.10/KWh BGE charges residential customers (this is at the office, so probably it’s running a bit cheaper, but why not make a generous estimate?):

    .02KWh * ~$0.10/KWh = $.002/h * 24 = $0.048/day.

    Rounded up, it’s costing me not more than five cents a day, or $.70 per two-week pay period, to leave my speakers on 24/7. Dunno what Bogdan’s using, but it doesn’t look from the pix like they’re all that much bigger than these old chunky ones I’ve got, so it can’t be eating that much more unless he’s powering them from an incredibly inefficient wall-wart supply. (You know, like I’m doing!)

    Neat hack, tho.

    Also, before twenty people babble at me about how fun can’t be valued in dollars and cents, &c., &c. ad naus. — no argument. But “burning a lot of power” seems like it might be significantly overstating the case. (I’m also curious how the parts cost amortizes over the cost of the power this hack will undoubtedly save. Again, yeah, I know, how awful of me to think about mere money in a context like this one. Still curious, tho.)

      1. Fair enough. In my case, leaving the speakers on costs not more than $18.20 a year — which, coincidentally, is about a dollar less than my gross pay per hour.

        $3 in parts? You must buy in bulk.

      2. Dunno, kendall14. The ones I’m talking about haven’t been powered off, except during outages, for well over half a decade; they were at least six or eight years old before I started using them, and they’re still going strong. It may be that the built-in amplifier shuts off when it’s not getting a signal…

        (I’d also note that, while again it’s a neat hack, it wouldn’t actually help with the speakers I use, since thye’re powered by a wall wart — whether the amp is powered or not, the wall wart’s still sucking power as long as it’s plugged into the wall. That doesn’t appear to be the case for Bogdan’s speakers, judging by what appears to be a transformer next to the protoboards in his picture, but it’s worth noting all the same.)

      3. I do buy parts in larger quantities, but not extreme ones. Tiny13 drops to about $1 per piece if i buy at least 5.
        SMDs drop to about $1 per 100 0805 resistors, a little more for caps.
        5×7 cm boards are $4 per 10 pcs on ebay.

      4. @Kendal114 – Not entirely true, it is switching on and off that causes most wear on electronic components due to heating and cooling causing thermal stress. There have been quite a few studies into this effect including some done by google about the hard drives in their huge data centres

  3. I had a set of external speakers with this built in. Problem was that they took about a second to turn on, so all the small windows sounds (getting an IM, etc.) wouldn’t play.
    And my current sound system takes even longer to turn on.
    But maybe I could adapt something like this to switch between a low power speaker for “windows” sounds and my primary system.

    1. I actually used a 3s timer specially to avoid turn on because of the sounds. On my computers they are usually turned off, but some “escape”.
      A good idea is to use a small amplifier, powered directly off the USB and switch between this one and the power one when there is music/movies.

  4. @Aaron
    While working an hour of your life each year for nothing may not bother you and the cost savings seem minimal, think large scale and multiply the wasted power by millions. And the effects of generating this power, too..

  5. This could also be used to automatically switch between sources sources.
    Say you feed all the in’s to the A2D and then once you detect a level you do a scan on all the inputs until you find the one is on and switch it to the speakers and turn them on. To save power you could use a schmidt trigger to wake the chip from sleep as well.

  6. May I humbly suggest the 3 minutes is extended to 4 minutes 33 seconds. Three minutes is insufficient to render John Cage’s masterpiece correctly. ‘Playing’ 4’33” with the speaker switched off would be like performing the piece without an orchestra. That this is unsatisfactory needs no explanation.

  7. My speakers have such feature built-in and I’m constantly fighting with them to turn on, especially when the sound is very low. But it’s definitely better than leaving them on constantly. When you add all the devices in a house that never really turn off you add up to a lot of wasted energy.

  8. As others have noted already this seems like a bit overkill for the amount of power it saves.

    I did note in the replies that it was mentioned that these speakers are USB powered. That means the savings are almost in the noise level. Your computer’s power supply uses pretty much the same amount of power when an additional load (the speakers) are turned on. It is not a linear relationship.

    What does make sense is powering your speakers via USB, or some other tap off of the computer’s power supply and eliminating an external brick. Bricks are far less efficient than power supplies, they’re (generally) powered 24/7, and always consume a little power when they’re plugged in.

    I added a 12V power jack to my computer’s case (just tapped it off of a spare power connector) and wired a simple cable from that jack to my speakers. While the speakers receive power whenever the computer is turned on, it’s still far less power than the original brick which came with the speakers.

      1. So how are the speakers powered? A wall-wart or a power supply with an on-off switch?

        If you actually switch the AC power source completely off (no ‘vampire power’) then this circuit makes sense. But if the transformer’s still connected to an AC outlet then it’ll continue to draw power 24/7 whether or not there’s any sound – and whether or not the computer’s even on.

        I’ve replaced wall-warts which power accessories for my computer with jumpers which connect to my computer’s 12 volt power supply. That way the accessories only draw power when the computer’s on.

      2. Indeed, i did not provide enough info. The speakers themselves are passive, driven by an amplifier, which is in a separate box, also containing the required transformer. The circuit was mounted inside the box and it switches the mains, meaning that there is absolutelly zero power consumed by the amp when off.

  9. Interesting project.

    My desktop speakers have an internal transformer and the power switch is after the transformer, ie not on the mains side, so I imagine they’re still drawing power when off.

    I’ve thought about wiring in a switch on the mains side but I can’t find any specs for the speakers.

  10. The Micro-Controller + Relay combination on a Circuit Board will work GREAT for a 2.1 or 5.1 Speaker System with a Sub-Woofer, That’s attached to a Television or a Boom-Box.
    I have a LED TV, which doesn’t have ANY bass to speak of. Hence I attached a 2.1 Speaker System, thereby gaining impressive sound & bass that’s great for movies.
    However, I am concerned that leaving the entire setup on 24*7 will not only continue to draw power when idle, but will strain the components as well (I can hear the “hiss” of speakers when they are On, Connected, But with the source silent).
    I live in India & electricity is VERY Expensive, not to mention erratic & “impure”.

    1. Just an addition:
      Assuming the speaker system is connected to a power-brick, what modifications do you suggest to the setup so that it draw powers from an electrical outlet instead of a USB port? As evident, I am looking for a solution that switches off the surround sound system completely, when the TV is on standby.
      UPDATE: I could use the idle USB port on the TV to power the setup as is, but I also want to connect another 2.1 to a boombox that’s powered via an electrical outlet & doesn’t have a USB port.

      1. I assume that the amplifier is powered by a DC brick (normally they are). In that case just use a regulator to step down the voltage to 5V for the microcontroller, a 7805. The most economic way to use it would then be to use a relay for the specific voltage on your psu.
        What speakers are we talking about?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.