# Rotatory Mindstorms EV3 Sonar

Is it possible to rotate the radar over its own axis much like a real radar? Well, I was asked this a few days ago and I though it was a nice question and a interesting building.

So, yes, it is possible, and above you can see the finished creation. The overall idea is to place the whole radar over a turntable and turn it to make the rotary motion.

You can see it working on the next video.

So I rewrote the program that run the sonar to draw correctly the distances. In this case it is more bold the problem of drawing what would be a circular area into a rectangle shape. As soon as I finish installing LeJOS on the EV3 brick I will write the program in Java and write the part that communicate the robot with the computer so it can be draw on the computer screen instead of the EV3 brick ( which it is pretty unreadable now as it is spinning ).

The program is quite simple.

Just turn the motor on and keep reading distance and motor rotations. As soon as the radar rotates a full 360 degrees we reset the motor rotations. So the only real problem here is to know when the radar rotates 360 degrees.

If you check the motor rotation and reset it at 360º you will find that the result is incorrect, if you see the above image, when the motor turns it moves a 12 teeth gear that it is coupled with another 12 teeth gear that it is in the same axle that a 24 teeth gear that turns a 56 teeth turntable. Still there?

So what’s the gear relation? 56:24… so to rotate a full 360 degrees on the radar we need to rotate the motor (56/24)*360 degrees.

And well… that’s pretty much all the hard stuff of this program.