Pages: [1] 2   Go Down
Author Topic: Wireless guitar  (Read 5714 times)
0 Members and 1 Guest are viewing this topic.
Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, my plan is to make a wireless guitar system that not only transmits audio, but data between two arduinos (Pro Mini on the guitar, Mega on the pedalboard).
I have looked at the nrf24l01, which is easy and cheap to buy, but I would need an A/D converter, then a D/A on the receiving side.
Also the nrf24Z1 has the A/D,D/A build into it, but how would I go about transmitting simple serial data between arduinos whilst a consistent audio signal?
One more chip I found, was the nRF2460, which claims to be able to transmit audio at a high quality and has an addition channel(s?) to transmit mcu data. "The nRF2460's 4Mbps bandwidth also provides ample space to support an auxiliary wireless data channel for user control functions such as mute and volume up/down. " But if this chip doesn't have an onboard A/D,D/A converter, I may as well just use a nrf24l01 and get a seperate ADC and DAC, right?
Would the arduino be able to handle a converter at a fast enough speed to not lose signal quality? I figured it would be like: Guitar->ADC->Arduino Pro Mini->nRF24l01->air->nRF24l01->Arduino Mega->DAC->pedalboard.

Any input would be appreciated, I'm really confused.
Thanks!
Logged

Food for thought.
Nom.

