|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Sonar Sensor help
Hey guys,
I am attempting to connect a MaxBotics EZ0 Sonar sensor http://www.sparkfun.com/commerce/pro...oducts_id=8502 to the 2008 FRC robot controller. I have read through this post: http://www.chiefdelphi.com/forums/sh...ght=mike+sonar and have attempted to use Mike's code to get data from my EZ0 sensor. The code that Mike posted was designed for Parallax Inc. PING)) Ultrasonic Rangefinder and the Vex Robotics Ultrasonic Range Finder, but is it possible to use the code with the MaxBotics sensor? are there any other ways to get a signal from this sensor? Any help i can get with this sensor is highly appreciated, from getting signal to general operation tips, because i am new to Sonar. thank you in advance |
|
#2
|
|||||
|
|||||
|
Re: Sonar Sensor help
The Maxbotics Sonars are great... and easy to work with, too. Probably the easiest out there to interface to the IFI controller, in fact. We have used them the past two years.
The simplest way to connect them is using the analog signal. If you look at the datasheet (find the link at the bottom of the page you referenced) you will see that there is an "AN" pin that gives you an analog output of the last measured range. If you hook up your +5, GND and AN (take a servo cable, cut one end off, and solder it to the appropriate points on the sonar, then plug it into the RC's analog I/O) then all you need to do is read the analog value of the appropriate pin whenever you need a distance measurement. (Page 16 of this document discusses reading the analog inputs.) You might want to use a printf routine to show you the values that you get at different ranges. There are more complex ways to use these sonars, too... but this should get you up and running. Jason |
|
#3
|
|||
|
|||
|
Re: Sonar Sensor help
i would rather use the lego mindstorms ultrasonic sensor
which much easier to program Here is the link http://mindstorms.lego.com/Products/...%20Sensor.aspx Just have look at the other sensor and give me reply if they can be used with the FRC robots |
|
#4
|
|||||
|
|||||
|
Re: Sonar Sensor help
Quote:
The lego minstorms sensor is specifically designed to work with the LEGO platform, so when you refer to it being "easier to program" are you referring to it being easy to program on the NXT or on the IFI Robot Controller? It is certainly easy to program on the NXT because the NXT compiler contains code to interface with that specific sensor. The Maxbotix sensor, however, is about the easiest sonar to interface to the IFI RC if you use the analog input (which is really, really easy to use... just one line of code!) This is that because rather than returning raw sensor data, the Maxbotix actually contains a PIC chip that processes the data and provides the information in a variety of formats suitable for a wide range of processors. Jason |
|
#5
|
|||||
|
|||||
|
Re: Sonar Sensor help
Quote:
|
|
#6
|
||||
|
||||
|
Re: Sonar Sensor help
As others have stated, the Parallax PING))) is just awesome. Here's a link to a place where I posted my driver for the PING))) sensor.
Only needs 1 pin/sensor, and have really narrow angle acceptance ranges (narrow beam) which is great for finding objects. Not to mention, the price isn't half bad either. Oh, and if you don't mind my asking... what are you using this sensor for? -q p.s. If anyone is interested, I have code that will run four PING)))-type ultrasonic sensors at once (simultaneously/asynchronously) that just needs a little clean up to be post worthy. Just let me know. |
|
#7
|
|||
|
|||
|
Re: Sonar Sensor help
oh, so it should just be one easy line..
im using kevin's code, so Get_Analog_Value does not exist, im trying to get a value with Get_ADC_Result, but it still comes up as 0. Should Get_ADC_Result work? oh btw this sensor will be used for avoiding obstacles |
|
#8
|
|||
|
|||
|
Re: Sonar Sensor help
aha, finally got data,
i didnt configure adc.h to read from 2 channels instead f just 1 (we have a gyro taking that one up) a preliminary thing ijust noticed is when i put my finger right on the sensor, to represent something being really close to it, instead of 0 it read 52, how come? |
|
#9
|
||||
|
||||
|
Re: Sonar Sensor help
Quote:
-q |
|
#10
|
|||||
|
|||||
|
Re: Sonar Sensor help
Easier than a single line?
Quote:
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SONAR Sensor Software Driver | MikeDubreuil | Programming | 55 | 08-03-2008 11:03 |
| Sonar Function Issue | Andrew Blair | Programming | 2 | 20-02-2007 13:39 |
| Maxbotix Sonar Sensor | DonRotolo | Electrical | 17 | 04-02-2007 12:27 |
| VEX Sonar question | Joohoo | Programming | 2 | 06-05-2006 01:18 |
| Help with sonar sensor | supertw | Electrical | 3 | 24-01-2006 23:41 |