Close
0%
0%

Accesible Guitar Tuner

A guitar tuner with audio feedback for bind guitarists

Similar projects worth following
A year ago I had a random encounter on Reddit that resulted in me making a guitar tuner for blind people. I made 3, and sold them on Tindie. They where the most simple thing you'd imagine, and not very reliable or user-friendly. Now, armed with the feedback on the first version, and with several people on the waiting list, I'm working on a new and improved version. It will support headphone output and either a microphone clip, or the direct output from an electric guitar. Both the software and hardware are completely redone to improve reliability and usability.

Music is of course an activity extremely suited for visually impaired folks, as it relies primarily on hearing. However, one major stumbling block is the tuning of your instrument.

For people without absolute hearing, there currently does not exists a good solution. There is an iPhone app that I've heard mixed things about, and some desktop software that is not suitable for tuning in many situations away from the PC.

Most experienced players that I talked to learned to tune by ear, because normal tuners use some LEDs or an LCD display for tuning feedback. But even they indicated interest in an easy to use portable tuner.

This tuner takes input from a clip microphone, and drives a headphone with an easy to distinguish clicking sound that indicates how closely in tune you are.

It takes its core functionality as an opportunity to innovate on the algorithmic side of things and I discarded the FFT frequency-domain based approach common to many guitar tuners. By modulating the input with a reference tone (much like your FM radio), the frequency difference between the input and reference can be extracted an synthesized into a clicking sound. This can be done in real time with very little CPU and memory.

The business plan for this project is very simple: Put it on Tindie and hope for the best. There are already people on the waiting list, so while I don't expect to get rich, I should sell at least a couple.

Hackaday Prize finals!

My tuner made it to the finals of the Hackaday Prize! Here is what that means and what I've been doing since then.

I won a thousand dollar, which I will put towards further development of this product. Part of it will be development costs (PCBs, components, and maybe a few new tools), part of it will be used for the first production run (starting small of course), and part of it will be put on Bounty Source to try to find contributors.

Bountysource

Over the summer holiday I worked on this project almost full-time, but now that university has started again, I have very little time to move the project forward. Since I made it to the finals, I spent all my time on debugging the current PCB revision.

So I'll be posting some bounties on the issue tracker to solve some problems for which I lack the time or experience to solve them quickly. Please get in touch if you think you can help so I can provide you with a PCB and anything within my power to get you started!

OrderDetail.csv

Farnell order corresponding to BOM

ms-excel - 11.44 kB - 09/20/2017 at 06:17

Download

tuner.csv

Bill of Materials

Comma-Separated Values - 3.33 kB - 09/09/2017 at 11:55

