Very Elementary question

Hello Everyone
Im working on a project in which a certain audio+light is given to a certain voice input.
I have a sound sensor for the input, leds, and two options for the voice output: AdaFruit wave shield or a Musical Instrument Shield.
Anyhow, I succeeded in making them all work, seperately.
but is there a way to connect all of them in one arduino shield? and how??

Sound sensor + Leds + AdaFruit wave shield
-OR-
Sound sensor + Leds + Musical Instrument Shield.

Thank you for any help you can give me.
Lola

Post datasheets or vendor links for all you devices (input and output)
Post the code you said you used to get them to work separately.
Post a schematic (photo of hand drawn schematic of your complete system).

and two options for the voice output: AdaFruit wave shield or a Musical Instrument Shield.

If you are saying you plan to use these for voice output , post the vendor links or datasheets that show they how that is done or that they have that capability. You need to research your devices. There is no point in listing your devices without the documentation or vendor links. We have better things to do that hunt down your documentation. We are happy to help you but we expect you to realize it is your responsibility to post the documentation or vendor links, not ours. We are here to answer technical questions, not look for documentation for homework projects. We also expect you to know that you need to provide schematics or code or both depending on the application. Since you haven't made up your mind it is too soon for a schematic. You did say you tested them separately so you must have code for that . Let's see it. List each device and a link for the documentation or reference information for that item, and post your test code.

Hi, and thank you for your great help!

The project is an interactive design project. The idea is that when shouting in a room you get the room emplifying your anger :slight_smile:
The Shouting is sensed by the Sound Sensor (this is the Sound sensor input. It is a sensor similar to this one: Sound sensitive lights w/ sound sensor & Arduino – PrinceTronics) then leds turn up and there is a big noise turns on.
The noise could be done be AdaFruit wave shield (By the Adafruit Wave Shield for Arduino Kit [v1.1] : ID 94 : $22.00 : Adafruit Industries, Unique & fun DIY electronics and kits)
Or be the Musical Instrument Shield (SparkFun Music Instrument Shield - DEV-10587 - SparkFun Electronics)
I checked each shield and sensor by itself. My question is how can I conncet them to the arduino all togeather.

  • I checked the Sound Sensor with this code:

int DO = 2; //Pin for Digital Output - DO
int DA = A0; // Pin for Analog Output - AO
int sensorvalue = 0;

void setup() {
Serial.begin(9600);

}

void loop() {
sensorvalue = analogRead(DA); //Read the analog value
Serial.print("Analog: ");
Serial.print(sensorvalue); //Print the analog value
Serial.print(" ");
Serial.print("Digital: ");
Serial.println(digitalRead(DO)); //Print the digital value
}
?

  • And I checked the Musical Instrument Shield according to this code:

/*
Spark Fun Electronics 2011
*/

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

byte note = 0; //The MIDI note value to be played
byte resetMIDI = 4; //Tied to VS1053 Reset line
byte ledPin = 13; //MIDI traffic inidicator
int instrument = 0;

void setup() {
Serial.begin(57600);

//Setup soft serial for MIDI control
mySerial.begin(31250);

//Reset the VS1053
pinMode(resetMIDI, OUTPUT);
digitalWrite(resetMIDI, LOW);
delay(100);
digitalWrite(resetMIDI, HIGH);
delay(100);
talkMIDI(0xB0, 0x07, 120); //0xB0 is channel message, set channel volume to near max (127)
}

void loop() {

//Demo Basic MIDI instruments, GM1
//=================================================================
Serial.println("Basic Instruments");
talkMIDI(0xB0, 0, 0x00); //Default bank GM1

//Change to different instrument
for(instrument = 0 ; instrument < 127 ; instrument++) {

Serial.print(" Instrument: ");
Serial.println(instrument, DEC);

talkMIDI(0xC0, instrument, 0); //Set instrument number. 0xC0 is a 1 data byte command

//Play notes from F#-0 (30) to F#-5 (90):
for (note = 30 ; note < 40 ; note++) {
Serial.print("N:");
Serial.println(note, DEC);

//Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
noteOn(0, note, 60);
delay(50);

//Turn off the note with a given off/release velocity
noteOff(0, note, 60);
delay(50);
}

delay(100); //Delay between instruments
}
//=================================================================

/*
//Demo GM2 / Fancy sounds
//=================================================================
Serial.println("Demo Fancy Sounds");
talkMIDI(0xB0, 0, 0x78); //Bank select drums

//For this bank 0x78, the instrument does not matter, only the note
for(instrument = 30 ; instrument < 31 ; instrument++) {

Serial.print(" Instrument: ");
Serial.println(instrument, DEC);

talkMIDI(0xC0, instrument, 0); //Set instrument number. 0xC0 is a 1 data byte command

//Play fancy sounds from 'High Q' to 'Open Surdo [EXC 6]'
for (note = 27 ; note < 87 ; note++) {
Serial.print("N:");
Serial.println(note, DEC);

//Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
noteOn(0, note, 60);
delay(100);

//Turn off the note with a given off/release velocity
noteOff(0, note, 60);
delay(100);
}

delay(100); //Delay between instruments
}
*/

/*
//Demo Melodic
//=================================================================
Serial.println("Demo Melodic? Sounds");
talkMIDI(0xB0, 0, 0x79); //Bank select Melodic
//These don't sound different from the main bank to me

//Change to different instrument
for(instrument = 27 ; instrument < 87 ; instrument++) {

Serial.print(" Instrument: ");
Serial.println(instrument, DEC);

talkMIDI(0xC0, instrument, 0); //Set instrument number. 0xC0 is a 1 data byte command

//Play notes from F#-0 (30) to F#-5 (90):
for (note = 30 ; note < 40 ; note++) {
Serial.print("N:");
Serial.println(note, DEC);

//Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
noteOn(0, note, 60);
delay(50);

//Turn off the note with a given off/release velocity
noteOff(0, note, 60);
delay(50);
}

delay(100); //Delay between instruments
}
*/

}

//Send a MIDI note-on message. Like pressing a piano key
//channel ranges from 0-15
void noteOn(byte channel, byte note, byte attack_velocity) {
talkMIDI( (0x90 | channel), note, attack_velocity);
}

//Send a MIDI note-off message. Like releasing a piano key
void noteOff(byte channel, byte note, byte release_velocity) {
talkMIDI( (0x80 | channel), note, release_velocity);
}

//Plays a MIDI note. Doesn't check to see that cmd is greater than 127, or that data values are less than 127
void talkMIDI(byte cmd, byte data1, byte data2) {
digitalWrite(ledPin, HIGH);
mySerial.write(cmd);
mySerial.write(data1);

//Some commands only have one data byte. All cmds less than 0xBn have 2 data bytes
//(sort of: MIDI Communication Protocol)
if( (cmd & 0xF0) <= 0xB0)
mySerial.write(data2);

digitalWrite(ledPin, LOW);
}

Thank You!
Lola