Log in

View Full Version : Help for LV-MaxSonar-EZ1


kakugyou
08-01-2014, 16:13
Hello!

My team and I have been looking for programming codes, wiring ideas etc. for our LV-MaxSonar-EZ1. All help is appreciated :)

atucker4072
08-01-2014, 16:18
Hello!

My team and I have been looking for programming codes, wiring ideas etc. for our LV-MaxSonar-EZ1. All help is appreciated :)

First of all what do you plan on using it for? There are a lot of things you could use a sonar sensor for this year.

DonRotolo
08-01-2014, 22:42
I have been successful using the Analog output of the sensor wired to an Analog input on the Analog Breakout of the cRio to measure distance. The voltage is proportional to the measured distance. Programming should be straightforward (but I am not a programmer)

Of course the sensor needs power & ground to function.

Joe Ross
08-01-2014, 22:52
The LabVIEW example finder has an example for the EZ1 using analog. Like all of the NI FRC examples, it not only has code, but wiring pictures.

kakugyou
10-01-2014, 16:32
First of all what do you plan on using it for? There are a lot of things you could use a sonar sensor for this year.

We plan on using the sensor for measuring the distance to the wall. Thank you for the reply! :)

kakugyou
10-01-2014, 16:36
I have been successful using the Analog output of the sensor wired to an Analog input on the Analog Breakout of the cRio to measure distance. The voltage is proportional to the measured distance. Programming should be straightforward (but I am not a programmer)

Of course the sensor needs power & ground to function.

Would you mind elaborating that please? Our team doesn't have much expertise in that division. (We have almost no expertise actually)
Thank you all for your help!

cgmv123
10-01-2014, 17:31
You'll want to use a PWM cable cut in half to connect the sensor to the Analog Breakout. One end of the cable should be the female end and the other end should have 3 bare wires.

Red wire should go to the +5 pin on the sensor. Black wire to GND on the sensor and white wire to AN on the sensor. You'll need to solder all 3 connections. The connector end of the cable goes into the Analog Breakout. Black wire to GND, red wire to +5v and white wire to SIG.

In software, you'll need to find the AnalogVoltage (or something similarly titled) function. I can't help you much beyond that, since I'm not familiar with LabView.

When you read a voltage, every .0098 volts equals one inch. The relation is proportional.

billbo911
10-01-2014, 18:00
Fortunately the EZ1 has multiple outputs to choose from. Personally I prefer the PWM signal.

Additionally, LabView has an example on how to use it with this method.

Once LV is open, select the Support tab on the left (See image 1)
Next, select Find FRC Examples. (Again image 1)
Expand the "Sensor" branch, and open the "EZ1 M1010 Sonar Digital.lvproj". (Image 2)
When you have the example open, you will see all the details you will need to get it to run on your robot. (Image 3)

Average Joes
11-01-2014, 02:28
Hi guys,

I'm wondering whether anyone can post images of each step (programming code and wiring pictures) from the LabView example for the EZ1?

I'm curious as to how I can wire the EZ1 to the cRio and would appreciate any help.

Thanks in advance

atucker4072
11-01-2014, 02:32
Keep in mind that anything in front of the sensor, it would be best to use the vision tracking that way you can get a value that won't change based on elements on the playing field.

Greg McKaskle
11-01-2014, 07:14
I'd be willing to post some pictures from the LV example, but perhaps a better approach would be to install it and experiment with it yourself. It is useful to have a second SW tool that you can use to verify if a sensor works, how well it works, "is it the code or the sensor", etc. I have nothing against printfs. But sometimes a panel is worth a thousand printfs.

Greg McKaskle

fovea1959
14-01-2014, 13:04
we were after the screen shot just for the wiring diagram, but we can glean that from the email thread (+5V, GND, and either the PWM or AN)....