Looking to make a frequency detector.

Discussion in 'The Projects Forum' started by athrowawaythought1, Jan 24, 2016.

  1. athrowawaythought1

    Thread Starter New Member

    Jan 24, 2016
    I'm trying to make a frequency selector that selects between 5-10 different frequencies. There will be a mic, an amplifier, a set of bandpass filters, and sets of LEDs that correspond to each filter. The goal is to play a relatively pure tone into the mic, and have a certain set of LEDs light up which will be telling of the frequency of the tone. I want each filter to have a range of around 100Hz.

    If I play a tone of 250Hz, the set of LEDs that correspond to the 200-300Hz range should light up.

    Can this be done by having bandpass filters leading up to LEDs, or is there more to it than that? How can I make sure that the filters only select frequencies inside a 100Hz range? I think this will have something to do with quality factor and bandwidth but I only have a vague idea.
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012

    You are talking about a "band pass" filter. All band pass filters have a range of frequencies. The narrower that notch of frequencies that are allowed to pass, the more difficult to build.

    Also, the notch of frequencies passing is like a Gaussian distribution. That means the with of the peak loos the same if you always measure at 50% of the peak intensity. However, if you always want to look at 1V level as a trigger point threshhold (to turn LEDs on vs leave them off) your sensor output will depend on the intensity of the incoming signal.

    This is a difficult project if those specific frequency bins are important.

    If you want one more related to music and the more typical range of musical notes, there are pre-made ICs that do this but the circuit design (IC output) is not straightforward to a new circuit designer.

    By the way, the output is commonly called a graphic equalizer. Although it does not equalize anything, it measures the levels of various frequency ranges and sends those levels to a visual display (so you can see the frequency response of upstream filter or amplification changes) - Much like the multi-channel graphic equalizer on component stereos of the 1980s.

    One chip is MSGEQ07. Here it is on a breakout board so some of the smaller bits are already included for you. There is still more needed, you cannot just add it to your LEDs. Google datasheet for this EQualizer chip to see frequency bins used.

  3. athrowawaythought1

    Thread Starter New Member

    Jan 24, 2016

    Thank you for the reply.

    I didn't realize it would be so difficult to do what I wanted. This is my first major electronics project and I'm really only doing it for the learning experience. As such, I'm not worried about meeting the specifications of my original post exactly as I wrote it. I kind of just guessed a range of 100Hz and don't mind if I have to increase that range in order to make the project more approachable. Also, I don't want to use any IC that is specifically made for frequency detection because won't that just do all the work for me?

    What frequency range is easily achievable with band pass filters? I'd prefer 100, but i suppose anything less than 1000 would be fine as well.
  4. dannyf

    Well-Known Member

    Sep 13, 2015
    That would be one way of doing it - opamps are great for this;

    It can also be done with counters; or simpler yet, with a mcu - but it requires programming.
  5. GopherT

    AAC Fanatic!

    Nov 23, 2012
    Filtering works best in multiples, not additive. What ever your first gap is, the next gap should be just as many time bigger than the first step.

    100, 300, 900, 2700, 5600 would be good bins. This is also how your ear hears tones. A middle C is twice the frequency of a C from the next lower octave.

    Then you need to google band pass filter calculator to figure out how to design a series of them. You are talking about 15 caps and 15 resistors for each passive Twin-T filter. A passive filter may not be narrow enough of a band gap for you so that adds complexity. You will need more component for an active (op amp) filter. Doing it will transistors will be a nightmare.

    Then you will need some type of IC to do a voltage compare (whether or not to light the IC) - lkely a comparator or Op amp. IF the input voltage from the filters is too small after filtering, you may need to amplify it (another IC, likely an op amp).

    Then you will need some type of sample-and-hold amplifier, or peak-detector, or envelope filter to make sure you can see the lit LEDs otherwise they will be flashing at audio frequencies and not be very visible. This will take another op amp with diode and capacitor. If you go the sample-and-hold or peak detector routes instead of the envelope filter, you will need a reset function built with a astable multivibrator (another op amp or dedicated timer IC) to drain the sample-and-hold amplifier on a regular basis.

    Finally, you will need some type of power amplifier or pass transistor to supply power to the LEDs of each color if they are more 15 mA of power.

    This will take some time and effort. Not exactly something you want to build ( with 5 or 7 channels of frequency bins) on a breadboard.
  6. hp1729

    Well-Known Member

    Nov 23, 2015
    Perhaps something like an LM567. There must be newer stuff out there. Intended to be a frequency detector by design.
  7. #12


    Nov 30, 2010
    Here's an AGC amplifier to keep your input signals at the same voltage before you detect their frequency.
  8. athrowawaythought1

    Thread Starter New Member

    Jan 24, 2016

    That....is a bummer. I thought this would be the perfect project for me. Something that I can quickly design with a beginner's understanding on filters and amplifiers. But I guess I underestimated the difficulty of it. Can you recommend something along the same vain that would be doable on a breadboard?
  9. ian field

    Distinguished Member

    Oct 27, 2012
    You can use an op-amp in a gyrator circuit for each bandpass filter. It electronically simulates inductors that would otherwise be too cumbersome for audio work.

    A lot of commercial graphic equaliser use this method, some guitar pedals get away with single transistor gyrators for frequency band boosting. You may be able to get example service manuals with a bit of searching.