Tweeting Race Car
From Autosport Labs
Meet our tweeting race cars
- LED message board where you can tweet messages to other cars and/or spectators
- Engine sensor reporting (temp, pressures, etc)
- Bigger personality and more interactivity
LabRat1, the turbo Mazda Miata tweets autonomously while on the race track! It tested the Version 1 tweeting capabilities at Portland International Raceway during the ChumpCar 12hr. & 6hr. race.
You can see the feed here: Follow here Twitter Feed
What it Does
LabRat1 tweets Info, statistics and commentary as it turns laps around a race course- specifically designed for endurance racing where many laps are turned and multiple driver changes occur.
What it tweets
- Race driver change notification (via text message commands). Talks about the finished driver's stint and announces the new driver
- Report Last lap time and lap counts by driver (Using GPS coordinates and start/finish line detection logic)
- Report Top speed for driver and team (via GPS velocity)
- Report peak Cornering, Acceleration, braking GForce by driver and by team (via Accelerometer)
We'd thought it would be neat to make the race car a bit interactive. Here's what we've done for this race:
- Via a twitter @mention or via direct text message it can change the color on an RGB rope light. The Rope light decorates the top of LabRat1 for night-time racing fun! This is made possible via RaceCapture programmable PWM outputs. Why?? Because its fun!!
To change the color while LabRat1 is racing, tweet at the car (or send DM) using the following format
@ASL_LabRat1 color <theColor> Where <theColor> is either red , green, blue, white, off or a RGB hex code like 7f007f
(Note, we're using twext to forward mentions to RaceCapture- this service seems a bit laggy. If we're following you, a direct message seems to work much faster!
RaceCapture Bench Demonstration Left to right: RaceCapture, Accelerometer Module, Cellular Modem, GPS Module; Top; RGB rope Light and Mosfet board
How we designed it
Building a tweeting race car is conceptually easy, with details that consume 80% of the work.
Some of the challenges included:
- GPS message parsing - Robust Cell Modem communication - Not flooding Twitter with 100's of messages due to buggy code - Doing battle with the Atmel Sam7s PWM channels and other peripherials - FreeRTOS task management, including classic stack overflow issues - Uploading via SAM-BA over and over makes debugging difficult without our own bootloader
Here's what we used:
For cellular network connectivity, we chose this neat module from Narobo Narobo. It communicates with RaceCapture via one of two of it's available serial ports
For GPS we're using a 32 channel 5Hz GPS smart module made by SanJose Navigation. More Info
RGB LED rope Light
From LED Light we purchased a length of RGB LED light, bodged together a Mosfet amplifer board from Radio Shack (bleah!) and connected it to 3 available PWM channels on Race Capture.
Accelerometer + Gyro Module
We're using a custom built RaceCapture#4_axis_Accelerometer_.2F_Gyro_module 3 axis accelerometer + Gyro connected to Race Capture via the SPI expansion port.
- FreeRTOS is a lightweight, preemptive OS that greatly simplifies firmware development by allowing you to cleanly place your modules in self-running 'tasks' - similar to conventional threads.
- Lua Scripting Runtime: A lightweight Scripting Runtime which provides the ability to run small programs and convenient configuration script
- 1000s of lines of Last minute, late night hacking code! (Thank you to my friend Vadim, for the critical help!) Software development consumed about one frenetic week of evening and weekend time.