BMW - Windows XP startup - shutdown
- Details
- Category: Arduino
- Written by Winfred de Kreij
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.
This project uses the following parts:
- An Adafruit Wave shield.
- A set of Ebay Marine speakers.
- A Cheap Car/MP3 Amp from Ebay.
- A Freeduino Serial 2.0 from NKC.
- A couple of small parts, resistors and such.
- A small SD card from Newegg.
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)
| if (onceValue == 0){ if (millis() > 30000){ if (digitalRead(19) == LOW){ delay(1500); playcomplete("SHUT.WAV"); onceValue = 1; } } } }} } byte check_switches() { static byte previous[5]; static long time[5]; byte reading; byte pressed; byte index; 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(); } |

