Show Posts
Pages: 1 [2] 3
16  Using Arduino / Audio / Re: Wireless guitar on: October 12, 2012, 10:16:52 pm
I see what you mean. Better to have tried and failed than to have wondered what if.  smiley

I think I may default to using a stereo cable instead of mono. I'm trying to make something that would be easy to incorporate into guitars without much circuitry. Thought I'd try if it would just be something simple like a cap in line, you know?

But as for the stereo cable, I just need to make a sensing circuit for the pedalboard so it will stop supplying 9v power to the 2nd lead on the cable if a mono is plugged in. In this way, if the 1/4" stereo plug is used with a mono cable, the 2nd lug will connect to ground. I haven't decided on which method I may use: Use arduino to sense current, resistance, or voltage(I think voltage may be the easiest), or to just use a relay that will switch itself given the ground signal returns 9v, and then it will sustain itself there, then when powered off it will reset itself, or along the lines of that..
Can't really think of much else than that.
But if I used the arduino's analog input to determine the voltage(with a voltage divider of course), would the AC signal hurt the input if only for a short moment? I would like to not use an inductor if possible, unwanted distortion and low freq. loss through the arduino to ground.

But onto the communication/wireless. I picked up 4 nrf24l01+'s on ebay for <$8, so my evil idea is to communicate the ardy's with a pair(1 on pedalboard, 1 on guitar) and then transmit that directly on the audio wire rather than air. I just wonder, from the theory you have taught me thus far, I could run the 2.4ghz signal over the audio lines and the +9v line, without issue, right? Or would I be better off running it on the ground line?

Now for the possibly crazy idea. For wireless, run that into another pair of nrf24l01+'s, but with an antenna. I don't know how I would go about amplifying that signal just yet though. Off to google I go!
17  Using Arduino / Audio / Re: Audio matrix mixer on: October 12, 2012, 01:03:33 am
I had an idea to do something similar before. My goal was to be able to swap guitar pedal order digitally.

I think you may have a good combination, however the max4549 is a triple 3x2 setup, which may be overkill depending on how many things you have hooked up. Converting the audio signal to digital before the crosspoint switch, and then back to analog afterwards *sounds* doable. I haven't tried it though, as I abandoned my idea(my pedals decided they only liked a specific order).

I'd say one thing to be sure of is most chips won't like a negative AC voltage, and a guitar (pedal) can sometimes have a swing > 0.3 to 0.3v. Just bias the signal to bring it into a positive area to work with. The datasheet for the max4549 says it has internal voltage dividers for a bias.

Your ADC/DAC combo has a different input and output quality, but both are more than enough to achieve good audio quality. Depending on the signal you are throwing through this, you may only require something much lower quality. Unless you can find the chip for cheap, and find a DIP version or can solder SMD chips well, reconsidering is also an option.

Some things to consider. Good luck!

p.s. you can type [ url ] (your url here) [ /url ] but without the spaces in the "[]" areas, to give a hyperlink to the webpage, or click the 2nd row, 3rd from the left button (under the underline button), rather than having to copy/paste to open it.
18  Using Arduino / Audio / Re: Wireless guitar on: October 11, 2012, 10:23:50 pm
As of yet, a few things I have discovered.

1. The power supply was the culprit in disabling all audio signal. (It also powers my processor/preamp)
Not sure theoretically how an AC audio signal would cancel the digital signal through the processor's power(maybe inverted phase cancellation?)
I had to run a separate power supply to get it to work.

2. I have only been able to get any sound with ceramic disc caps. I've tried electrolytic caps back to back(+ - +), metal film caps, and polyester film caps.

3. The more resistance, the stronger the signal is. (Because its a bigger load?)

4. The capacitance didn't seem to change sound level. I used as small as a 1nf, and as much as 0.5uf with no noticable difference.

5. Multiple caps in series seemed to increase the sound level just barely. While multiple in parallel greatly decreased it.

As for the variable resistor, it seemed to not make a difference. And the RLC method is for a low pass filter isn't it? I could try an LC method, but not sure how I would incorporate the resistance. Also, I've read places that a guitar's pickup is basically an inductor in series with a cap and resistor in parallel(RLC)

The op-amp circuit you describe.. by which you mean as a buffer to keep a specific resistance? That may be a good idea to try out, but would be sensitive to different pedal layouts(different IO impedance).

There also seems to not be any 20hz high pass filters available in a small package. I found this schematic however:
May be useable, but the schematic states 15v input voltage, and the tl072 is rated ±15v.
Could I just swap for a lower voltage chip, or just run this with 9v?

