Skip to content

abruneau/hacking_electric_race_track

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Hacking a race track with Raspberry PI

Parts

  • An eletric race track. I used Carrera- Supercharger but you can use any race track you want. Just make sure the cars are large enough to place the sensors
  • ELEGOO electronic Kit, it contains all the electronic components required
  • A Raspberry Pi 3 or higher. I choose the official Raspberry Pi 3 (16 Go) starter kit
  • Basic electronic tools. I used soldering tin and electric cables salvaged from an old printer.

The circuit

Version 1

The initial version was made on the Breadboard included in the ELEGOO kit

For details have a look at the Fritzing file

Version 2

To make it more robust, compact and transportable, you can build a hat for your Raspberry Pi that will fit in the Raspberry Pi case. You can also connect your buzzer to an NPN transistor and a potentiometer to control volume and make it louder.

Simply create holes in the case for the LEDs and connexion cable

For details have a look at the Fritzing file

The Raspberry Pi

setup

The Raspberry pi is running Raspbian. To conserve resources, I disabled the gui and ennabled ssh. You can follow this guide.

Deploy

Copy the content of ./code/* on the Raspberry and add exec mod to start.sh

sudo chmod +x start.sh

Run

Setup

  1. Turn on the Raspberry Pi
  2. Execute the start.sh script on the Raspberry Pi

Start Racing

The physical buttons allow you to start a new race, stop a none finished race and reset a race. If the start button is pressed again, a new race is started.