Introduction: Radar(joystick Control) Via Labview(+Arduino)
In fact my device is remake of this radar: http://howtomechatronics.com/projects/arduino-rada...
But I think that making a remake is worth it, because, even despite my version isn't that goodlooking, I don't use such poor 'technologies' like passing through serial port STRINGS instead of single bytes or double negating(from the link: "rotate(-radians(-30));").
Besides that, in my opinion Labview provides wider variety of different controls than Processing, so it allows me to use joystick to control position of the servo. In addition, Labview is very simple language to learn - it took me about three days to acquaint with IDE and make this project. So, if you feel up to make the same radar - all questions or comments are welcome. Good luck!
All photos, sketches and .vi files can be found in attached archive.
P.S. My english language knowledge is based on russian secondary school education, so I'm sorry for the mistakes I've made.
Step 1: Hardware
Ingredients for radar:
- 1 ultrasonic sensor; It works steadily at distances of up to 30 cm.
- 1 potentiometer(better to use joystick)
- 1 Arduino Uno or any another MC(ADC required if you want to use joystick)
- Some wires male-male, female-male
- Pretty-looking stand according to your taste
Ultrasonic sensor is mounted to the servo via hot-melt glue. In Russia we call such way of mounting "by snivel", but another game isn't worth the candle. However, the link from the introduction can lead you to good design solutions.
Step 2: Software. Serial Port SubVIs
Unfortunately, I had some problems with LabView VISA(Virtual Instrument Software Architecture) drivers, that are responsible for communication with peripheral items(in fact it's COM-port driver for LabView). There were two options to solve the problem:
- create C++ class library that would use methods of the System::serialPort class;
- use them directly from the SubVIs and .NET communication LabView functions.
For obvious reasons I chose the second one.
For those, who don't have LabView yet, I attached screenshots of so called 'block diagrams' and 'front panels' of SubVIs. Every block diagram is 'equipped'(sorry, I don't know how to say correctly) with comments. Again: all questions and comments are welcome.
Step 3: Software. Main.vi & 'Edge?' SubVI
The main.vi file is also 'equipped'(again I'm sorry) with comments. Ask, if something isn't clear. The only additional point that I've to state is that graph's default appearance isn't that nice :) I've spent plenty of time configuring it.
In the 'block diagram' you can find one more SubVI: 'EDGE?'. It return true, if input integer equals 180 or 0 and false otherwise. In the top of the step you can find screenshot of the block diagram.
Step 4: Software. Arduino Sketch.
I don't attach any screenshots to this step, 'cause even if you don't have Arduino IDE, you can open .ino file via notebook.
The code isn't that complicated to require any additional description. As Subodh Gupta states, 'Everything is inside'.
Don't forget: joystick can be easily replaced with potentiometer - you just have to gather(I'm sure, this's incorrect word) the simpliest voltage divider.
Step 5: Result
In the pictures you can see that error is not more than 7 degrees.
̶P̶r̶o̶f̶i̶t̶!̶ Congratulations! You'd just completed course of making your own Labview+Arduino radar. Don't be shy to post some comments or press 'Like'.