Big project of a multifunctioning tuning device
Used tools, methods and technologies:
This project was a effort to combine many aspects of making and signal theory together. A portable device that could perform many audio related tasks and visually display them. It could be a tuner, sound spectrum visulizer or a sound recorder.
Prep
I started with testing input microphone and posible Op-Amp circuit in the 6.week project. I also searched online for similar projects done before and if computing FFT (Fast Fourier Trannsform) is actually posible on a Arduino Nano procesor ATmega328. Another key assumption was, that I could fit all the needed connections on a one-sided PCB. That is not guaranteed, because I wanted to use and 8x8 LED matrix, OLED display and also an external power supply. I figured out, that everything could theoreticaly work and gave it a go.
First, I got a better Op-Amp design then before. It was clear that if I want a good audio for recording or analysis, I need filtration and a low-noise amplifier. Basic concept of the architecture is from a video by GreatScott. Thanks for a great video! I drew the schematics in KiCAD and made some costume symbols and footprints for the matrix and OLED display. Circuit parts and explanations can be found at the bottom of this page or here. Now the schematics:
Schematics in KiCAD. The matrix and display symbols are costume. Their footprints on PCB are too.
The PCB setup. This is the second version with many repairs and updates. It is still litle wonky, for example it uses the external LED matrix module to bridge GND and +5V over the Op-Amp section.
Manufacturing
When it was done, I exported the KiCAD project and opened it in FUSION 360 in CAM mode (manufacture). With the help of my teacher, I fixed dozen of problems and then then after 2 hours of fixing and CAM work it was ready to be made. We did it on a CNC machine Carvera Air which I used in week 4.¨ The material for creating the PCB was a 1.6 mm Cuprexit board with a thin layer of copper.
Use plenty of doublesided tape to attach the Cuprexit board firmly to the CNC bed.
CNC machine has many milling tools. This one is a 1 mm drill
Second tool, for removing copper layer in action. Swaping is done manually and is quite pleasing.
Here is a small cut to the second and final prototype I made, so the board is different and also not made alone. With my teacher we also applied a protective mask to protect the copper from oxidizing and shorting by external objects. It also made soldering a little easier. The mask is a photoreactive substance and we used Relife RL-UVH900R.
Applying mask (red paste) on the PCB.
The mask is distributed by a small roller.
A UV lamp hardense the mask for around 45. Then a second layer applied.
Troubleshooting
Then it was around 2 hours of soldering (the first time, the second I was done under an hour). The circuit worked right, which made me super excited. Then came the programming. I was not able to get the desired output, noise levels were high and the whole circuit was not nearly as sensitive as I expected. I spent too much time trying to make it work in software. The second day I went to an ossciloscope and with the help of doc. Petrucha we identified the problem. The microphone was ¨ overstaruted due to high supply voltage to it, around 4,8V . So I swapped the 1k resistor before it with a 5.6k, which produced around 3,7 V on the microphone and that worked well. We also changed the Op-Amp's amplification from 21x to 45x times by changing the old 47k input resistor to a 20K one. Those were the changes I made to the final design.
Soldering of the first prototype. I commited many "soldering crimes" during it but I pray to the soldering God for mercy and forgivness.
The beautiful final version with red mask/coating right before soldering. It wasn't perfect, three soldering pads got annihilated by the mask removing tool on the CNC. Zou can see them actually, its those three silver/like, bottom left.
Programming
Sound is recorded as a analog signal and then an FFT is used to get its spectrum. The Arduino Nano is not powerful enought to compute the whole FFT, it does not have enough memory for it too. But we can use a specific fix-point FFT to compute the spectrum at only specific frequencies. Precisely 64 of them. That gives us a idea about the amplitude spectrum and then we can use this information to approximate the tone that is being played. A simple scipt then displays the spectrum and tuning interface on the OLED display and LED matrix.
Front of the tuner, user interface. Casing can be seen in a video below.
Back with the Arduino Nano deattached to show paths beneath.
Lessons learned
Designing PCB for CNC manufacturing method requires some extra precursions and rules in KiCAD. I found out that you want atleast 0.6 mm paths and 0.4 mm spacing. You also have to check in Fusion 360 CAM all corners and holes for errors. Also be very careful with brushing the mask on pads away, it can easily brush away the copper layer too. And while soldering be gentle, strong impact can remove copper path and destroy your board. And finally, next time I will take more time than a week for such a big project. It was a rush and my sleep harmonogram was non-existing. Oh and to doc. Petrucha, I WILL learn how to operate ossciloscope, i promise!
The assambled device, back of the user interface but actually face of the copper and anti-soldering mask.
Parts List + explanations: