I am working on hacking a Big Mouth Billy Bass. I have an Arduino Uno, an Adafruit Motor Shield and an Adafruit Wave Shield. I did some research about pin conflicts and so I jumped the LCS, CLK, DI, and LAT to analog 0-3 respectively and CCS to 10. On the Motor Shield I cut the traces to pins 11 and 12 and jumped 12 to 2. (I did not bother jumping 11 since that is the control for M1 and I only need to use M2, M3, M4).

I put three .1uF capacitors on each of the motors to prevent noise and I added am powering the arduino separately from the motor shield. I am using 8 AA batteries on the motor shield which should provide plenty of voltage to power the three 6vdc motors in the Big Mouth Billy Bass.

I ran a test sketch and got the wave shield to play while motors moved. I tested each of the motor ports with success.

Then I connected all three motors from the BBMB to the motor shield. I ran the following sketch as a simple test to make sure I could control each motor.

Serial.println("All's quiet on the western front..."); //tell me that it is over delay(5000); //wait 5 seconds

}

The way the BMBB works is when the motor is powered, it moves the part of the body until the power is removed and a spring brings back into place. For whatever reason, when I connect all 3 motors and run this sketch, only one part of the body will engage and stay engaged. It isn't controlled. For example, the tail motor (M4) will engage and stay engaged until I unplug the arduino or remove the power supply to the motor shield. If I then unplug the tail from M4, the same thing will happen but with the mouth (on M2). Finally, if I only leave the body motor (M3) plugged in, the same thing happens. It engages and stays engaged until I remove power.

I'm really not sure where to go from here. I have attached pictures of my setup. Please be merciful! I am a total rookie...

Here are the pictures. I did not include the wave shield since I have not had problems making that work. However, I can put them in a separate post if that would help.

[img]

The arduino with wave shield and motor shield connected.

IMG_3441.JPG (220.35 KiB) Viewed 1384 times

The motor shield

IMG_3449.JPG (127.66 KiB) Viewed 1384 times

Motor shield bottom

IMG_3452.JPG (165.33 KiB) Viewed 1384 times

[/img

Last edited by cjb41183 on Thu Mar 07, 2013 9:15 am, edited 2 times in total.

The serial monitor just prints that it is running each motor ("Move mouth" "move body" "move tail" "all's quiet..."). Even if I have all three motors connected but comment out all but one motor's commands, it still acts weird. For example, if I comment out the commands for M2 and M4 (but leave them connected), and just run the motor on M3, the motor on M2 will still engage and stay engaged until I remove power either to the shield or to the arduino. Or if I press reset on the shield it powers down and starts again with the same problem.

If I disconnect all of the motors but one and run the commands for that motor, it does the same thing. Engages and stays engaged until I remove power regardless of the commands to release, etc.

I have control! Thank you for helping me troubleshoot that. So simple. Now for that hard part of coordinating words and movements...

One thing I do notice, however, is that whenever motor 2 engages, there is some static on the speaker connected to the wave shield. Any suggestion as to how to quiet that? I already have 3 capacitors on every motor. Maybe when I actually play sound with it it won't be as bad? I will have to test that.

I seem to have taken care of the sound problem by routing the wires away from the speaker. Thanks for that advice.

Now for the next problem...

The motors work perfectly with a test sketch that I ran. They sync up well. Now, I tried to do a test where I push a button, the sound plays and the body motor (M3) operates. Unfortunately, the motor does not operate in my sketch. The wave file plays at the push of the button and I can hear a high pitched noise from the motor (like it is trying to operate) but it does not actually engage the mechanism on the body. I can test it with any motor (tail (M4), body (M3), mouth (M2)) with the same result. The only difference is that I only hear the high pitched motor noise with the body motor. So I'm stuck again. Here is my sketch. It is basically the 6 button sketch from the website modified for one button. Thanks again.

SdReader card; // This object holds the information for the cardFatVolume vol; // This holds the information for the partition on the cardFatReader root; // This holds the information for the filesystem on the cardFatReader f; // This holds the information for the file we're play

WaveHC wave; // This is the only wave (audio) object, since we will only play one at a time

// Now we will look for a FAT partition! uint8_t part; for (part = 0; part < 5; part++) { // we have up to 5 slots to look in if (vol.init(card, part)) break; // we found one, lets bail } if (part == 5) { // if we ended up not finding one :( putstring_nl("No valid FAT partition!"); sdErrorCheck(); // Something went wrong, lets print out why while(1); // then 'halt' - do nothing! }

// Lets tell the user about what we found putstring("Using partition "); Serial.print(part, DEC); putstring(", type is FAT"); Serial.println(vol.fatType(),DEC); // FAT16 or FAT32?

// Try to open the root directory if (!root.openRoot(vol)) { putstring_nl("Can't open root dir!"); // Something went wrong, while(1); // then 'halt' - do nothing! }

// Plays a full file from beginning to end with no pause.void playcomplete(char *name) { // call our helper to find and play this name playfile(name); while (wave.isplaying) { // do nothing while its playing } // now its done playing}

void playfile(char *name) { // see if the wave object is currently doing something if (wave.isplaying) {// already playing something, so stop it! wave.stop(); // stop it } // look in the root directory and open the file if (!f.open(root, name)) { putstring("Couldn't open file "); Serial.print(name); return; } // OK read the file and turn it into a wave object if (!wave.create(f)) { putstring_nl("Not a valid WAV"); return; }

// ok time to play! start playback and make the body move while it plays wave.play(); body.run(FORWARD); delay(1000); body.run(RELEASE);

If you go back to your motor-only test sketch, the motors still run? Make sure your battery pack is not run down.

The motors run perfectly on the motor only sketch. The arduino runs on the USB cable for the tests. The battery pack is 6 AA batteries and the batteries are in great shape. Just in case, I connected the 8 AA battery pack. Same problem.