DIY 360 Degree SODAR Device




First off, why did we decide to call this thing SODAR? SOnic Detection and Ranging, or SODAR, is a lot like SONAR and RADAR. However, we don't feel comfortable calling it SONAR because we have no desire to use it for navigation and we aren't under water. Also, it's definitely not RADAR as we are using ultrasonic pulses, not radio waves to find objects. 

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

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Get Materials

Non-electrical 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
14) NaCl
15) 3/4" Dowel

Electrical materials:

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) 100μF electrolytic capacitor (1)
7) 100nF capacitor (1)
8) Perforated board (1)
9) 9V batteries (2)
10) 9V battery connectors (2)
11) alligator clips (2)
12) connection wire
13) soldering iron and solder
14) 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

We are writing these instructions the same way we made the SODAR but this is a reminder that we only ended up needing 3 PVC pieces.

PVC editing:

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.

Tile editing:

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

Secure the PVC

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

Fill the sections with water, looking for any leaks. If you want to, you can fill all three and then put a drop of food coloring in each looking for cross bleeding. In our scenario, we did this step after Step 5, but a leak would be much less damaging if found before that step so we recommend doing the test at this point.

Step 5: Add Lower Platform

With the upper platform flipped so the tile is on top, place the stepper motor shaft into the center hole. Cut eight 3" long 3/4" diameter dowel pieces as spacers between the upper and lower platforms. Using Goop, glue four of the pieces so that the motor is stabilized. Glue the other four farther away from the center so that the weight is more evenly displaced. Glue a second 6" x 6" piece of the tile to the bottom of this and let it dry. It is best to have the motor securely flat against the bottom tile.  However, if you don't want glue on the motor (like us), and lift it, you run the risk of having to put small spacers to level is after everything dries (like us). The picture shows the piece after this step with the uncut coupler (a pen with fun tack).

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

Cut the coupler:

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

Arduino, Processing, and Our 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.

Stepper library

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.

NewPing library

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

An Arduino Uno was used to control the stepper motor. Follow the schematic to connect the Arduino to the motor driver, and the driver to the stepper. The motor can be driven by a 9 volt battery, and our current measurements show us that battery life is about 1.5 hours of continuous use.

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

Building the circuit

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

Vinegar-salt solution

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

Four Little Things

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!

Arduino Contest

Finalist in the
Arduino Contest

Battery Powered Contest

Participated in the
Battery Powered Contest

1 Person Made This Project!


  • Instrument Contest

    Instrument Contest
  • Make it Glow Contest

    Make it Glow Contest
  • STEM Contest

    STEM Contest

100 Discussions


4 years ago on Introduction


Is there anyway to use HC-SR04 sensor instead of ping? I can't seem to find it in my country and importing it costs around 65$

4 replies

Reply 4 years ago on Introduction

There would be some changes to the project you would have to make because the HC-SR04 looks to be a 4 pin sensor instead of 3 pin. But the NewPing library supports the HC-SR04, so you should be able to use it.


Reply 7 months ago

Hola, como debo de manejar los pines, por separado?


Reply 6 months ago

If you are talking about the HC-SR04 4-pin setup, I think I have a simple way for you to get it to work. In the project, we had 3 chambers for liquid-connections, but had to put the battery on the top because not enough power would transfer through the liquid interface. So we only used 2/3 chambers with the PING sensor. But you could use all three chambers for the 3/4 pins in the HC-SR04, and put the battery on the top of the system, like we did. You would have to only slightly modify the code to get this to work.


Reply 7 months ago

If you're talking about the serial.ino + sodar.ino files, you have to open them both in a single Arduino sketch to upload both to the Arduino.


1 year ago

Dear Burstolava

I know there is a long time from the last post, I´m trying to build this awesome project, It seems Arduino and hardware are working properly but when I play UI at processing radar is stopped I mean the green part is stopped in the right side of the window 90 degrees with no motion I write start but stills same

I checked that Arduino is sending data, stteper motor is running and I can hear those small clicks from the SRF05 ultrasonic transducer so seems everthing it´s ok

Could you give me some advices ?

Thanks in advance

Best regards

