djhedges
djhedges New Reader
9/25/20 3:46 a.m.

Does it get any more grassroots than to build your own data acquisition system?  This has been occupying my time for about a year now and keeping me sane in 2020.  I recently jumped through the hoops to open source it and I'm kinda excited about it.  It's still a work in progress and has a few rough edges but it's getting there.

https://github.com/djhedges/exit_speed - Code and Documentation

https://youtu.be/bjZeXXChDv4 - Grafana Demo

https://youtu.be/FmqjIN7ifVM?t=211 - LED demo

I've always wanted to stick a Raspberry Pi in the race car.  My initial goal was to add LEDs that would tell you if your speed was faster at that point in time vs your fastest lap of the session.  Green your faster, Red your slower.  Should I take this turn in 2nd or 3rd?  Does trail braking help?  Was that line better?  If you play GT Sport it's identical to the red/blue triangles.

  • $40 10hz USB GPS
  • $45 Raspberry Pi, SD Card & Case
  • $42 for the LEDs

My next question was how hard is to read the throttle position sensor with a Raspberry Pi?  I'm not very strong in the electrical/electronics side of things so there may be a better or cheaper way of doing this.  I found the Labjack U3 which has great documentation and support for $135.  The U3 allowed me to read voltages from the TPS, Water Temp gauge, Oil pressure gauge, etc.  Later I realized there was a WBO2 from Tech Edge in the car which allowed me to read the A/F ratio as well.

Grafana is another open source project that creates all the pretty graphs.  It's a work in progress but I was able to stream ~3-10 points of data per second into Grafana while tethered to my phone.  I think I can do better.  This creates some neat possibilities for endurance racing because you would have live data during the race.  Imagine your pit crew giving you pointers based on data from the last lap while you're on track.  With Grafana you can also setup alerts.  For example Grafana could send a group Telegram message if the water temperature is over 220F.  Track days are busy and this eliminates that step of pulling the SD card and downloading data.

The one downside is setting this up isn't for the faint of heart.  If your good with Linux it should be no problem.

OHSCrifle
OHSCrifle SuperDork
9/25/20 4:09 a.m.

This is the kind of crazy I come here for. 

Robbie (Forum Supporter)
Robbie (Forum Supporter) MegaDork
9/25/20 9:02 a.m.
OHSCrifle said:

This is the kind of crazy I come here for. 

You can say that again. 

My kinda "DIY data acquisition" is more like a red solo cup upside down near the rear view mirror, with a nut on a string hanging in the middle. If the nut is basically staying in contact with the cup but sliding around, you are smooth. If the nut is bouncing, well, you could be smoother. 

Olemiss540
Olemiss540 Reader
9/25/20 9:25 a.m.

Crazy and amazing. You could damn near have a full dash solution for a few hundred dollars.....

GIRTHQUAKE
GIRTHQUAKE Dork
9/25/20 11:15 a.m.

I could swear someone had already built one here, but I suppose not. Grab Nilvacs57 here, he used one as an ECU once. 

Robbie (Forum Supporter) said:
OHSCrifle said:

This is the kind of crazy I come here for. 

You can say that again. 

My kinda "DIY data acquisition" is more like a red solo cup upside down near the rear view mirror, with a nut on a string hanging in the middle. If the nut is basically staying in contact with the cup but sliding around, you are smooth. If the nut is bouncing, well, you could be smoother. 

something something tofu in a cupholder something

Stefan (Forum Supporter)
Stefan (Forum Supporter) MegaDork
9/25/20 11:41 a.m.
Olemiss540 said:

Crazy and amazing. You could damn near have a full dash solution for a few hundred dollars.....

Have you seen the work done on the Lambo project here?  He's built replacement gauges, driven by a Raspberry Pi and TunerStudio.  Probably a few hundred in parts and supplies.  If you're not running MegaSquirt then it isn't quite as cut and dried.

djhedges
djhedges New Reader
9/25/20 2:16 p.m.

I have not but engine tuning is on my bucket list.  I'll have to check that out.

Stefan (Forum Supporter)
Stefan (Forum Supporter) MegaDork
9/25/20 2:41 p.m.
djhedges said:

I have not but engine tuning is on my bucket list.  I'll have to check that out.

https://grassrootsmotorsports.com/forum/build-projects-and-project-cars/new-project-1987-lamborghini-jalpa-theres-no-easy-/102819/page66/

https://github.com/TheJalpa/RasbpianMSDash

I'm pretty excited to see all of these excellent RPi projects on the board.

I'm going to dig into this Exit Speed solution a bit since it is something I might actually be interested in for my Track Car project. 

A while back I wanted to do something like this, but only to log data for review later, I even bought accelerometers for one of my RPi and I already have a 10Hz GPS puck, but the software side was lacking, but now there's so many resources for this that it makes it less frustrating to attempt.

Jesse Ransom
Jesse Ransom UltimaDork
9/25/20 2:55 p.m.

Very cool indeed!

djhedges
djhedges New Reader
9/25/20 3:03 p.m.

Exit Speed does log data locally.  That was the initial design and ensures data points aren't lost due to network connectivity.  Streaming the live data is a very recent addition.  If you get Grafana and Timescale setup you can import the data with replay_data.py.

./replay_data.py --filepath ~/lap_logs/2020-09-24T12:57:12.500000_1.data --timescale_db_spec='postgres://postgres:postgres@server:/exit_speed' --include_sleep=False

--include_sleep=True adds delays between the points as if the data was being logged in real time.  Which is how this demo was created.  https://youtu.be/bjZeXXChDv4 

What kind of GPS puck do you have?

Stefan (Forum Supporter)
Stefan (Forum Supporter) MegaDork
9/25/20 3:37 p.m.

In reply to djhedges :

Cool!

I believe its a QSTARZ unit, but I'll have to double check.  If it doesn't work, they aren't hard to acquire.

djhedges
djhedges New Reader
9/25/20 4:23 p.m.

I would start by seeing if you can get it working with gpsd.  It's the library Exit Speed uses to read from the GPS device. 

http://manpages.ubuntu.com/manpages/bionic/man1/gpscat.1.html

It's been a long time since I initially setup the GPS device and unfortunately I didn't document the steps I took.  My device is based on the u-blox 8 chipset.  I used their windows software to reconfigure the device to output @ 10hz and tweak some other settings.  

pi@exitspeed:~ $ lsusb | grep blox
Bus 001 Device 007: ID 1546:01a8 U-Blox AG [u-blox 8]

You'll need to log in to post.

Our Preferred Partners
X2NquVesntjEzYJiqaga9d5aLiynynRx4NRSoLtTPxHClDZD45mf523MrwWOcbB9