SCDrift is an android application that collects data from an Arduino kit strapped to a longboard. It detects when you are sliding/drifting, then scores you based on how strong your slide was. Compete against your past scores or your friends.
I have been a longboarder for several years and always had a fascination with slides. Not only were they fun and provided a good challenge, they posed an interesting physics problem. Creating SCDrift, we gave users an opportunity to actually measure how well their slides are coming along, while also giving me the opportunity to work on a cool physics problem. It's a win-win.
What it does
The app quantifies your slide with a score, which is some feedback which can be used to improve technique, as well as it adds a bit more fun with the competitive aspect. The Arduino collects acceleration, velocity, and rotation data which we use to model the motion of the board. This allows us to detect and score slides.
How we built it
We started by setting up an Arduino board with a gyro, accelerometer, and ultrasonic sensor. The gyro defines orientation of the board on the global axis. The accelerometer defines the acceleration of the board on both the local and global axis, and can be integrated to give velocity. All of this data is then sent to the Android device and computations are performed on it to give the cross product of velocity and board direction: which gives us the slide strength. We then integrate slide strength to give score. The score of each slide is added to the slide history on completion and can be viewed in the app.
Challenges we ran into
- The microcontroller provided did not have bluetooth capability and was poorly documented. We ended up using our own microcontroller.
- The bluetooth module has reliability issues. Bits get shifted and dropped. We filtered out bad data using a checksum.
- We had to source a large amount of hardware we didn't anticipate needing before the hackathon.
Accomplishments that we're proud of
- Getting data to transmit from the Arduino to Android. None of us have had any experience with Bluetooth.
- Solved a cool physics problem
- We implemented our own Bluetooth protocol.
- Great soldering job
- Excellent improvisation
- Working around a FIFO
- Doing lots of matrix and vector math despite brain hurting
What we learned
- Bluetooth protocol
- Using ultrasonic to collect speed
- Crazy control theory
- Collecting data from an accelerometer and gyro
- Differences between Euler and Tait-Bryan angles
- Serial communications
- Bound and Started Services
- The Observer pattern
- Code organization