4 replies

Reply 7 months ago

Hola tienes la librería paso a paso modificada es que no la he podido descargar, te lo agradecería mucho.


Reply 1 year ago

The green part moves based on the angle that the Arduino specifically states through the serial communication to the computer. Maybe the Arduino serial port is not defined correctly by the UI? Have you tried changing the line in the UI.pde file "arduino =newSerial(this, Serial.list()[0], 9600);"? To change it to Serial.list()[1]....


Reply 1 year ago

Finally I solved, it was an Issue with the serial port


Question 1 year ago

1.Hola me dejo Asombrado y me inspire para un proyecto en mi clase no tengo experiencia alta en arduino pero mira mi problema es este

1 como la conecto e forma inalambrica

2 como añado un parlante de 8ohm 1w que pite diferentes tonos a medida que hacerca el objetivo

me puedes decir si hay que cambiar algo en código

Felicitaciones y sigue así tienes muy buenos proyectos

por favor rapido

1 answer

Answer 1 year ago

We did not implement wireless connectivity in this project. That was a suggestion for making the project even better than it is now. Unfortunately, the only way that I can think of how to add the speaker as you describe in #2, I think you would have to connect it to the Arduino and modify the code for this specific purpose.


2 years ago

Hi dear, i am doing a school work based on your project. The main differences between my project and yours is that my stepper motor will step 360 degrees to one direction and 360 degrees to the other in order to avoid all the construction that you build. I think i've managed to solve this issue but there's another problem. The sensor i'm using is a HC-SR04 which has a trigger and echo line. I'm a begginer in programming and I don't really know how I could change my program in order to make it work. Could you tell me which are the main parts i should modify in the arduino code related with the HC-SR04 and also I would like to know if something should be changed in the processing code. As I said i just modified the motor and the sensor and my last request is that i just would like to know if there would appear any more problems. By the way, it doesn't currently work, when i play the processing code, it goes crazy.

6 replies

Reply 2 years ago

For a 4-pin setup, you need to indicate the correct pin numbers in "sodar.ino" lines #5 and #6 (#define TRIGGER_PIN ____). This will depend on how you connected the wiring to the Arduino.

I just downloaded Processing3 and ran the "UI" code, it seems fine to me on my Mac. What do you mean by "it goes crazy?"

Nothing needs to be changed in the processing code.

The code is written to continually rotate in one direction. If you want to go back and forth, you'll have to change the part of the "sodar.ino" file at line 58. Putting in a negative value here will cause the stepper to go the opposite direction.


Reply 2 years ago

Hello again and thank you for your response. The fact of knowing that I don't have to change the processing code is such a relief.

First of all, as it's a different sensor from yours does the NewPing library still work?

When you said that I have to put a negative value in line 58 to make it rotate to the opposite direction:

