sdc0jm
Published

Radio Back Light and Sound Indication Light for Zenith Radio

Consistent sound toggles LED to stay on, after 10 seconds of silence, toggle off LED. Tuning Eye now a sound meter-ish.

BeginnerFull instructions provided911
Radio Back Light and Sound Indication Light for Zenith Radio

Things used in this project

Hardware components

DC-to-DC Solid State Relay
×1
Arduino Nano R3
Arduino Nano R3
×1
Halogen Track Bulb Replacement LED Bulb
×1
DAOKI 5PCS High Sensitivity Sound Microphone Sensor Detection Module For Arduino AVR PIC
×1
Adjustable Step-Down Power Module
×1
Green flash light /Torch
×1
Multi-Turn Precision Potentiometer- 1k ohms (25 Turn)
Multi-Turn Precision Potentiometer- 1k ohms (25 Turn)
×2

Hand tools and fabrication machines

Amazon Alexa Echo
Drill / Driver, Cordless
Drill / Driver, Cordless

Story

Read more

Schematics

Radio lighting circuit

Radio lighting circuit

Code

Zenith Radio Console lighting

Arduino
Arduino sketch
#define LED_ON_TIME     10000ul //10000mS == 10-seconds

#define LED_OFF         0
#define LED_ON          1
int pinOut = 4;
int led = 8;
int DogBark = 0;                                                              


const byte pinSensor = 2;   //whatever pin you're using...
const byte pinLED = LED_BUILTIN;

unsigned long
    timeLED,
    timeNow,
    timeIDOL,                     
    totaltime;

byte
    stateLED;

void setup()
{
     Serial.begin( 9600 );
    pinMode( pinSensor, INPUT );    //INPUT_PULLUP if device is OC
    pinMode( 4, OUTPUT );
    pinMode (8, OUTPUT);      
    pinMode(LED_BUILTIN, OUTPUT);

    stateLED = LED_OFF;

}//setup

void loop()
{
    timeNow = millis();
     if( digitalRead( pinSensor ) == HIGH )                                    
   {
    digitalWrite(led, HIGH); // Eye Light on  
   } 
    switch( stateLED )
    {
        case    LED_OFF:
            if( digitalRead( pinSensor ) == HIGH )                    
            {
            DogBark++;
            if( DogBark == 1 )                                                              
            {                                                                                      
              timeIDOL = timeNow;                                                                     
            }                                                                                         
            Serial.println((int)DogBark);                // Sharp instances of sound that may trigger the dial light are filered out, only a couple of "barks" per time IDOL seconds.
            if( DogBark >= 100 )             // Adjust microphone sensativity when playing music,  Suggest Setting Echo volume to 3 or 4 when tuning                                                               
                //yes; turn on LED and set timer
                {
                 DogBark = 0;                                                                 
               digitalWrite( pinLED, HIGH );
                timeLED = timeNow;
                //then move to ON state
                stateLED = LED_ON;
                digitalWrite(pinOut, HIGH);
             }                                                                                           
            }//if
        break;

        case    LED_ON:
            //whenever sensor shows high, reset LED on timer
            if( digitalRead( pinSensor ) == HIGH )
                {
                  timeLED = timeNow;
                  totaltime = timeNow - timeLED;
                  digitalWrite(pinOut, HIGH);
                }             

            //when ontime has expired, turn off
            if( timeNow - timeLED >= LED_ON_TIME )
            {
                digitalWrite( pinLED, LOW );
                digitalWrite(pinOut, LOW);
                stateLED = LED_OFF;
               
            }//if
  
           break;
                                                                                  
    }//switch
               digitalWrite(led, LOW); // Eye Light off  
             if( timeNow - timeIDOL >= LED_ON_TIME )                                                              
            {                                                                                      
             DogBark = 0;                                                                
            }                         
                                                                         
}//loop

Credits

sdc0jm

sdc0jm

0 projects • 0 followers

Comments