Adafruit Voice changer (minimal sketch)?

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
xl97
 
Posts: 201
Joined: Mon Jul 27, 2009 12:51 pm

Re: Adafruit Voice changer (minimal sketch)?

Post by xl97 »

hi-

'some' of the code has been tailored for my 'custom' variant of the Waveshield.. I'd use the code pburgess posted originally..

then look for the portion(s) that only change the internal reference to +5v..

(I also didnt use a pot.. but hard coded a value for testing)

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

Post by pburgess »

Connect the mic output to one of the Arduino's analog pins, and write a small program that just sits in a loop reading the pin and printing the value to the serial port. In silence, the numbers should hover around 512. Shout at it and you should get the full range 0-1023. Might also need to fiddle with the gain pot on the board.

keeleon
 
Posts: 32
Joined: Sun Jul 17, 2011 6:39 pm

Re: Adafruit Voice changer (minimal sketch)?

Post by keeleon »

Connect the mic output to one of the Arduino's analog pins, and write a small program that just sits in a loop reading the pin and printing the value to the serial port. In silence, the numbers should hover around 512. Shout at it and you should get the full range 0-1023. Might also need to fiddle with the gain pot on the board.
Ok, so I uploaded this

Code: Select all

void setup() {
  Serial.begin(9600);
  pinMode(A0, INPUT);
}

void loop() {

  int State = analogRead(A0);
  Serial.println(State);
  delay(1);
}
into the arduino, and connected the mic to 5v, GND and A0. All it does is cycle through around 540. I can yell into it, or snap at it or bang next to it with no change. I also tried it on A1 with the same result :(

keeleon
 
Posts: 32
Joined: Sun Jul 17, 2011 6:39 pm

Re: Adafruit Voice changer (minimal sketch)?

Post by keeleon »

I am not using a pot for the mic, as I plan on just hardcoding it. Do you mean adjust the "volume" knob? That doesn't do anything either. I hope this mic didn't show up dead :( Is there something I could have done to break it? I barely touched it other than to solder the 3 wires.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

Post by pburgess »

Well bummer, that does sound like a DOA board.

Please email [email protected] and include your order number and a link to this post, and we'll get a replacement out to you.

User avatar
janz
 
Posts: 41
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

Post by janz »

Hello,
I've got a working wave shield and microphone wired as in the tutorial. The startup chime plays. Using the short code above I've tested the microphone. The analogRead(A0) sits around 330 with a range of 0 - 700 with loud sounds.

How do I hard code the pitch? I've tried putting different large and small integers instead of analogRead(1) but nothing happens.

Code: Select all


//////////////////////////////////// PITCH-SHIFT CODE

void startPitchShift() {

  // Read analog pitch setting before starting audio sampling:
  int pitch = analogRead(1);
  Serial.print("Pitch: ");
  Serial.println(pitch);



User avatar
janz
 
Posts: 41
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

Post by janz »

OK, something does happen...the pitch of my static changes..

User avatar
janz
 
Posts: 41
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

Post by janz »

Got it working. Because I wasn't using a pot, I didn't think that I needed the 3V to AREF. Then when i was looking through the code I noticed analogReference(external). I don't quite understand why, but with the extra wire least now it works.

User avatar
Runedellion
 
Posts: 5
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

Post by Runedellion »

I was going to make a third eye variation of the Demon and have mine wired like the Voice changer and Wave shield tutorial says. However, I am using the blue breadboard pot instead of the metallic looking 10k. Would that cause an issue with getting the voice changer to work? I've gotten the PiSpeak to work and have also had the shield play a song I put on the SD card and it sounds pretty nice. However when I try the adavoice sketch that does not use the SD card I get this odd kind of static. And since seeing this thread I tried that sketch that reads the mic output? and It hovers anywhere between 970 and 1023 on the Serial monitor. Any idea on what may be causing this issue? I have one new mic I was trying and an old one from a VU meter hat that worked to play with and they both haven't panned out. If it comes into question I am using Codebender, I have the Class D amplifier powered by the 3 AAAs pack and its running two of the speakers. The Uno is plugged into my computer and when I was going to make it portable I was going to power it with a powerbank. None of the LED backpacks are connected

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

Post by pburgess »

Breadboard pot is fine.

Do you have 3.3V connected to AREF on the Arduino?

User avatar
Runedellion
 
Posts: 5
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

Post by Runedellion »

Does it also need to be joined with the vcc on the mic and the right leg of the pot? Thats how I had it but I may have had a bad grouping. Would it work the same to have the Aref connected directly to the 3.3v and the other connections on the second pinout of the 3.3v?

User avatar
Runedellion
 
Posts: 5
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

Post by Runedellion »

Update: Now that I tried to redo the group its just reads 1023 and something in the 900s when I tap on the mic using that code above. I just seen that if I wiggle the Class D amplifier that the digits will vary by about ten. Hmm Oh and thank you for the quick reply. I was up all night trying to figure out what may be wrong.

User avatar
Runedellion
 
Posts: 5
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

Post by Runedellion »

Yeah so the only thing that kept mine from working was a single ground wire I overlooked to the board from the 3 AAA and mic.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

Post by pburgess »

Whew...so you're all good then?

User avatar
Runedellion
 
Posts: 5
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

Post by Runedellion »

Yes! A seatbelt broke something with my microphone but it was alot of fun to be a lost alien
Attachments
IMG_20141101_023225.jpg
IMG_20141101_023225.jpg (814.95 KiB) Viewed 525 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”