By Sam Proctor, Smart Solutions Research & Development
I love making this stuff, it’s so satisfying to get from the beginning to the end, from a shaky nothing idea to something that’s well formed and the audience really likes. I’ve learned from experience that if you work harder at it, and apply more energy and time to it, and more consistency, you get a better result. It comes from the work.
The idea behind the Smart Data Acquisition Box is to create a data logging device that will give us the location on the track, speed & attitude. As a bare minimum, later we would want to interface this unit to the OBD port and obtain real-time engine performance metrics.
Obtaining location on the motorcycle on the track is accomplished using GPS, for this task we are using a 10Hz GPS unit. Using the MTK3339 chipset and the breakout board from Adafruit
Interfacing this unit is simple via hardware UART, of course we could use a software serial port via ‘bit banging’ however for the 10Hz updates this might overburden the micro controller when the rest of the sensors are connected.
Measuring the ‘movement’ or inertial data of the motorcycle is required to calculate the attitude of the bike. For reference we use the Pitch, Roll & Yaw system as illustrated in the image below.
From this diagram we can easily see how Pitch, Roll & Yaw relates to the more commonly used names of Lean Angle and Wheelie Angle.
- Lean Angle: Roll
- Wheelie Angle: Pitch
In order to calculate these angles we need to do some processing of raw data, the common term for this is a Attitude & Heading Reference Systems (AHRS). How this is accomplished is explained later for now we explain the sensors used to capture raw data for these calculations.So, for this we use two separate devices to capture the two sources of data:
- Acceleration: LSM303 3-axis accelerometer: ±2g/±4g/±8g/±16g selectable scale
- Angular Rate: L3GD20H 3-axis gyroscope: ±250, ±500, or ±2000 degree-per-second scale
Thankfully we can get these sensors plus a temperature sensors and compass all together in another breakout board from AdaFruit
We also need something to record the data samples onto, since the analysis will take place post capture. For this we turn to AdaFruit again for a SD Card board that will allow us to write all the captured data to file.
Clearly we need some form of computer to read, process and store all these measurements. Since the unit is to be mounted on a bike and quite possibly many other forms of moving or vibrating equipment, the computer part should not be large or power hungry.
The Arduino project has seen massive use and development outside of the original board. It comes complete with an IDE and to make it complete adafruit provide software to interface to all there breakout boards.
Thankfully, the Arduino also comes in micro form, available from AdaFruit
Now we need to decide how to connect the sensors and SD Card board to the Arduino, thankfully, due to good documentation this is quite easy. The diagram below shows how each device will be connected.
Now that we have the design the circuit can be breadboarded, the reason for this step and not going straight into designing a box to house it on the bike is to ensure the components are all working and that we can do the calculations required.
Once this has been proven, then we can think about the best way to mount the device on a motorcycle.
Using a series of jumper wires we can quickly connect up the components, the image below shows the resultant circuit on a breadboard, the lights are illuminated since the Arduino is plugged into USB, which also provides power for the circuit.
Testing the Circuit
Testing the circuit at this stage consists of ensuring we can connect to each device from the Arduino, this is accomplished by running the example scripts that come bundled with the Arduino or those available from adafruit.