View Single Post
  #2   Spotlight this post!  
Unread 05-05-2008, 01:35
dtengineering's Avatar
dtengineering dtengineering is offline
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,829
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
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