0
Online Online
Shannon Member
****
Karma: 199
Posts: 11668
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The nRF24L01+ has enough bandwidth for audio, but the problem is going to be driving it from an Arduino fast enough (you'll be handling A/D traffic at the same time remember).  I've sent audio with nRF24L01+ before but with a 32-bit microcontroller and an I2S ADC, but I think its hard to get that working on an Arduino because its only 8-bit.

The version with built in ADC/DAC support might be the answer for the audio (haven't looked at that module/chip myself), and you could use a separate transceiver pair for control data on different channel.
Logged

[ I won't respond to messages, use the forum please ]

Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the quick response. I may have come across a solution: fm transmission through the data line.
Guitar-> arduino fm transmitter on one freq, receiver on another->ADC-> nrf24l01+.
With this principal I could communicate between the guitar and pedal board as well as power the guitar (capacitive coupling for AC, inductor for the DC), I just worry if it will mess with the signal going through an ADC->(wireless)->DAC. But a frequency higher then a guitars signal, shouldn't be affected if its significantly higher than it, right?
I suppose I'll have to try it out, lol.

But with separating AC and DC @ 9v, I've come to the idea a 1 farad cap on series will block DC, bit I don't know how to calculate the inductor to block the AC. Any ideas?
Logged

Food for thought.
Nom.

Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In response to the AC blocking for the DC power to the arduino, this post has given me insight:

http://arduino.cc/forum/index.php?topic=124522.0

The act of converting AC into DC is called rectification.

There are two basic types of rectification: full wave, and half wave.

Full wave rectification takes 4 diodes and flips the lower half of an AC waveform upside down and superimposes it over the upper half:



Half wave rectification only uses 1 diode, and effectively cuts off the lower half of the waveform:



The Arduino has a single diode in-line with the power input jack to protect the system against reverse polarity connections.  This diode acts like a half wave rectifier.

A capacitor after a rectifier smooths off the peaks and troughs of the waveform:



If the ripple voltage remains above the minimum level of the voltage regulator, then all will be well.  The ripple voltage, however, is a function of the current drawn - the more current you draw the faster the capacitor will discharge and the more ripple you will get.

You will be fine running with an AC adaptor at low currents, but there will be a cut-off level where you will start to get glitches and voltage drops on the 5V line when you draw too much current.


So my question is, is that will I need to bias the guitar's AC signal into a positive AC signal instead of a +/- 0-1v or should that not matter? It will be sharing a 9V DC line, so it will still have power, I just don't want the guitar's AC signal to mess up my arduino.
Logged

Food for thought.
Nom.

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So my question is, is that will I need to bias the guitar's AC signal into a positive AC signal instead of a +/- 0-1v or should that not matter? It will be sharing a 9V DC line, so it will still have power, I just don't want the guitar's AC signal to mess up my arduino.

When overlaying an AC on an existing DC signal, the resulting voltage level will be the sum of the two signals at any given instant of time.  For example, if you have a  ± 1 VAC on a 9 VDC line, the crest will be +10 V and the trough will be +8 V.  Another way of thinking about it is to start with your AC at ground and shift it based on the magnitude and sign of the DC voltage.  Personally, I don't like laying data signals over power when running a separate wire is feasible, but an AC signal with an amplitude of 1 V shouldn't be a problem (± 4 V would be because you are going beyond both the minimum and maximum recommended voltage ranges for the voltage regulator).

Also, if you can wait a few weeks, the new Arduino Due will be out the 22nd of this month.  Not only is it based on a 32 bit, 84 MHz, microcontroller; it will also have 2 real DAC outputs (I think 12 bit resolution, like the ADC).  That might make this project easier.
Logged

Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For the AC over DC, that makes me feel better about whether or not it would fry my arduino. The only thing though, I was unable to effectively do capacitive coupling for the guitar's signal. When I would apply the DC to it, it would just stop any sound. I was using a small cap (don't have any 1 farad non-polarized lying around) so that may be the issue, but if not, have I then done something wrong?

I would prefer to utilize a single mono cable (They are easy to come by, and if anything happens on stage I can easily swap it out; To make it backwards compatible without adding a proprietary jack beside the 1/4"; I don't want to use a Stereo 1/4" because I worry a roadie would put a mono in by accident and it would short my 9v to ground/I would have to add short circuit sensing circuitry to my pedalboard, which I find overkill if there is a better solution to just using a mono cable).
And I would go for the Due, only I would need 16 bit ADC and DAC at a minimum and would preferably use a 24 bit set, and space is an issue. I would need a Due the size of the Nano or Pro Mini to fit in the guitar. I could use it as my pedal board's processor though. I will look into that, thanks!

Current question: what would be the correct value cap to use for a 9v powered system(I may use diodes to half/full rectify the signal to stay at about 10v then regulate it before the arduino, or figure something out), that also has a min resistance of 8k ohms, max of 25k ohms?
Logged

Food for thought.
Nom.

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For the AC over DC, that makes me feel better about whether or not it would fry my arduino. The only thing though, I was unable to effectively do capacitive coupling for the guitar's signal. When I would apply the DC to it, it would just stop any sound. I was using a small cap (don't have any 1 farad non-polarized lying around) so that may be the issue, but if not, have I then done something wrong?
Do you have a scope so you can see the what is on the output side (what should be AC) of the capacitor?  Also, are you only using a capacitor or is there a resistor going from the capacitor's output to ground?  If you don't have a resistor adding one would make the circuit a first order high-pass filter.   This might be more reliable, especially if you are using smaller capacitor values.   

I would prefer to utilize a single mono cable (They are easy to come by, and if anything happens on stage I can easily swap it out; To make it backwards compatible without adding a proprietary jack beside the 1/4"; I don't want to use a Stereo 1/4" because I worry a roadie would put a mono in by accident and it would short my 9v to ground/I would have to add short circuit sensing circuitry to my pedalboard, which I find overkill if there is a better solution to just using a mono cable).
There's no technical reason why you can't or shouldn't use a single wire cable, I was just stating a personal preference.  Although I can certainly see why a traveling performer, especially when they won't always be the one setting-up the system, would want to keep things simple while using readily available cables. However, have you thought about using custom solution based on a commerically available multi-pin cable?  For example, you could get MIDI compatible circular audio connectors and wire up only the pins you need (of the five available, I think you'd need two or three).  This way the power and signal can be separate, it would be impossible to accidently connect it wrong, and it's possible to use an normal MIDI cable as a replacement. 

Current question: what would be the correct value cap to use for a 9v powered system(I may use diodes to half/full rectify the signal to stay at about 10v then regulate it before the arduino, or figure something out), that also has a min resistance of 8k ohms, max of 25k ohms?
The math for this is fairly simple, but it will be dependent on the frequency the ripple you are trying to smooth (which in this case will be related to the frequency of your original AC signal).  You want a capacitor large enough such that the RC time constant (τ) is significantly larger than one full ripple cycle.  I don't know what the ripple period, but you don't have to match it exactly just exceed it.  Here's an example...

τ = R * C
τ = 5*10-5 s (I got this by inverting 20 kHz, your target value could be different)
R = 8000 Ω (lowest possible load is the worst case)
Solve for C

C = 5*10-5 s / 8000 Ω = 6.25 nF
Logged

Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't have a scope unfortunately. And I tried that, but it did the same thing. I think I just can't find the right cap/resistor combination.
On my breadboard I had it like this:
To pedaboard, Cap leg with resistor to ground, Cap leg to DC power, DC power, DC power to Cap leg, Cap leg w/ resistor to ground, to guitar;
and of course common ground between the AC signal and DC power. I tried with smaller caps, but it would just cut out sound, and larger caps in parallel let more sound through, but as soon as DC was applied there was no sound at all, minus an oscillating whine.

I have been considering other cables. *sigh* I have so many mono 1/4 cables as backup, I'd hate to have to switch to another type.
As for a midi cable, that is a good idea; but the music I play, we tend to not have any use for midi..(YET! until I build a midi tracker for my guitar, but thats another story).
I have considered using a Stereo 1/4 cable. On the tip would be the guitar's signal, ring would have the ground, and the shield would have power.
I would swap the ground and power only if it wouldn't make it sound horrible. And all I would need is a short sensing circuit on my pedalboard, basically measuring the resistance between the DC and ground. The arduino would do a test on startup and make sure the resistance is >100 ohms, then enable the DC power. So it could sense a mono cable plugged in instead, and automatically disable the power.
But then I'd have to buy some Stereo cables, and they may be less common on stage.

The math for this is fairly simple,
This is the math:
  |
  V _________
---/  d(0.0)b   \--->
            ^
Right over my head.. ha
How would I know which frequency to drown out for the AC? I may be wrong, but I though DC was a low frequency.

τ = R * C
τ = 5*10-5 s (I got this by inverting 20 kHz, your target value could be different)
R = 8000 Ω (lowest possible load is the worst case)
Solve for C

C = 5*10-5 s / 8000 Ω = 6.25 nF

How did you invert 20khz into 5*10^-5 ?
And to what scale would I use the resistor to ground the cap?
Since it would be a cutoff for (above?) 20khz, would that alter all sound above it? (fm frequencies for communication between arduinos)

Thanks for your patience, I appreciate it!
« Last Edit: October 05, 2012, 07:12:54 pm by MattiasOfTheMetal » Logged

Food for thought.
Nom.

Offline Offline
Newbie
*
Karma: 1
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I would need 16 bit ADC and DAC at a minimum and would preferably use a 24 bit set,
Interesting.  While you see 16/24 bit in digital audio, keep in mind that bit depth is dynamic range.  If you have access to recording software toss on a "bit crusher" to a guitar DI or even a recorded guitar track.  I'd imagine there are 2 people on Earth who could hear the quality "loss" at 12 bits.  Those extra bits are chewed up almost entirely by the outrageous noise floor of just about every guitar setup on the planet.  The kind of distortion we hear down @ 3-4bits is a bit on the fizzy side but you'll never hear that @ 8 bit.

For that matter, there isn't much at all happening at 11k on a guitar DI.  22Khz sample rate would probably result in zero tone change.

It sounds like you've got an incredible project here and I'd hate for it to be compromised because your specs are a bit "overbuilt" (as in inaudible).  These are the kinds of things us recording engineers fight over all the time and the differences are sooo subtle.  Now, when it comes the hardware to push this (as you are doing) the differences are NOT subtle.

Good luck!

Brandon
Logged

Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea, I would figure there would be no humanly-noticeable difference. But I guess it came down to myself being a tone-whore. haha
The last thing I want is for it to sound worse than it does now with just a cable.
My own ears seem to be more sensitive to higher frequencies than most other people it seems, so I tend to like a lot of high end freq.

It sounds more "open" to me; would the bit depth/sample rate make so little of a difference in the amount of headroom it has?(not only the sound quality)

But I could care less about any thing altering the sound out of the audible range. As long as it doesn't alter the communication.
My goal is to have the guitar signal within audible range(20hz to 20khz right?), then block between 20khz and my Guitar-to-pedalboard Serial freq, block between that and the Pedalboard-to-guitar frequency, then isolate those from the DC.

If this is the case, I may be able to lower the required audio quality in my ADC/DAC combo and it may be easier to create.

Thanks Brandon!
Logged

Food for thought.
Nom.

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't have a scope unfortunately. And I tried that, but it did the same thing. I think I just can't find the right cap/resistor combination.
On my breadboard I had it like this:
To pedaboard, Cap leg with resistor to ground, Cap leg to DC power, DC power, DC power to Cap leg, Cap leg w/ resistor to ground, to guitar;
and of course common ground between the AC signal and DC power. I tried with smaller caps, but it would just cut out sound, and larger caps in parallel let more sound through, but as soon as DC was applied there was no sound at all, minus an oscillating whine.
I revisited my calculation example below, but that should give you a value that will work.  However, this might be a good place to recall that even if you don't have the exact value needed with a single capacitor, it's possible to get close to it with combinations of parallel and serial capacitors.  Just remember that they combine differently than resistors, basically the rules for parallel and serial addition are reversed.  

I have been considering other cables. *sigh* I have so many mono 1/4 cables as backup, I'd hate to have to switch to another type.
As for a midi cable, that is a good idea; but the music I play, we tend to not have any use for midi..(YET! until I build a midi tracker for my guitar, but thats another story).
I have considered using a Stereo 1/4 cable. On the tip would be the guitar's signal, ring would have the ground, and the shield would have power.
I would swap the ground and power only if it wouldn't make it sound horrible. And all I would need is a short sensing circuit on my pedalboard, basically measuring the resistance between the DC and ground. The arduino would do a test on startup and make sure the resistance is >100 ohms, then enable the DC power. So it could sense a mono cable plugged in instead, and automatically disable the power.
But then I'd have to buy some Stereo cables, and they may be less common on stage.
Well you are the one who will be using it so ultimately you will have to balance all the factors and decide which wiring approach is the best, all things considered.  What I do know is if the AC has it's own dedicated wire, high-pass filters or coupling capacitors shouldn't be necessary.  smiley-razz

This is the math:
  |
  V _________
---/  d(0.0)b   \--->
            ^
Right over my head.. ha
Honestly it shouldn't be over your head.  It's true deriving the the RC time constant formula involves calculus.  However using it to get a capacitor value in this case only requires solving for a single unknown using algebra. This is only 7th or 8th grade math, and you've demonstrated a grasp of mathematical concepts at least as, if not more, difficult in this thread.

How would I know which frequency to drown out for the AC? I may be wrong, but I though DC was a low frequency.
DC is basically zero frequency, but the confusion is really my fault.  I'm an EE that doesn't work with audio much.  Off hand, I do know that the range of human hearing is kilohertz in magnitude, but I didn't double check the exact range.  So for my example in an effort to get something that would yield some fairly easy numbers, I ended up choosing a frequency for the high pass filter that would actually exclude the entire audiable range for most human beings. smiley-red  The math is still sound, but you probably want to try something around 20 Hz , 0.05 seconds, instead.

The corrected example:
τ = R * C
τ = 0.05 s (20 Hz, inverted)
R = 8000 Ω (lowest possible load is the worst case)
Solve for C

C = 0.05 s / 8000 Ω = 6.25 μF

How did you invert 20khz into 5*10^-5 ?
The snarky answer would be "I just hit the '1/x' button on a calculator."  smiley-wink   However a more meaningful answer is that the frequency and period are reciprocal for a time varying signal.  Therefore inverting one will always give you the other.  Yet, as mentioned above these exact values were entirely incorrect for what you want.

And to what scale would I use the resistor to ground the cap?
If I've understood you correctly, when hooked-up to the guitar the load would be on a range between 8k and 25k Ω.  In this case you really shouldn't need an additional resistor if the load is directly between the capacitor and ground.  Although using one will be necessary if testing the circuit unconnected to the actual load.

Since it would be a cutoff for (above?) 20khz, would that alter all sound above it? (fm frequencies for communication between arduinos)
It's my understanding that we were discussing overlaying AC on the DC power, not on any of the wires going directly I/O (should never be done because the Arduino microprocessors can only withstand about -0.5 V on these pins).  If that is correct, the communication between the Arduinos will be on another wire or using wireless radio.  Therefore, barring electromagnetic interference (which can be mitigated if it occurs), this AC signal shouldn't affect the Arduino serial communication by either means.
Logged

Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Honestly it shouldn't be over your head.  It's true deriving the the RC time constant formula involves calculus.  However using it to get a capacitor value in this case only requires solving for a single unknown using algebra. This is only 7th or 8th grade math, and you've demonstrated a grasp of mathematical concepts at least as, if not more, difficult in this thread.
I never took calculus nor have I seen that equation before, so I didn't have any background info on what was what. (I'm still new to AC concepts and combining them with DC and whatnot). Thats what I meant by over my head. lol

Quote
DC is basically zero frequency, but the confusion is really my fault.  I'm an EE that doesn't work with audio much.  Off hand, I do know that the range of human hearing is kilohertz in magnitude, but I didn't double check the exact range.  So for my example in an effort to get something that would yield some fairly easy numbers, I ended up choosing a frequency for the high pass filter that would actually exclude the entire audiable range for most human beings. smiley-red  The math is still sound, but you probably want to try something around 20 Hz , 0.05 seconds, instead.

The corrected example:
τ = R * C
τ = 0.05 s (20 Hz, inverted)
R = 8000 Ω (lowest possible load is the worst case)
Solve for C

C = 0.05 s / 8000 Ω = 6.25 μF
Ah, that will be of much help. I picked up a few caps from radioshack(way overpriced, if not for my discount) and I will give them a try tonight.

Quote
It's my understanding that we were discussing overlaying AC on the DC power, not on any of the wires going directly I/O (should never be done because the Arduino microprocessors can only withstand about -0.5 V on these pins).  If that is correct, the communication between the Arduinos will be on another wire or using wireless radio.  Therefore, barring electromagnetic interference (which can be mitigated if it occurs), this AC signal shouldn't affect the Arduino serial communication by either means.

That is correct, I will isolate the Arduino IO pins from any AC signal. The onboard ardy is going to control each pickup's(what I call presence: fades between full series to a ratio of series/parallel/bypass then to a bypass state.) and will also control the LEDs on it(vine fretboard hollowed out and has RGB LEDs in it; should look good I think). The mcu will only share a communication and power line with the actual guitar's signal.

One thing though I hadn't thought of earlier. FM signals, dependent of amplification power, potential distance will vary. But if its through a shielded wire directly to a reciever, would there be such a distance factor? Or is a 'typically' low distance longer than about 30~ feet?


EDIT:
I tried with a few different size caps, and the dc signal still cuts out any sound. I even tried up to 300uf in caps both parallel and series. The only thing that would make sound is when I would have atleast 200uf and be connecting another cap. When the leads would touch it would make a sound kind of like plugging in a guitar. So I think I may be getting closer, but how much higher would I need to go? Or is there another aspect I may be missing?
« Last Edit: October 10, 2012, 12:00:48 am by MattiasOfTheMetal » Logged

Food for thought.
Nom.

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One thing though I hadn't thought of earlier. FM signals, dependent of amplification power, potential distance will vary. But if its through a shielded wire directly to a reciever, would there be such a distance factor? Or is a 'typically' low distance longer than about 30~ feet?
Most of my experience is with controls, instrumentation, and sensors; I only have a little bit of knowledge and background in RF communications like FM.  However, in my non-expert opinion running an normal FM signal on copper wire probably wouldn't degrade or otherwise significantly affect the signal within a hundred feet or so.  Just like any other signal there will losses due to the innate wire resistance, along with the effects of parasitic capacitances, etc...  Still FM broadcasters must run these signals to transmitters and antennas on some fairly tall structures, and that's not even considering whatever length it takes to get from the studios to the outside.  So unless there is some special signal conditioning involved I'm unware of the distances you mention should be fine.  Although, if someone with more expertise in this area has different advice I would defer to their input.

EDIT:
I tried with a few different size caps, and the dc signal still cuts out any sound. I even tried up to 300uf in caps both parallel and series. The only thing that would make sound is when I would have atleast 200uf and be connecting another cap. When the leads would touch it would make a sound kind of like plugging in a guitar. So I think I may be getting closer, but how much higher would I need to go? Or is there another aspect I may be missing?
Could you post a quick schematic drawing of how you are arranging the capacitors and your load?  I'm still a bit unclear if you are trying to go for a filter or still just trying coupled capacitors.
Logged

Monterey, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My circuit so far:

EDIT:
https://www.dropbox.com/s/x4vxufqmuqc145b/ArdyForum1.bmp
The insert image thing didn't work.

But the minimum load can be as low as a few hundrew ohms (volume control) or less.
The new guitar I am installing this into(hopefully) will have selective bypass resistance which will cut out of the pickups.
I forgot to include that info originally, since I was testing it on my currently built guitar.

As for the diagram, it will look like I'm adding pointless DC power to the signal. I just decided to leave out the rest of the circuit (guitar-side arduino) for simplicities sake; its a proof of concept. I just need a 9v DC supply between the two capacitors, basically.
« Last Edit: October 10, 2012, 07:31:55 pm by MattiasOfTheMetal » Logged

Food for thought.
Nom.

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But the minimum load can be as low as a few hundrew ohms (volume control) or less.
The new guitar I am installing this into(hopefully) will have selective bypass resistance which will cut out of the pickups.
I forgot to include that info originally, since I was testing it on my currently built guitar.
Yeah that is something worth knowing ahead of time...  The fact that there is a variable load with a range of over tens of thousands of Ohms does complicate designing a passive filter.  Do you have a potentiometer avaialble in the range of 20k to 50k Ω?  If so wire it up as a variable resistor in series with your guitar's load and use that to keep near a specific resistance that yields a desired cut-off frequency with the capacitor(s) you are using.  Alternatively, it might be worthwhile trying a RLC high-pass filter with your guitar's load as the resistive element.  Finally, there's always the possibility of making an active circuit using an op-amp but that shouldn't be necessary just seperate a sinusoid from a DC offset.

One minor thing, unless you know the pedal board output will have an unwanted DC or very low frequency signal you might remove C1 for now just to simply the circuit.
Logged

Pages: [1] 2   Go Up
Jump to: