I’m working on a project that my dad left on the bench when he passed away recently. He wanted to control a group of LEDs and have them change colours when the guitar was plugged in and playing. He designed a custom board using the Atmega328-20PU and the MSGEQ7. I have the wiring diagram here. I’ve had no problem writing the code to get the LEDs to fire and work properly, but I’m having a problem with getting the code to read the proper frequency output of the guitar. I’ve attached the wiring schematic and have pasted the code below. My guess is that the MSGEQ7’s pins are not reading the frequencies properly in the code. Any ideas?
CODE
#include <AudioAnalyzer.h>
//Version 1.3 for Spectrum analyzer
//Please download the latest library from the Product page!
There are a number of things that should be changed / missin. it is indeed not ready. Missing the #include <AudioAnalyzer.h> and in the loop the Serial.print(max((FreqVal-100) should read at least FreqVal etc. Maybe best to look at other examples https://create.arduino.cc/projecthub/He … 0d40b7?f=1
Thanks for the feedback, paulvha! The link that you’ve shared is most helpful and I’ll be diving more into the examples tomorrow.
I do have to say that the original program does have the #include <AudioAnalyzer.h> at the beginning of the code. I’m going to check the loop with the Serial.prin(max((FreqVal-100) to better understand the FreqVal array.
At the moment, the biggest question that I’m having is how to properly designate the MSGEQ7 pins in the code. From the documentation I’ve been able to find for MSGEQ7, the pin designations are the following: 1 VDDA, 2 VSSA, 3 Analog Out, 4 Strobe, 5 Analog In, 6 Ground, 7 Reset, and 8 CKIN. Where I’m having some confusion is what pins to reference, the MSGEQ7 pins or the Arduino equivalents? The test code I believe was written by someone who was using the Arduino Uno board and so I’m not sure that the same pins that are referenced int he commented code are the same.
Additionally, I am able to get some signals coming into the circuit that measure the DC output of the bands. However, they form a continuous sine wave and therefore I think that my pin references in the code are incorrect.
Hi, I’ve spent a lot of time building guitar gear, (I’m 65) & the most important part of what you are trying to do is the analog front end. I know the EQ chip, but to dig a fundamental frequency out of something like a guitar, so rich in harmonics, I found the best way was to use a tracking phase locked loop with adjustable frequency tracking. You need good amplitude control first i.e. auto gain control, and then you do the zero crossing detection after removing as much of the higher harmonics as you can without affecting the fundamental. After that, is when you apply the phase locked loop circuit And it will need some degree of adjustment, because each guitar has a different harmonic content. In short, I found that this analog front end is the most significant part. Do you have anybody who can help you with that analog front end?