I was asked by a friend to build a simple circuit to have a light flash depending on the bass of a song (mainly techno music).

This is my idea:


The circuit works on 9V to be powered either by battery or power supply. The audio comes from X1 (a 3.5mm jack port) and goes through a LC bandpass filter comprising the 10kOhm pot (to control the "steepness" of the filter), 453 mH inductor and a choosable capacitor to change the central band of the filter.

The filtered signal is biased by the R4-R5 voltage divider and amplified by the first half of the LM358 (gain controlled with the 1kOhm pot). The amplified signal is decoupled by C4 and rectified by D1. This causes only the bass "bumps" to come through. Moreover now the signal can be amplified further by the second half of the first LM358. In this case the gain is fixed and decided by the 10K trimpot.

At this point the signal is split in two rails, each one going to one half of another LM358 used as comparators. The top half is a fixed comparator and drives a LED when the input voltage is over 7.5V. This is close to the maximum allowed voltage of the amplifier and works as a sort of warning that the amp is getting saturated. The other half of the LM538 is the comparator that drives the light by activating a relay. Additionally a LED is present to give an idea of the output signal.

I am already aware that probably I will need a transistor to properly drive the coil of the relay but I'm still in prototyping stage and I still don't know what type of light will be attached at the end (LED, strobo, ...).

So now to the actual question(s).

1) are there any evident flaws in the design? I tested the circuit and works fine but maybe some of you can give me some feedback

2) since I want to make a nice PCB for my friend but I don't have any experience in designing PCBs, are there any points I should be aware of when laying the PCB out? BTW I'm using EAGLE for the design.

  • \$\begingroup\$ Are you using a relay to switch lights on and off multiple times a second? Or is it on if music's playing and off if not? \$\endgroup\$ – DiBosco Jan 30 '18 at 17:44
  • \$\begingroup\$ The 1st flaw is lack of design specs to compare results. BW, attack time, decay, linearity , output? \$\endgroup\$ – Sunnyskyguy EE75 Jan 30 '18 at 17:44
  • \$\begingroup\$ @DiBosco If you imagine the spectrum of a song (whichever), it switches on when the beat "starts" and off when the beat "ends". For the general techno song I would assume 100-120 bpm (beats per minute) \$\endgroup\$ – Luca Jan 30 '18 at 17:49
  • \$\begingroup\$ @TonyStewart.EEsince'75 you know.... beats .... 1 Hz - 3Hz. Seems to me a PLL would work, so long as you can phase-lock onto the beat leading edge. \$\endgroup\$ – glen_geek Jan 30 '18 at 17:49
  • \$\begingroup\$ Input Caps are reverse polarized. Pots have no RefDes and change RC response with gain \$\endgroup\$ – Sunnyskyguy EE75 Jan 30 '18 at 17:53

are there any evident flaws in the design?

I can only see one error: -

enter image description here

  • \$\begingroup\$ doesn't need it. I want to amplify just the positive part of the wave to get maximum amplification. I don't really care for the negative side \$\endgroup\$ – Luca Jan 30 '18 at 17:52
  • 2
    \$\begingroup\$ @Luca Don't you see why Andy's comment still applies, even given your desires here? \$\endgroup\$ – jonk Jan 30 '18 at 18:00
  • 2
    \$\begingroup\$ Hint: One of the lines in your op-amp's datasheet is "input bias current". \$\endgroup\$ – The Photon Jan 30 '18 at 18:02
  • \$\begingroup\$ @ThePhoton so I should put a 100-odd kOhm resistor tied to +V to get some current into the input pin? \$\endgroup\$ – Luca Jan 30 '18 at 21:31
  • \$\begingroup\$ @jonk my point being, on a breadboard the circuit works. Someone cares to elaborate why? \$\endgroup\$ – Luca Jan 30 '18 at 21:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.