Outputs

Big project of a multifunctioning tuning device

Used tools, methods and technologies:

  • Arduino Nano microcontroler
  • Microphone, LED Matrix and a OLED display
  • Kicad, 3D printing, small CNC machining
  • Less sleep than a humming bird

     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

Project Image

     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:

Image 1

Schematics in KiCAD. The matrix and display symbols are costume. Their footprints on PCB are too.

Image 1

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.

Image 1

Use plenty of doublesided tape to attach the Cuprexit board firmly to the CNC bed.

Image 1

CNC machine has many milling tools. This one is a 1 mm drill

Image 1

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.

Image 1

Applying mask (red paste) on the PCB.

Image 1

The mask is distributed by a small roller.

Image 1

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.

Image 1

Soldering of the first prototype. I commited many "soldering crimes" during it but I pray to the soldering God for mercy and forgivness.

Image 1

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.

Image 1

Front of the tuner, user interface. Casing can be seen in a video below.

Image 1

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!

Image 1

The assambled device, back of the user interface but actually face of the copper and anti-soldering mask.

Parts List + explanations:

Arduino Nano R3
     • Microcontroler (MCU), a bit of a overkill, but since its sitting in headers, its easily removable to use in other projects. Can be powered by integrated USB mini B or by a same USB power supply located on the board.
          - Nano V3.0 R3
          - Headers
Condenser microphone with OP-Amp and filtration
     • Microphone is powered by 5V that is brought down to around 3,7V by 5,6K Ohm resistor. A pair of parralel 470nF ceramic capacitors coupled with 20k Ohm R does some high-pass filtration and removes DC offset from the sound signal. Low-noise operational amplifier OP27GSZ is connected to 5V and GND. This is possiable, because its reference is 2.5V, which are supplied by a simple voltage divider of two paralel 10k Ohm resistors. Its feedback loop consists of a 1M Ohm resistor with a 10pF capacitor for low-pass filtration. Finally a big THT 22uF capacitor stabilizes the 5V supply.
          - Condenser Microphone
          - OP27GSZ Low noise Op-Amp
USB Power Supply
     • For powering the circuit with 5V. Max current is 2A given by the USB port, thats more than enough. Only powers the MCU and from there, the power is distributed throughput the board
          - USB Mini 2.0
          - Switch
OLED 128x64 display
8x8 Matrix module with MAX7219