Вы находитесь на странице: 1из 7

ELEC 327

Final Project: Closed-Loop Low-Power Embedded Systems

The Drop Wizard

Dora Cheng, Shawn Matlock, Hamza Rahim, Aryan Sefidi


May 1, 2019
1. Objective
The objective of our final project was to create a closed-loop system that would use the
information gained from previous projects in class that could withstand a drop from any height
and inform the user on the height of said drop.

2. Concept
The idea we have is a device that could fall from varying heights and present the user with
information from the drop, such as the distance of the drop. The device would be portable and
easy to use, being ready to use at the press of a button. Born from these constraints, the Drop
Wizard was summoned from the abyss and took form.

3. Key Considerations
There are many things to consider when designing this system. The first is to find an accurate
way of relating acceleration to drop time or height. Kinematics equations provide ideal
relationships, but to get the most accurate measurements we would need to account for some
non-idealities like air resistance and drag. To minimize these effects, it is important to make our
system light and have a small surface area. An additional constraint is the power consumption
and complexity of the system. We will be using a coin cell battery for power and an MSP430 as
the microcontroller, which provides some guidelines on the types of parts we can use.
One obvious initial concern was survivability of drops. In order for the device to be interesting, it
would have to display heights of more than three to five feet, and so it would also have to survive
drops of more than three to five feet. In order to do this, we wrapped the bottom of the device in
layers of felt.

4. Equipment
The following equipment compose the Drop Wizard:
● Custom Designed Printed Circuit Board
● 2x Kingbright SA39-11SRWA Seven-Segment Display
● MSP430G225 Microcontroller
● SparkFun Triple Axis Accelerometer Breakout - ADXL337
● 8x 200Ω Resistors
● 47000Ω Resistor
● 1μF Capacitor
● 3.3V Coin Battery
● Switch
● Button
● Lavender Felt
Custom Designed Printed Circuit Board
Our printed circuit board (PCB) was designed to be compact, with the display easy to read. The
board measures to be roughly 2 18 " x 2 34 " , giving it a “fit in your pocket” design. One difficulty in
designing the PCB was the fact that the seven segment displays required an individual pin for
each segment that was to be turned on. As a result, the density of traces drawn was greater than
other projects we had worked on. To overcome this challenge, we employed a general design
principle in high density areas of the PCB to have all vertical traces on one side of the board and
all horizontal traces on another side of the board. As a result, the traces on the same side would
be in parallel and higher densities were easier to achieve.

Figure 1: Final PCB Design


Kingbright SA39-11SRWA Seven-Segment Display
The Kingbright Seven-Segment Displays were chosen over an LED screen as we believed they
would be more suitable for hazards of the device’s purpose. We feared that using a LED Screen
would result in it breaking, leaving any data unreadable. Meanwhile, the seven-segment displays
proved to be fairly durable and survived the falls they were subjected to. Based on that
information, we chose to implement them into our design. Additionally, because we only needed
the displays to show numbers, we determined that LED screens would add needless complexity
to the project.

Figure 2: Seven-Segment Display Layout

SparkFun Triple Axis Accelerometer Breakout - ADXL337


The ADXL337 is a small, low-power, 3-axis accelerometer, with a range up to ±3g. With a small
size of 3mm x 3mm x 1.45mm and low-power capabilities, it is an ideal component to be used in
our system because it maintains a small size and meets low-power requirements. We chose the
breakout board for its easy to implement nature as the accelerometer itself is quite small and
proved difficult to solder onto our board.
Figure 3: ADXL337 Functional Block Diagram

Figure 4: ADXL337 Pinout

5. Calculations
Our device uses the time elapsed between the beginning and end of the drop to calculate the
height from which it was dropped. We based our calculations off of the following diagram from
Casio. Using this formula, given the mass of the object, its time in the air, and acceleration from
gravity, we can deduce the height it fell from, with a relatively accurate account of air resistance
as well. When the user presses the button on the PCB, the time starts. Then, once a peak in
acceleration is detected when the Drop Wizard hits the ground, the timer stops and it uses the
elapsed time to discern the drop height.
We hardcoded everything other than time. We knew that gravitational acceleration on Earth was
9.8m/s​2​ and we measured the mass of the device and found that it was 38.5 grams. In order to
determine k, the constant for air resistance, we did some initial tests. We dropped the device
from a height of 2.5 meters and used the device itself (only displaying the drop time at this point
rather than height) to find the time it took to drop that height. We used those measurements along
with the other constants to solve for k.

Figure 5: Calculating Free-Fall Height.

6. Code
The majority of the time spent on the code was initializing all the components and getting
them to work together. After initialization, the majority of the code was within a loop which had
the microcontroller act based on what state the device was in. We determined the states we
needed were an initial “on and waiting” state, a state immediately after the button was pressed
that would set a counter to 0 and begin counting, a state that would allow counting to continue,
and a state after an impact was detected that would calculate and output a height fallen based on
the counter that had timed how long the fall had lasted.
One difficulty we encountered was when writing the code for the analog-to-digital
converter that interpreted the values for the accelerometer. Initially in setup for the
analog-to-digital converter, we put the device to sleep while it waited for results to be processed.
However, we found that the device would sometimes hang. We discovered that the device would
sometimes not wake from sleep mode. In the end, we delayed for 50 cycles while waiting for
analog-to-digital results instead of putting the device to sleep.
One challenge was powering two seven-segment displays with the same seven pins. We
found a method online that showed how the two displays could be rapidly switched on and off,
displaying a separate value on each display. We used this in order to use the same pins to output
the values for different numbers.
7. References
● http://www.ti.com/lit/ds/symlink/msp430g2553.pdf
● https://forum.allaboutcircuits.com/blog/msp430-multiplexed-7-segment-displays.559/
● https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL337.pdf
● https://keisan.casio.com/exec/system/1224830797

Вам также может понравиться