Giter Site home page Giter Site logo

amplifier-auto-shutdown's Introduction

Auto power off Stereo Amplifier if idle for too long

I wrote this program as I tend to forget the amplifier on and

  • given the tube has limited lifetime, I am always feeling bad when I
  • see it still on few hours later. Not to mention of course that we
  • can be a bit more green by preserving power.

The program is written for Arduino, basically reading left and right signals on Analog inputs (A0 and A1) from a line level

If no music is detected for some time (constant idleTimeToTurnOff) then the Arduino will send a power-off to a relay

Sampling the audio in every 2 seconds is reasonable and idle time is set to 5 minutes.

The audio sampling is not done in one shot, as we can randomly find the Arduino ADC measuring 0, so we sample 10 consequential on each channel (left and right). The detection uses simple max on all samples.

I found it mandatory to use a load resistor on the A0 and A1 since when the Nova amplifier is off, the ADC on the Arduino is reading very random numbers. Using the load resistor to ground (10K Ohm) made the samples on amplifier off to 0.

The Arduino have enough IO ports still, so I am taking some of the internal state and expose it with LEDs, please see below. These LEDs are optional and connect/assembly only if you like. These are the LEDs that I used:

 Pin   Meaning   LED
 ------- ----------- -----------------
 13    Power     (on-board)
 12    Playing   Green
 11    Idle      Yellow
 10    Amplifier Blue
  • The Blue LED will light up if the unit will detect the amplifier is on.
  • The Yellow LED will light up if the unit will not detect any music.
  • The Green LED will light up if the unit will detect music is playing.
  • The Power LED will be on by default and blink off on each sample.

amplifier-auto-shutdown's People

Contributors

k-zakhariy avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.