The schematic used for the speedometer is rather simple. It includes a TWI/I2C setup and the connections shown graphically above. The connection between the Accelerometer and the A3BU’s J1 header is very straightforward. Ground connects to ground, vcc connects to vcc, sda to sda, scl to scl, and two 4.7K ohm resistors connecting VCC and sda/scl.
This code snippet shows how the speedometer takes inputs form the accelerometer and turns those inputs into a speed. For the purpose of this project, it was assumed that the object would only be traveling in the x and z planes (as in a toy car traveling down a ramp).
The goal of Double Dragon’s project was to create a simple speedometer that could be attached to a toy car, or some other object. It uses an accelerometer and some basic math to determine the average speed of an object over a small amount of time and displays this information to the A3BU. This device could easily be modified to also calculate the acceleration of the object.