|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
Hello!
My team and I have been looking for programming codes, wiring ideas etc. for our LV-MaxSonar-EZ1. All help is appreciated ![]() |
|
#2
|
||||
|
||||
|
Re: Help for LV-MaxSonar-EZ1
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.
|
|
#3
|
|||||
|
|||||
|
Re: Help for LV-MaxSonar-EZ1
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. |
|
#4
|
||||||
|
||||||
|
Re: Help for LV-MaxSonar-EZ1
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.
|
|
#5
|
|||
|
|||
|
Re: Help for LV-MaxSonar-EZ1
Quote:
![]() |
|
#6
|
|||
|
|||
|
Re: Help for LV-MaxSonar-EZ1
Quote:
Thank you all for your help! |
|
#7
|
||||
|
||||
|
Re: Help for LV-MaxSonar-EZ1
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. |
|
#8
|
||||
|
||||
|
Re: Help for LV-MaxSonar-EZ1
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) |
|
#9
|
|||
|
|||
|
Re: Help for LV-MaxSonar-EZ1
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 |
|
#10
|
||||
|
||||
|
Re: Help for LV-MaxSonar-EZ1
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.
|
|
#11
|
|||
|
|||
|
Re: Help for LV-MaxSonar-EZ1
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 |
|
#12
|
||||
|
||||
|
Re: Help for LV-MaxSonar-EZ1
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)....
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|