With the technicalities out of the way, here are the project's objectives:
1) To create a freely rotatable SODAR system that can continuously detect objects
2) To create a UI that displays objects similarly to radar
3) To make it as portable as possible
To accomplish objective #1, we need a way to prevent wires from tangling while the motor spins. There are two ways that we thought would be relatively easily implementable. The first method would be to use two Arduinos and transceivers for a wireless transmission of data from the spinning platform to the computer for display. The other method would be to use something similar to a rotating electrical connection (REC), where the electrical connection would be maintained using a conductive liquid at the intersection.
While it seems to go against objective #3, we decided to go with the rotating electrical connection idea. This is mostly because we didn't know if it'd work and wanted to try something new. On top of this, commercial slip rings are upwards of 20 dollars (price found by ellisgl) and we wanted to see how hard it would be to make a reliable REC. In our project, we are using a vinegar-salt solution as an electrical conductive liquid because it is functional and inexpensive.
Future Work Suggestion:
Use wireless transceivers so the project can be placed in one area and send data to the laptop in another area.
Electrical circuit designer/builder extraordinaire: intensePancake
Step 1: Get Materials
1) PVC couplings - 2", 3", and 4" diameter
2) PVC Bushing - 1"X3/4"
3) Household Goop adhesive (water-proof)
4) Gorilla glue adhesive
5) Elmer's glue adhesive
6) 12" x 12" commercial vinyl tile
7) 6" diameter cylindrical styrofoam
8) Balsa wood: 1/2"x1/2"x36", and 3/8"x3/8"x36"
9) Fun tack
10) Coupler (we used a pen body)
11) Extra cardboard (from packaging, etc)
12) Clear tape
13) White vinegar
15) 3/4" Dowel
1) Arduino Uno board
2) Parallax PING))) Ultrasonic Distance Sensor
3) Stepper motor
4) SN754410 H-Bridge motor driver
5) LM7805 5V voltage regulator
6) 1kΩ resistor (1)
7) 100μF electrolytic capacitor (1)
8) 100nF capacitor (1)
9) Perforated board (1)
10) 9V batteries (2)
11) 9V battery connectors (2)
12) alligator clips (2)
13) connection wire
14) soldering iron and solder
15) solderless breadboard
PVC sidenote: We bought 4 PVC pieces thinking we would need 3 spaces for liquid electrical conductors (ground, power, signal), but we found that our vinegar-salt solution couldn't transfer 5V to the sensor, so we only ended up using two sections and put a 9V on the spinning platform.
Step 2: Cutting and Drilling
Using a miter box, saw the PVC so that all 4 PVC pieces are the same height. In our scenario, that would be approximately 1 & 3/8" in. Afterwards, level the PVC bases with coarse grain sand paper so that it would be flush against the tile.
Cut a 6" x 6" piece off to use as a base for the PVC. From the center of the piece, mark the outer edges of the 4 PVC pieces with a compass. Then drill a central hole atleast 5/16" and three holes for the wires at 1/16" (one hole per section).
Step 3: Gluing: PVC to Base & Balsa to Styrofoam
With the goop, glue wires with stripped ends into the 1/16" holes that were drilled into the tile. Glue these so that about an inch of exposed copper is above the tile and at least a foot of sheathed wire protrude below. Afterwards, apply an even, thick layer of Household Goop on the bottom of the PVC pieces and secure them to the 6" x 6" tile. Use the outlines drawn in the previous step for proper placement. Make sure that each wire is only in its own section (to prevent shorts in the circuit) and that there are no gaps in the glue that liquids could pass through (and short the circuit). Let the goop dry as described in the instructions.
Secure the styrofoam
Find the center of the styrofoam with a ruler and poke a hole through the middle with a pin. This pin will act as a guide for centering the coupler. In our scenario, we dug through our pens searching for a pen body that fit somewhat snugly to the stepper motor shaft. Once the coupler is centered on the styrofoam, secure 4 6" pieces of 3/8" x 3/8" balsa wood around the coupler with Gorilla Glue. Do not glue the coupler into the center yet. The balsa wood design is shown in the picture.
Note: You may want to clamp the balsa wood down or put something flat and heavy on top of it to prevent the Gorilla Glue from expanding in such a way that the balsa wood is not level. Also, since you will be putting the coupler into the center of this later, be careful not to use too much Gorilla Glue or risk filling the center piece when it expands.
Warning: There are a good amount of strong adhesives out there that will eat through styrofoam (think napalm-like reaction). We first tried adhesion with the household goop and, needless to say, we had to go buy a new 6" styrofoam piece.
Step 4: Test for Water-Tight Seal
Step 5: Add Lower Platform
Note: An alternative to this step would be to not have the innermost PVC piece (since only three are needed), and instead have the motor up, level with the PVC on the initial tile base.
Step 6: Binding Bottom to Top
Measure the length of coupler (pen) that you want to use, including a gap between the PVC and balsa wood. In our project, the gap was 1/2".
Binding the pieces:
Add Gorilla Glue to the center of the styrofoam, between the 4 balsa wood pieces. Place the styrofoam upside down so the balsa wood is facing up and put spacers between the balsa wood and PVC (we used 3" x 1/2" x 1/2" balsa wood pieces). After securing the coupler to the stepper motor shaft, place it on top of the styrofoam. The weight of this piece will prevent the expansion of the Gorilla Glue from tilting the styrofoam relative to the coupler.
Step 7: Downloading Code
To control the SODAR device, the Arduino must be correctly programmed, and the computer must communicate with it through the serial port. We have written Arduino code and Processing code to do just that, and it's all available at our GitHub repository.
In order to get the required angular functionality from the stepper motor, we have made some custom additions to the Arduino stepper library. The updated library supports all of the same functions as the default stepper library. It is included in the libraries/Stepper directory in our repository. Just find the libraries/Stepper directory that Arduino uses and replace it with the new one.
For smooth operation, we also implemented interrupt-based PING sensor code using the NewPing library, available for download here. Download this and place it in the libraries directory of your Arduino sketchbook.
Note: The Arduino code must be uploaded to the board before running the Processing UI because the UI takes control of the serial port.
Step 8: Controlling the Stepper Motor
The "GND" and "PING))) Signal" wires are the same wires that were glued through holes in the tile in Step 3. These are for communication between the Arduino and the PING sensor. For an easy connection, put alligator clips on these wires, and use them to finish the connection. Now, one end of these wires should be in the vinegar-salt solution chamber, and the other end should have an alligator clip on it.
After building this circuit, you should be able to control the motor with the Arduino Stepper library.
Step 9: Connecting the PING))) Sensor
Follow the schematic to build the PING Sensor power supply circuit. Solder it together on a perforated board for stability. This circuit will go on top of the rotating platform, and will supply a constant 5 volts to the sensor. The capacitors are there to stabilize the input and output and minimize electrical noise.
The two wires that lead into the circuit, "GND" and "PING))) Signal", must be long enough to make it through the styrofoam and into the salt-vinegar solution below. For us, they needed to be about 7 inches long. When in doubt, though, it's always better to cut them long and adjust them later.
Mounting the board
Once this circuit is completed, place it on top of the styrofoam platform. You may need to angle the sensor upward so that it doesn't only see the platform. We secured the circuit board to the styrofoam with extra pieces of wire that we stuck into the styrofoam. These weren't electrically connected to anything. We also made a 9V battery holder from a piece of cardboard and clear tape, and glued it to the styrofoam with normal Elmer's glue to keep it there.
Step 10: Final Construction
Add salt into about one cup of white vinegar, stirring constantly, until the solution is saturated (no more salt will dissolve). This liquid can conduct electricity. Pour it into the PVC chambers to an acceptable height. There needs to be enough to touch both wires in each chamber as it spins. There should be no leakage, especially after testing in Step 4.
We noticed that when a current was running, many bubbles formed at the wire in the vinegar-salt solution due to hydrolysis reactions.
Note: When pouring the solution into the chambers, the rotating platform should probably not be attached.
Reattaching the platform
If your coupler is a pen (like ours) or a similarly shaped object, there is likely a gap between the inner walls of the coupler and the motor shaft. To alleviate this problem, we used fun tack to secure the coupler. To do this, put some fun tack into the bottom end of the coupler before placing it back on the motor shaft. Slowly push the coupler onto the motor shaft, possibly holding it with needle-nose pliers, until there is about a 1/2" gap between the PVC and the balsa wood.
Connecting through the vinegar-salt solution
In Step 9, we made the signal wire and ground wire coming out of the PING sensor circuit long. Guide those wires through the styrofoam into their respective chambers so the exposed ends are in the vinegar-salt solution. The integrity of this connection must be maintained throughout rotation of the platform, so make sure enough wire is touching the solution.
Step 11: Final Product
1) Connect the Arduino to your computer through a USB cable.
2) Program the board with the Arduino code from our GitHub repository.
3) Connect both 9V batteries to the battery holders.
4) Start the Processing code.
You are now running a portable SODAR device capable of detecting objects up to 300cm away in any direction. Congratulations!