Introduction: Arduino F1 Starting Lights Simulator

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

//}

Comments

author
headslant (author)2016-07-02

Cool. it would help people if you described the circuit more. You could try Fritzing or you could just write in the connections.

author
Timo1806 (author)headslant2016-07-08

check again ;)

author
Timo1806 (author)2016-07-08

nice spelling

author
DIY Hacks and How Tos (author)2016-06-30

Cool. I have been thinking about making something like this for my son's toys cars.

author

Thank you sir :)

author
akolev (author)2016-07-02

Where is the schematics?

author
Timo1806 (author)akolev2016-07-08

check again :)

author
RemoJ (author)2016-07-08

Yeah guys sorry we are working on the schematics.

ETA 1 hour

thanks for the comments

author
Timo1806 (author)RemoJ2016-07-08

thanks

author
RemoJ (author)2016-07-08

the schematics are now available!!!!

About This Instructable

505views

6favorites

License:

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