Thanks for the help Far-seeker, you have really helped me out so far.
19  Using Arduino / Audio / Re: Wireless guitar on: October 10, 2012, 07:27:15 pm
My circuit so far:

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.
20  Using Arduino / Audio / Re: Wireless guitar on: October 09, 2012, 09:06:15 pm
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

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.

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?

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?
21  Using Arduino / Audio / Re: Wireless guitar on: October 07, 2012, 03:10:00 am
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!
22  Using Arduino / Audio / Re: Wireless guitar on: October 05, 2012, 07:04:21 pm
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!
23  Using Arduino / Audio / Re: Wireless guitar on: October 04, 2012, 11:43:54 pm
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?
24  Using Arduino / Audio / Re: Wireless guitar on: October 04, 2012, 02:31:43 pm
In response to the AC blocking for the DC power to the arduino, this post has given me insight:

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.
25  Using Arduino / Audio / Re: Wireless guitar on: October 04, 2012, 12:18:07 pm
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?
26  Using Arduino / Audio / Wireless guitar on: October 03, 2012, 05:51:51 pm
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.
27  Using Arduino / Storage / Re: Using SD card only for the initial configuration: how eject it? on: September 25, 2012, 10:39:28 pm
Another alternative:
Set a DoOnce variable at the start of the loop, have it open/read/close the file on the SD card, then set DoOnce again so it doesn't repeat it until next bootup.
int DoOnce;

void setup()
//Your code here
digitalWrite(13,HIGH);  //Optional status led

void loop()
if (DoOnce==0)
    //Your code to open, read, and close here
  digitalWrite(13,LOW);  //Goes along with the Setup status led
//Rest of your code

28  Using Arduino / Programming Questions / Re: Char Array erratic readings on: September 25, 2012, 09:36:05 pm
The strcat worked great!! Thanks so much PaulS!
I will post my code to help out any future readers, I know I've lurked hoping to find info, but found none because the OP would figure it out and not leave their knowledge. So here it is:

char CurrentFileName[20];
String DirectoryString[10];
String NameString[6];
String ExtensionString[4];

char* SDFileDirectory(char* DirectoryString, char* NameString, char* ExtensionString) {
  CurrentFileName[0] = 0;          // start with a null string:
  strcat(CurrentFileName, DirectoryString);   // add first string, in this case the directory for use with an sd card
  strcat(CurrentFileName, itoa(Config1,NameString,10));  //add my Config1 incrementationilizer, I used mine to name the files: 1.txt,2.txt~~100.txt
  strcat(CurrentFileName, ExtensionString);}  //The file extension

void loop()
  if(!SD.exists("Config.txt"))  // This hub is used to CREATE the config if there isn't one already
    CurrentFile.print("Maximum presets :  ");
  }"Config.txt");  //Then proceed to read info from the file, it is closed prior then reopened as if there is a config file, it will still be able to open this one:

  {  Config1++;

      SDFileDirectory("/Presets/","",".txt");//This is the function that PaulS helped me with, 1: Directory, 2: left blank/reserved for SDFileDirectory function up at the top, 3: File extension. 1 and 3 can be renamed here/wherever this line is called, and 2 is renamed in the function, I have not yet figured out how to change what var it uses, but only to change the value of Config1. If anyone can help on this, please let me know

      Serial.print("File not found, creating: ");
    Serial.println("Initialization Complete!");
29  Using Arduino / Programming Questions / Re: Char Array erratic readings on: September 24, 2012, 12:28:23 pm
@SurferTim I will give that a shot when I get home today, thanks!

@PaulS I figured the first line was redundant, I just wasn't sure. As for the value of Config1, it starts at zero and increments each time the while loop passes until it is equal to MaxPresets, which is at 100 right now. I plan to make it capable of being whichever size the user will want, unless it's too difficult, then I will just limit it to around 200.
30  Using Arduino / Programming Questions / Char Array erratic readings (Solved) on: September 24, 2012, 11:30:56 am
Hi, I am trying to convert an int to show up in a char array. I have tried several methods like itoa, atoi, assign an int to a string then call string.tochararray, call a specific char of the string after being converted to an int, and I have run out of ideas.

Anything commented out is an example of what I tried.
Code segment:
void loop()
  {  Config1++;



    CurrentFileName[9+indexToWrite]=Config1;  //[color=green]This line is where I try to call the int of Config1[/color]

    CurrentFileName[11+indexToWrite] = '.';
    CurrentFileName[12+indexToWrite] = 't';
    CurrentFileName[13+indexToWrite] = 'x';
    CurrentFileName[14+indexToWrite] = 't';
    CurrentFileName[15+indexToWrite] = '\0'; // terminator
    indexToWrite = 0; // reset pointer for next time we enter    
//  if(!SD.exists(CurrentFileName)){,FILE_WRITE);
      Serial.print("File not found, creating: ");
//    }
    Serial.println("Initialization Complete!");
I would think its something wrong with my array, rather than the method that I'm trying to call the int. I can get it to work, but it doesn't return the current number of Config1, but rather several letters, including ones with different umlauts and whatnot.
Am I not converting ASCII/HEX/DEC/BIN or something similar correctly?

Thanks for any help!
Pages: 1 [2] 3