How to use 1452 or 1701 make a signal level detector to make LED has different brightness while signal strength change?

Hi,

I want to use 1701 and 1452 to make a level detector to detect the signal strength,

but I don't know how to use blocks to make led brightness will follow the signal strength.

The led brightness level will follow the signal strength, if signal is stronger the led will more bright, the other side, the lower signal level will cause lower led brightness

(I think this may use the PWM to make led bright level)

any tips for making this function?

Thanks!

BR.

Parents
  • +1
    •  Super User 
    on Apr 16, 2019 3:28 PM

         Hello Alvis,

         PWM can be done by comparing the signal in question to a ramp or triangle waveform.  The example shown below performs this function.  Incoming audio passes through a DC Block Filter to remove residual DC caused by the A/D converters -- use this filter anytime you're making level measurements; otherwise this DC, which typically measures about -45 dB, shows up with no input.  Peak Envelope blocks measure the left and right signal levels.  The Sawtooth Oscillator's output goes from -1 to +1; taking its absolute value provides a 1 KHz triangle wave spanning 0 to +1.  The two ABCD Comparatorsperform the PWM -- I show their logic inverted simply to make the schematic appear neater, and re-using the level signal for the logic "high"  level saves a DC source.  The GPIOs accept any nonzero input as a logic "high."  The attached project runs on a ADAU1701MINIZ board.

         Best regards,

         Bob

    PWM-1701-Level.zip

Reply
  • +1
    •  Super User 
    on Apr 16, 2019 3:28 PM

         Hello Alvis,

         PWM can be done by comparing the signal in question to a ramp or triangle waveform.  The example shown below performs this function.  Incoming audio passes through a DC Block Filter to remove residual DC caused by the A/D converters -- use this filter anytime you're making level measurements; otherwise this DC, which typically measures about -45 dB, shows up with no input.  Peak Envelope blocks measure the left and right signal levels.  The Sawtooth Oscillator's output goes from -1 to +1; taking its absolute value provides a 1 KHz triangle wave spanning 0 to +1.  The two ABCD Comparatorsperform the PWM -- I show their logic inverted simply to make the schematic appear neater, and re-using the level signal for the logic "high"  level saves a DC source.  The GPIOs accept any nonzero input as a logic "high."  The attached project runs on a ADAU1701MINIZ board.

         Best regards,

         Bob

    PWM-1701-Level.zip

Children