I've always liked real small chips like the Atmel 2323 and PIC 12C508. Despite their size, they contain some real power.
The 2323, for instance, can be clocked at up to 10 MHz (and more if overclocked), and will perform at about 10 MIPS.
10 MIPS ! ... That's about 8-9 times the original IBM PC !
Well, the circuit at this page doesn't need anywhere near that kind of power, but it can benefit from the small size of the 2323 chip.
I needed some kind of simple project to play a bit with the 2323, and I saw a PIC based Guitar Tuner on the 'net, so
that's how this came to be.
The circuit is a simple, but accurate Digital Guitar Tuner. It samples the input, which can be directly from the mics of an electric guitar,
or from a microphone, it you're using an acoustic guitar. It can ofcourse also be used for tuning other instruments.
The samples are then checked against stored values for the strings, and the two LED's will show the tuning status - "Too Low", "Too High" or "In Tune" when both LED's are lit.
The tuner will automatically switch between the six strings. The circuit is pretty simple. A small transistor amp pumps up the input signal to something the AVR can see on it's input pin.
The other two I/O pins are used for driving the LED's.
The input sensivity is around 50-60 mV. This gives a 2-3 V swing on the input pin, enough for the 2323 to read this as high and low levels.
The software is written in C, as there was no need for speed, and the code is quite straightforward.
The internal timer is clocked at 173 kHz and for each low-to high edge, the timer is read and the value is accumulated.
This is done 32 times, and the result is averaged by dividing the accumulated count with 32. This count is then compared to a list of values stored in a look-up table. These values, Transition_Count, determines which string is being plucked.
After the string has been determined, values from another look-up table, Center_Count, are used to verify the tuning of the string.
If the averaged count value is higher than the table value, the tuning is too low and the "Too Low" LED is lit. If the count is lower than the table value, the tuning is too high and the "Too High" LED is lit.
If the count is within + / - 1 of the table value, both LED's will be lit, indicating perfect tuning.
Easy, no ?
Play it again, Sam.
Comments are always welcome at firstname.lastname@example.org