loading

Ever wanted an F1 starting light simulator in your household. Well now you can! With this simple Arduino Project, That won't take much of your precious time!

Made by

Remo X.

Timo P.

Step 1: Gathering Materials

For this Project you will be needing the following:

- 5 red LEDs

- 5 220 Ohm resistors

- 1 1k Ohm resistor

- 1 Button (no F1 pun intended ^^)

- A shit ton of jump wires

- Sparkfun MP3 Shield( If you want to hear David Croft Screaming in your ear)

- Arduino Uno

- Speaker or Headphones

- 2 (or 1) Breadboards

-Download this mp3 file ----> track001 (you can find it below)

-SD card + Adapter

Step 2: Constructing!

To construct this project simply follow the instructions in the picture above!

Step 3: The Code!

Now the only part left for us to do is put in the code!

the code:

#include 
#include            // SPI library
#include          // SDFat Library
#include      // SDFat Util Library
#include   // Mp3 Shield Library
SdFat sd; 
SFEMP3Shield MP3player; 
// These variables are used in the MP3 initialization to set up
// some stereo options:
const uint8_t volume = 0; // MP3 Player volume 0=max, 255=lowest (off)
const uint16_t monoMode = 1;  // Mono setting 0=off, 3=max
int button=A1;
int lampjes[] = {5, 10, A2, A4, A3};
void initSD()
{
  //Initialize the SdCard.
  if(!sd.begin(SD_SEL, SPI_HALF_SPEED)) 
    sd.initErrorHalt();
  if(!sd.chdir("/")) 
    sd.errorHalt("sd.chdir");
}
void initMP3Player()
{
  uint8_t result = MP3player.begin(); // init the mp3 player shield
  if(result != 0) // check result, see readme for error codes.
  {
    // Error checking can go here!
    Serial.println("MP3 error! " + result);
  }
  MP3player.setVolume(volume, volume);
  MP3player.setMonoMode(monoMode);
}
void setup() {
pinMode(5,OUTPUT);
pinMode(A4,OUTPUT);
pinMode(A3,OUTPUT);
pinMode(A2,OUTPUT);
pinMode(10,OUTPUT);
pinMode(button,INPUT);
Serial.begin(115200);
initSD();  // Initialize the SD card
initMP3Player(); // Initialize the MP3 
for (int n = 0; n < 5; n++) {
  digitalWrite(lampjes[n], LOW);
}
}
void loop() {
if(digitalRead(button)==1) {
  Serial.println("Knopje!");
  MP3player.playTrack(001);
  digitalWrite(5,HIGH);
  delay(1000);
  digitalWrite(A4,HIGH);
  delay(1000);
  digitalWrite(A3,HIGH);
  delay(1000);
  digitalWrite(A2,HIGH);
  delay(1000);
  digitalWrite(10,HIGH);
  delay((3400));
  digitalWrite(5,LOW);
  digitalWrite(A4,LOW);
  digitalWrite(A3,LOW);
  digitalWrite(A2,LOW);
  digitalWrite(10,LOW);
  delay(1000);

//}

Cool. it would help people if you described the circuit more. You could try Fritzing or you could just write in the connections.
<p>check again ;)</p>
<p>Cool. I have been thinking about making something like this for my son's toys cars.</p>
<p>Thank you sir :)</p>
<p>Where is the schematics?</p>
<p>check again :)</p>
<p>Yeah guys sorry we are working on the schematics.</p><p>ETA 1 hour</p><p>thanks for the comments</p>
<p>thanks</p>
<p>the schematics are now available!!!!</p>

About This Instructable

487views

6favorites

License:

More by RemoJ:Arduino F1 starting lights simulator  
Add instructable to: