Dennis O’Donnell
Farhud Agharahimi
EECS
373, Winter 2005
April 22, 2005
Project Description:
For our project, we constructed a device to levitate a ping-pong ball in a vertical transparent plastic tube at a desired height. A small fan was set up at the bottom of the tube and an infrared sensor was set up at the top of the tube, where the former was used to control at witch height the ball would float (via the use of Pulse Width Modulation techniques to vary the duty cycle of the motor) depending on the readings of the latter.
The user sets the desired height using an ultrasonic ranger distance sensor. More specifically, the user specified the desired height by holding an ultrasonic ranger a certain distance from some object (such as a wall or a clean sheet of paper), and once they pressed push-button S1 this distance became the new desired height. (Note that for us height is measured as the distance downward from the IR sensor at the top of the tube).

|
|
|
|
|
|
Desired Height Current Height
Ping Pong Ball
User
Object
Duty Cycle
External Circuits:
Since the Test Point couldn’t draw sufficient current to control the fan properly, we used an NPN Switching Transistor to help draw the current required. We used the relay to control the on and off states for the Pulse Width Modulation signal. Since we were encountering a great deal of noise from the relay (which disrupted our ability to switch the duty cycles), we employed the use of a few diodes to reduce this noise.
This is a rough circuit diagram of the set-up we used for our proto-board, centering on the relay:
5 V
5 V
![]()
diode

|
|
|
|
|
|
diode
![]()
|
|
|
|
|
|
![]()
![]()
![]()
|
|
|
|
|
|
![]()
![]()
![]()
![]()
![]()
![]()
TP
47-
Ohm
NPN Switching
![]()
![]()
![]()
Transistor
![]()
![]()
![]()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|

Project Approach:
The broad steps we took in constructing our device were as follows:
Set up the fan motor for PWM operation
Set up the ultrasonic range finder, take readings and calibrate it (originally at top of tube).
Set up the physical superstructure to accommodate the plastic tube and fan motor.
Set up the infrared sensor, take readings and calibrate it (replacing ultra-sonic sensor at the top of the tube).
Refashion ultra-sonic sensor to input the desired height.
Set up and tweak the control algorithm.
Issues:
We encountered a great deal of issues as we were working on this project:
The original fan that we used, a rectangular “computer cooling” type fan, was too weak to effectively move the ping pong ball up the tube, largely because of it’s rectangular shape and our inability to channel the accelerated air efficiently into the much smaller cylindrical tube. We decided to switch to a different type of fan with a small cylindrical output funnel that worked much better with our tube.
Before using an IR sensor at the top of the tube, we were actually running the ultra-sonic ranger there. This was problematic for a number of reasons, but most notable was the creation of standing sound waves further down the tube, which made the readings of the sensor useless beyond a certain range. Re-assigning the sensor to a task outside the tube (i.e. the task of setting the desired height) allowed us to put it to good use. We also encountered problems with noise on the output signal of the ultrasonic sensor, which we fixed by building a filter in hardware.
After we replaced the ultrasonic sensor at the top of the tube with an IR sensor, we noticed that the IR sensor seemed to give inconsistent readings at times. This problem plagued us for a while, until we realized that simple and small movements of the sensor as it was mounted at the top of the tube (rotating it, in particular) caused it to give highly disparate readings. We had to make sure that we kept the sensor securely mounted in one spot, and that our readings were calibrated properly for that particular spot.
A particularly large problem for us was that fact that we were originally running the fan motor with a 5V power supply routed directly through the proto-board, only to realize later that the proto-board didn’t have the capacity for current necessary for our PWM implementation. We replaced this device with one of the standard lab power-supply units, which worked much better.
We were experimenting with different tube sizes, and for a long time we were using a smaller-diameter tube that was only slightly larger than the ping-pong ball it accommodated. While this didn’t seem like a problem at first, we realized that the accelerated air couldn’t move higher past the ball and pressure was building up below it, potentially altering the aerodynamics of the tube in ways we could not really predict or analyze. We switched to a larger tube and this seemed to give us better control of the ping-pong ball.
Unresolved Issues:
We were unable to completely protect the system from sporadic bad readings from the IR sensor. Eventually, a reading would cause the control mechanism to lift the ball off the base even though the desired height was at base level. In addition, the program would halt at sporadic times due to FP Unavailable Exceptions, and External Breakpoints. These halts would occur almost randomly, with the program running stably for hours in some cases, yet halting out after 60 seconds in others. These errors would reappear even after no modifications to the hardware or software.