Download

  • V2 is live on Tindie!

    Pepijn de Vos08/22/2018 at 18:54 0 comments

    After a long time, and a completely redesigned case and major changes to the software, it is finally ready!

    Check it out: https://www.tindie.com/products/pepijndevos/accessible-guitar-tuner/

  • Case

    Pepijn de Vos02/27/2018 at 14:52 0 comments


    A friend helped me design this beautiful 3D printed case for the tuner. It looks really pretty, but there are plenty of problems left to solve:

    • How do I smooth the texture? (wilt alcohol, I've heard)
    • How do I make everything fit? (some holes are still wrong)
    • How do I close it? (the screw holes are not good enough now I think)
    • How can I make more of them? (University's design lab doesn't allow that)
    • How much will it cost?

    Especially the last item is a concern. Making a prototype at the university is free, or only for material costs, but on 3D hubs this case seems to cost 20 Euro, easily. That's not viable. Maybe I need to look into laser cutting?

  • Third revision PCB

    Pepijn de Vos02/19/2018 at 20:33 0 comments

    It's finally here, the third revision! With the help of a few contributors, I now have a working input and a 3D printed case!

    They key realisation was that instead of doing this broken automatic gain stuff it would be much simpler to get an ADC with sufficient range for all inputs. This greatly simplified everything. On top of that I also replaced my broken MOSFET output stage with an integrated D-class amplifier chip.

    The new PCB pretty much worked right away, so then all what was left to do is improve the software.

    I finally got around to implementing and fixing a second order IIR filter, which I'm using to band-pass the input to reduce noise, and also to low-pass the final signal to the clicker, instead of this scrappy envelope detector I had before.

    SO to sum it up, everything is moving in the right direction, and I hope to finish the first batch of 10 boards in the coming weeks and put them on Tindie.

  • A voltage regulator is not a reference

    Pepijn de Vos10/08/2017 at 08:39 0 comments

    Between exams and studying and surviving, I'm continuing to debug the oscillations in the amplifier circuit, and I think I'm finally on to something. I talked to a friend who works at Prodrive (super nice company) and another friend who was in Green Team Twente (super nice team) with me, to get an understanding of what is going on.

    To get an opamp to oscillate, you either have to have positive feedback, or have a phase shift in your negative feedback such that it becomes positive feedback. I did some simulations and thinking, but neither of these seemed the case. The negative feedback is fairly negative, and the positive feedback is directly tied to a voltage regulator.

    So my thought was simple: therefore it must be the voltage regulator. So I probed that, and HOLY MOLY.

    There are peaks of 100mV on the supply, compared to a 10mV input. No wonder... But why?!

    Well, it turns out that most voltage regulators can only source current, not sink current. So when the output is high, some current is flowing through the JFET towards the 2.5V line, causing it to peak. (Or at least that's the thought. In my simulation the current through the JFET is way less than other current draws, so total current should never become negative)

    What I should do for the next revision is to pick a proper voltage reference that can sink current as well. As a stop-gap measure, I attempted to put a 1k pull-down resistor on the LDO to keep it at 2.5V, but this does not seems to have completely solved the problem. I think that means either the current influx is more than 2.5mA, or the LDO is too slow, which both seem unlikely, so maybe I'm still missing something.

  • Too Automatic

    Pepijn de Vos09/21/2017 at 17:16 0 comments

    Over the last few days I've been debugging the input stage. This stage consists of a high-impedance buffer and an automatic gain control stage.

    First up, the input buffer. Because piezo elements act like a really tiny capacitance, any input resistance forms an RC filter with the piezo. So in order to have a good frequency response for low notes, an input impedance of many megaohms is needed. A good way to achieve this is to bootstrap the input from the output, so that effectively, no voltage drops over the bias resistor.

    However, this means you apply positive feedback, with brings the risk of oscillation. While it seemed to work while I tested the whole circuit, when I tried to measure this particular part, it oscillated all over the place. For now I simply removed the bootstrap circuit so that the impedance is lower, but it's more stable for now.

    But now I get to the most complicated circuit on the board: the automatic gain control circuit. At this point, nothing makes sense and everything either works perfectly or oscillates all over the place depending how you look at it and how you hold the probes.

    I programmed the AVR to go to sleep, which seemed the reduce the amount of batshit crazy signals I was seeing. This suggests to me that the isolation between the analogue and digital circuit is not good enough. But this does not explain all of it, as I'm still seeing some things I can't explain.

    My original plan was to make an XY plot of the amplitude of the input versus the output, so I could see how the gain was being controlled.

    The resulting plot made no sense, so I did some more debugging. When I finally zoomed out far enough to notice, I was quite startled.

    What you see here is that the peak detection capacitor discharges slowly, increasing the gain until it hits the turn-on point on the JFET, causing it to peak, completely charge the capacitor, and slowly discharge again.

    Maybe I should tweak the turn-on point, maybe I should tweak the gain on the JFET, maybe I should add a charging resistor so the peak detector increases more gradually, maybe I should not use feedback but only feedforward to avoid any stability concerns, or maybe I should ditch the entire AGC stage and come up with something better.

    It suffices to say that making a guitar tuner is not that hard, making a usable product is a monumental challenge.

  • Finalist!

    Pepijn de Vos09/19/2017 at 08:06 0 comments

    I found out my project is one of the finalists in the accessible technology Hackaday Prize! I'm super thrilled about this.

    https://hackaday.com/2017/09/17/hackaday-prize-entry-you-can-tune-a-guitar-but-can-you-reference-reo-speedwagon/

    I should mention that the current version of the tuner does not use FFT at all. The comments mentioned a beat frequency oscillator and strobe tuner, which is a pretty good description how my tuner actually works.

    Meanwhile progress has been a bit slow since university started again. I started to write new software that uses a lower sampling frequency and signed integers so I could filter the input signal to get rid of uninteresting frequencies to make tuning more robust. This does not work at all yet though.


    Instead I patched up the current software to run on the new PCB revision, and that still works at least as well as the previous version. When I have the time I intend to write some Labview code to profile my AGC stage, so I can tune its range to be more practical.

    As for the problem of the piezzo/humbucker, I decided I should just focus on the piezzo for now, and possibly sell a separate version for electric. That would just be a matter of changing a few resistors.

    One thing I'm still considering is using a integrated VCG circuit. I found one that has a 27dB range, which would almost do the trick, but the simulation model is broken, so i don't have faith in designing a circuit with this chip.

  • Signal levels

    Pepijn de Vos09/10/2017 at 07:53 0 comments

    The good news is that all the parts of the PCB worked more or less on the first try. I could program the AVR, read the encoder, output sound, and record sound input.

    The bad news is that none of them work as well as they should.

    I replaced then expensive power opamp output with a D-class mosfet stage and a filter. At first it did not really work because the gate capacitance of the output fets was too big for my 10k pull-up at 60KHz. Once I put a 1k resistor there, it more or less worked, but the output filter is completely inadequate, leading to lots of switching noise on the output. It also draws a lot of power it seems.

    But the biggest issue is the input stage. I completely redesigned that to accommodate and normalise different input levels, which was quite a challenge. To my relief this part also worked on the first try, but for signal levels from 10-100mV.

    The microphone clips output more like 1mV. It seems every time I measure the clip microphones, their output is reduced by a factor of ten.

    I remember when I started this project, I took an electric and an acoustic guitar, and measured their output to be in the 100mV range. So I figured I could design one product that works with both.

    For the first revision of the PCB I discovered that different clip microphones have very different signal levels. I'm doubting my own memory now, but I'm absolutely sure one microphone had much higher output than the other, and quite a bit lower than the electric guitar.

    So I designed the second PCB revision with automatic gain control that would work all the way from the 10mV I remember getting from the microphone, up to the 100mV I remember getting from the electric guitar.

    Except, now I'm only getting 1mV from both microphones, and according to Wikipedia, some electric guitars go up to 1V! That means if I want to support both types of input, my gain has to adjust by a factor of a thousand, rather than ten.

    So things are looking a bit grim here. I'm not sure where to go from here, and I'm really doubting myself now.

  • New PCB

    Pepijn de Vos08/31/2017 at 14:48 0 comments

    After a lot of struggles with JFETs and opamps, I finally managed to design a circuit that (at last in simulation) achieves acceptable gain control. I hope that I can compensate for the rest in software.

    I ordered the PCB, but since I was going on holiday, I ordered from China this time. I've been told that my parents received some mysterious green plates, so I hope to continue as soon as I get home. Although university also starts a few days later.

  • PCB!

    Pepijn de Vos08/31/2017 at 14:44 0 comments

    I designed and ordered the PCB.

    This went fairly smooth, I made a few mistakes that I had to fix with some creative wiring, but I had two major problems:

    I'm having trouble finding the right case. I bought one that almost fit, but left no space for giant 1/4" plugs.

    After testing with several real guitars and microphones I found that voltage levels vary a lot from microphone to microphone, To fix this, I had to redesign the whole input stage to have automatic gain control.

  • PIC or AVR?

    Pepijn de Vos08/31/2017 at 14:40 0 comments

    In the original FFT based project, I was very much resource constrained. I read PIC has some nice DSP features, so my original plan was to use a dsPIC.

    However, sampling from Microchip took way too long, so by the time they arrived I had already started with an Atmega328. Due to the new algorithm this turned out to be okay.

    I also learned later that PIC does 2 cycles per instructions, so the 40MHz is about the same as 20MHz AVR.

    I transferred the breadboard circuit to stripboard, and did more testing. This seemed promising, so I proceeded with designing the PCB.

View all 11 project logs

  • 1
    Acquire PCB

    All the design files are on the Github page, so you need to install Git and Eagle CAD and run

    git clone https://github.com/pepijndevos/accessibletuner.git

    The easiest way is to use OSH Park, where you can directly upload the Eagle file. If you want to use another manufacturer, you need to generate gerber files.

    Next, wait a few weeks for the PCB's to arrive.

  • 2
    Acquire parts

    I uploaded a BOM under files, and also a Farnell order with the actual part numbers to save you a lot of time searching.

    Note that not every part on the BOM is the exact part I ordered. For the MOSFET's, anything reasonable will work. For the opamp, go for something with high input impedance and rail-to-rail capability, or just take the one I used.

    The JFET is a more complicated story. The one I initially used turns out to be EOL. So I'm now using a BSR58. If you want to use something else, you need to verify and adjust the agc_jfet.asc LTSpice model.

  • 3
    Assembly

    There is not much I can say about this. Get your soldering iron (and flux! and wick!) and start soldering. I'd suggest starting with the flattest parts with the most leads, and end with the tallest through-hole components.

    The board is Arduino compatible, but to program it, you need an AVR ISP programmer. From the Arduino IDE select the Arduino Uno and your programmer and then click "burn bootloader". This will set the fuses correctly, and also allow you to program it over UART if you want. Alternatively, you can just use "upload using programmer" to upload your sketch directly over the ISP header.

View all 3 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates