This is an Arduino based guitar preamp+effector. This instructable contains basic information about how to build a circuit on a breadboard and an Arduino code to drive the system. The guitar effects are not implemented here, but some examples can be found from another project of mine: https://www.instructables.com/id/ATTiny44-Guitar-E...
This instructable will illustrate how to get the guitar signal properly through a biased input, and how to use weighted pins for output in order to get signal resolution higher than 10-bits.
This is everything you need for the breadboard circuit. The list of material will include:
The detailed resistor and capacitor values in the output stage is up to what headphone is going to be used. Also I heavily low-pass filtered the output sound, and different filter design can be experimented for better sound quality.
Let's make the circuit on a breadboard. You will also need jumpers between the circuit and an Arduino.
And upload the code below to your Arduino.
void setup()
{
TCCR0B = TCCR0B & 0b11111000 | 1; TCCR0A &= ~B11; TCCR0A |= B011;
pinMode( 5, OUTPUT ); pinMode( 6, OUTPUT );
analogWrite( 5, 0 );
analogWrite( 6, 0 );
analogReference( DEFAULT );
_SFR_BYTE( ADCSRA ) &= ~_BV( ADPS2 );
_SFR_BYTE( ADCSRA ) |= _BV( ADPS1 );
_SFR_BYTE( ADCSRA ) |= _BV( ADPS0 );
}
void loop()
{
int input = ( (analogRead( 0 ) ) * 64 ) - 32768;
if(input>=65536) input = 65535;
if(input<0) input = 0;
unsigned short output = input + 32768;
analogWrite( 5, output >> 8 );
analogWrite( 6, output & 255 );
}
Note: this code is made based on http://pastebin.com/9zphwpvA
Here is a sample of the preamp. More effects can be implemented by modifying the code in the loop(). For a few other examples please visit my other instructable: https://www.instructables.com/id/ATTiny44-Guitar-E...