Go Down

Topic: Arduino nano Guitar Audio  (Read 332 times) previous topic - next topic

Akatsuki

I want to connect a 1/4 Jack to a guitar. How  can i make the Arduino nano read the sound from the guitar.

Grumpy_Mike

To get the digitised waveform from a guitar you need a preamplifier to get the signal into the 0 to 5V peak to peak region.

Then connect it with a 0.1uF capacitor to an analogue input.
Then connect two 10K resistors to the same input and wire the other ends to ground and 5V respectively.

DVDdoug

Attached is a schematic similar to what Mike described (with a higher capacitor value).

This circuit is used to bias the input because the Arduino can't read the negative half of the audio signal (and it can be damaged by negative voltages).    With the bias circuit silence will read about 512 (half of the 1023 range) and the audio signal will deviate around that bias.    Of course, you can subtract-out the bias in software.

If you build your own preamp you can build the bias into the preamp, and if you build a preamp that runs off of +5V (with no negative power supply) it will have to be biased anyway.

If you increase the resistor values to 1M or more you should get a "readable" signal from the guitar.    Depending on what you are dong, you'll probably need a preamp for a higher signal, but maybe not.

Quote
read the sound from the guitar
And, what are you going to do with your "readings"?

MarkT

#3
Oct 14, 2018, 04:32 pm Last Edit: Oct 14, 2018, 04:36 pm by MarkT
You are probably better off considering the entire input circuit, since that may already have to level-shift
the signal to mid-rail to do the preamplifiction.  Checkout what is used in guitar effects pedals perhaps,
although those aren't necessarily 5V supplies.

Adding a series resistor of 1k or so will greatly increase the robustness of an input section to
voltage transients.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Akatsuki

DVDdoug  i want to send my readings  to an amplifier via bluetooth

DVDdoug

#5
Oct 15, 2018, 10:53 pm Last Edit: Oct 15, 2018, 10:56 pm by DVDdoug
Quote
DVDdoug  i want to send my readings  to an amplifier via Bluetooth
I don't think the Arduino is fast enough to send "smooth" continuous audio over an digital connection, but I've never used a Bluetooth module/shield and I don't know.  ...And, that may depend on the particular Bluetooth module.

You may also get latency (delay).

Foror the best quality you will need amplification to take maximum advantage of the 10-bit ADC.   

The Arduino ADC is only 10-bits and you can only sample accurately up to about 17kHz (which means 8kHz audio).   So, you're not going to get "CD quality" but it's probably good enough guitar.

If you are new to digital audio, the Audacity website has an easy-introduction to how sampling (digitizing) works.   Basically, you have to sample at a known-constant rate and the Arduino has to do everything else (transmit, etc.) in-between samples.

Grumpy_Mike

Quote
i want to send my readings  to an amplifier via bluetooth
Why not just buy a bluetooth audio sender. It is much cheaper than an Arduino.

Go Up