On a beautiful day I was thinking, wouldn't it be cool if other devices also had start-up and shutdown tunes, just like your computer? For example, your TV, your car or your motorcycle? Since I was looking for a simple project to that uses an Arduino microcontroller, I decided to add the Windows XP Startup and Shutdown sounds to my BMW F650.
It took me about 4 hours total to build this.Total cost is about $100. Ways of achieving this cheaper: use regular speakers, build the amplifier yourself, or just leave out all the hardware and try to mimic the sounds with your voice everytime you start or shutdown the bike. This might get you even more attention.There is a little pause in the movie, that is required, because I programmed the microcontroller to wait at least 30 seconds after boot, before responding to the engine cutoff switch.
I used the electric wiring plans for the BMW from the maintenance book to figure out where to find the engine cutoff wire and connected it to Pin 19 on the Arduino.The whole project basically uses three wires, Ground, +12V, that goes into the Arduino (that has a 7805 to reduce that to 5V) and the engine cutoff wire, that is connected to a pull down switch inside the project box.
Here you see the brains of the whole operation, the Arduino, with the Wave Shield on top of it, fitted in a small plastic container with lid, underneath the saddle, next to the voltage rectifier.
Here you see the amplifier, glued above the ignition computer. Note the pointless multicolor LED ring. I also managed to break off the treble button when I tried to get rid of the factory default play between the various parts of the amp. I ended up solving it by filling the gaps (and the treble hole) with glue.
Marine Speaker, mounted above the rear wheel, at the location where originally the charcoal canister was located (The previous owner of the bike performed a canisterectomy)
Here is the code used in the Arduino. I also have code in there so I can add buttons on the handle bar in the future and assign audio samples to them.
for (byte index = 0; index < 5; ++index) { reading = digitalRead(14 + index); if (reading == LOW && previous[index] == HIGH && millis() - time[index] > DEBOUNCE) { // switch pressed time[index] = millis(); pressed = index + 1; break; } previous[index] = reading; } // return switch number (1 - 5) return (pressed); }
void playcomplete(char *name) { playfile(name); while (wave.isplaying); card.close_file(f); }
void playfile(char *name) { // stop any file already playing if (wave.isplaying) { wave.stop(); card.close_file(f); }
f = card.open_file(name); if (f && wave.create(f)) { wave.play(); }
Comments (3)
RE: AV_Wave.h missing
3
Thursday, 25 September 2008 16:27
W1nfred
Might be one of two things:
1. you misspelled the library name. It's actually AF_Wave.h
2. you did not install the the library at all. You can find it here: http://ladyada.net/make/waveshield/download.html
AV_Wave.h missing
2
Thursday, 25 September 2008 12:19
lopeyshreds
perhaps a dumb question but my compiler cannot locate AV_Wave.h
motor en laptop
1
Wednesday, 30 July 2008 12:53
Hellen en Ron
Gaaf, die geluiden bij de motor! Ron was onder de indruk wat je met je laptop gedaan hebt. Of je het hem ook kunt leren :-) Jammer dat hij er niet is in oktober in San Fransisco, jullie hadden je wel vermaakt...volgende keer beter. Maar super goed Pooh, die professionele site! We zijn trots op je. O ja, 1 puntje: iets meer tempo in de presentatie...that's all!
1. you misspelled the library name. It's actually AF_Wave.h
2. you did not install the the library at all. You can find it here: http://ladyada.net/make/waveshield/download.html
Liefs Hellen en Ron