if(!stopMotor) {


It will only turn to the opposite direction. However, how can I make it change direction constantly with this method? We have to consider that after every step it has to send data, so to respect this condition i had thought of this code:

void loop() {

for(int STEPSCounter=0;STEPSCounter<=800;STEPSCounter++){

if (STEPSCounter<=400){


else if(STEPSCounter>400){




And inside every if I would also add the void loop code you have in your program. However I'm not certainly sure whether it would work. Could you clarify what you said about what you would change to make it rotate properly?

When I play the processing code and said it went crazy I meant that the green part stays at the right, it doesn't move and ocasionally jumps into random angles and then jumps back to the right. In addition, some spots also appear randomly.

Thank you in advance :)


Reply 2 years ago

You could google it to verify, but I'm pretty sure NewPing will work on your motor.

The "loop" function iterates constantly, so you don't need an internal for loop. Maybe use global variables to do something like...

int iterateAngle = 0;

boolean forward = true;

void loop() {

//all the normal code in the loop function






iterateAngle += 1;

if (iterateAngle = 200) {

forward = !forward;

iterateAngle = 0;



I do not know what the issue would be with your Processing code, but it would likely be with the serial communication. Whatever the Arduino sends to the Processing code (angle and distance), the Processing code displays it. One suggestion I have is that line #55 of UI.pde guesses that the Arduino is connected at 'Serial.list()[0]', if you have a bunch of things connected to USB ports on your computer, this might not be true and it would be pulling data from some other instrument attached to your computer.


Reply 2 years ago

Due to the program you suggested i finally managed to program the motor correctly. In addition, i tried the processing code in another computer and the green part started rotating properly.However, no dots appeared. The wiring regarding the sensor is also correct theoretically, maybe the 4-pin sensor i have might no be compatible and i should replace it for a 3-pin sensor.

Could you please explain very briefly what the different parts(UI,console,dots,serial,nTree) of the processing code do?Moreover, could you explain aswell how the black text window which shows up when you play the processing code works?'Cause i've seen there are some commands like start,stop,history,pps,rpm, etc but some of them i dont know how they work.

Thank you again.


Reply 2 years ago

Hi again, just wanna clarify that the program actually works correctly. The 4-pin sensor didn't need such a complicated schematic wiring, just connecting the 5 volts from the arduino to the sensor, and it worked well. So the big problem is solved :)

However if it's possible try to explain me what i asked in the previous comment.

Thank you :)


Reply 2 years ago

Okay, the UI.pde file deals with setting up the interface and then draw() is a command, like in Arduino main code, which loops continuously. This is responsible for changing the interface while the program is running. console.pde organizes functions and data structures that deal with the console, which is the black text window. When you press any key, the "keyPressed()" command is called in console.pde. Specifically, if you hit "enter", the program calls processCmd(), and attempts to figure out what your command was, and do it. console.pde contains the code that tells the Arduino commands. serial.pde listens for anything the Arduino might send, such as your [distance, angle] signal combinations. serial.pde will add new dots to the total number of dots and when the UI.pde calls draw() again, it will see a new dot and display it on the screen.

dots.pde is just a data structure to organize the dots that appear and disappear over time, as your sensor detects things. nTree is a data structure for an n-ary tree. We put this in so if you type "sp" and then hit the Tab button, the console will complete it to "speed" automatically.

'start', 'stop', and 'clear' are pretty obvious commands. 'speed' and 'rpm' do the same thing, tell you the current speed and if you do something like "speed(x)", it's supposed to change the speed to that rpm. 'move()' is supposed to let you specify the exact angle you want the sensor to be looking at, and the motor will reposition itself to that angle. 'history' is an internal variable for the console, not very useful. As a caveat, because you're not making the project as I've posted it, I can't guarantee these commands are all working as intended, but I've explained what they are supposed to do.

Hope this helps make sense of the code.


2 years ago

hi dear friemd ( again )
( long time because i forgot my password )
tganks for your great project
i am trying to make it
but i have problem :

i have HY-SRF05 UL module
it working by to wire ( trigger and echo line )
this is HY-SRF05 Library :

/* Tested with HY-SRF05, HC-SR04 Assuming a room temp of 20 degrees centigrade The circuit: * VVC connection of the sensor attached to +5V * GND connection of the sensor attached to ground * TRIG connection of the sensor attached to digital pin 12 * ECHO connection of the sensor attached to digital pin 13

const int TRIG_PIN = 12;
const int ECHO_PIN = 13;
void setup()
// initialize serial communication:

Serial.begin(9600);   pinMode(TRIG_PIN,OUTPUT); pinMode(ECHO_PIN,INPUT); }

void loop() {
long duration, distanceCm, distanceIn;

// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(TRIG_PIN, LOW); delayMicroseconds(2); digitalWrite(TRIG_PIN, HIGH); delayMicroseconds(10); digitalWrite(TRIG_PIN, LOW); duration = pulseIn(ECHO_PIN,HIGH);

// convert the time into a distance
distanceCm = duration / 29.1 / 2 ;
distanceIn = duration / 74 / 2;

if (distanceCm <= 0){ Serial.println("Out of range");
else {
Serial.print(distanceIn); Serial.print("in, "); Serial.print(distanceCm); Serial.print("cm"); Serial.println();

and how can i mix sodar.ino and serial .ino together and program to arduino board ?
can you edit sodar file via HY-SRF05 and mix it by serial too and put it here ?