Main Menu

BMW - Windows XP startup - shutdown PDF Print E-mail
Written by Winfred DeKreij   
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.

 
literacy worksheets middle schoolHamilton beach prepstar food processor 70550Food for jointspc oem softwareeBook: Adobe Photoshop CS2 Classroom in a Book(Adobe Press)Inidan Pharmacy VesicareChemicals in our food and bodiesGarden Planner Home Edition 2.2Inidan Pharmacy SomaInidan Pharmacy Diltiazem CreamInidan Pharmacy Malegra DXT (Sildenafil + Duloxetine)Inidan Pharmacy MethotrexateMerge Excel Workbooks 29science worksheets metals rustworksheets on chemical reactionsAoA Audio Extractor Platinum 2.0GoldSim 9.6 SP4Inidan Pharmacy CephalexinInidan Pharmacy DiarexInidan Pharmacy XenicalInidan Pharmacy AcularDVD Studio Pro 4MediaChance Dynamic Photo HDR 4.5worksheets for 3rd gradeeBook: Laptops For Dummies Dec 2004Imaris 6.2epson c84 smears printInidan Pharmacy Fusidic Acidbaby eastern painted turtlesSupreme food group floridaInidan Pharmacy InvegaAbylon CRYPTDRIVE 6.50 MultilingualAPT Computer Solutions Apt Golf 1.4Windows Doctor v1.7Inidan Pharmacy Alesse (Ovral L)VIRTUAL KEYBOARD MULTILANGUAGE 3.1Inidan Pharmacy TheophyllineInidan Pharmacy ActonelInidan Pharmacy ClarinexInidan Pharmacy ZyprexaInidan Pharmacy Kamagra Oral JellyStephen p moss and food serviceworksheets for distance rate time activityMicrosoft Macro Assembler 32 v7.0Inidan Pharmacy TrileptalAnzioWin 15.2Inidan Pharmacy Pro ED Pack (Viagra Professional + Cialis Professional)Inidan Pharmacy SumentaDog food vhhc pet foodInidan Pharmacy GeodonInidan Pharmacy Viagra Super Active+Inidan Pharmacy Otikfree Ear DropsInidan Pharmacy LevonorgestrelInidan Pharmacy PremarinInidan Pharmacy SleepWellInidan Pharmacy Liv.52 CapsulesAmond DVD to PSP Converter 2.1Hampson-Russell CE8 R4.2 x64Stuart and florida and food deliveriesInidan Pharmacy VasakaRoyal canine cat food discount priceInidan Pharmacy Lamisil CreamInidan Pharmacy Macrobidfree worksheets for editingInidan Pharmacy 100% Pure Okinawan Coral Calciumyard to feet worksheetFood and beverage worksheetInidan Pharmacy AravaFresh food to youInidan Pharmacy Mega HoodiaNuclear Coffee VideoGet 4.0Intuit QuickBooks 2006 Premier EditionInidan Pharmacy Gasex SyrupInidan Pharmacy Shuddha GugguluInidan Pharmacy SeptilinCoffeeCup Web Video Player 4.6What food do india people eatXilisoft Video Editor 1.0Inidan Pharmacy CasodexMultiQC 6.0Inidan Pharmacy Shallakiblank guitar fretboard stampInidan Pharmacy DostinexInidan Pharmacy Quick-DetoxInidan Pharmacy Tagaraqueen elizabeth ii worksheetInidan Pharmacy LasunaWomans baseball cardnals tshirts junk foodGlobal Mapper 11.0 x64Tony hartmann greenville sc cisco foodsPriscos fine foodsTomatoes organic baby food shippingCrispers menu food nutritional valuesTosca reno clean food

 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:

  1. An Adafruit Wave shield.
  2. A set of Ebay Marine speakers.
  3. A Cheap Car/MP3 Amp from Ebay.
  4. A Freeduino Serial 2.0 from NKC.
  5. A couple of small parts, resistors and such.
  6. A small SD card from Newegg.

Arduino + Wave Shield
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.
 

amp

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

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.


#include <AF_Wave.h>
#include <avr/pgmspace.h>
#include "util.h"
#include "wave.h"

#define DEBOUNCE 100

#define swPin 14

AF_Wave card;
File f;
Wavefile wave;

byte onceValue = 0; //Declare number to make sure shut.wav is only played once.

void setup() {
  // set up serial port
  Serial.begin(9600);
 
  // set up waveshield pins
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
 
  // enable pull-up resistors on
  // switch pins (analog inputs)
  digitalWrite(14, HIGH);
  digitalWrite(15, HIGH);
  digitalWrite(16, HIGH);
  digitalWrite(17, HIGH);
  digitalWrite(18, HIGH);
  digitalWrite(19, HIGH);

  // open memory card
  if (!card.init_card()) {
    putstring_nl("Card init failed!"); return;
  }
  if (!card.open_partition()) {
    putstring_nl("No partition!"); return;
  }
  if (!card.open_filesys()) {
    putstring_nl("Couldn't open filesys"); return;
  }
  if (!card.open_rootdir()) {
    putstring_nl("Couldn't open dir"); return;
  }
      playcomplete("START.WAV");


void loop() {   
  switch (check_switches()) {
    case 1:
      playcomplete("SOUND1.WAV");
      break;
    case 2:
      playcomplete("SOUND2.WAV");
      break;
    case 3:
      playcomplete("SOUND3.WAV");
      break;
    case 4:
      playcomplete("SOUND4.WAV");
      break;
    case 5:
      playcomplete("SOUND5.WAV");
  }

  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();
  }

  



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!

Liefs Hellen en Ron

Add your comment

Your name:
Your website:
Subject:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
 
 
 
Design by augs-burg.de & go-vista.de
 
 
     
 
   
Design by windows vista forum and energiesparlampen