Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Great Ultrasonic Ranger

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
6 postsPage 1 of 1
6 postsPage 1 of 1

Great Ultrasonic Ranger

Post by dshinsel » Sat Apr 08, 2006 6:17 am

Post by dshinsel
Sat Apr 08, 2006 6:17 am

Hi gang,

I think I found a great solution to object sensing. (along with various IR sensors, of course)

For Ultrasonic Ranging, I have used just about every one that exists.
I found a new one that seems to work GREAT for RoboNova!

It's called a Maxbotix EZ1, and sells for $25 at Sparkfun.
http://www.sparkfun.com/commerce/produc ... cts_id=639

This ranger puts out an analog voltage corresponding to the range to nearest object. It has a very linear response. I simply plugged it into an A/D port and it worked!


I measured the range from 1" to 4 feet, and found a best fit algorythm that works well, and is very simple! RangeInches = (value * 2) + 2


I plan to mount this on the chest of my RoboNova, there is even extra room where the metal is cut out.... I'll send pictures when done.

Dave Shinsel
shinseljunk (at sign) verizon.net
Hi gang,

I think I found a great solution to object sensing. (along with various IR sensors, of course)

For Ultrasonic Ranging, I have used just about every one that exists.
I found a new one that seems to work GREAT for RoboNova!

It's called a Maxbotix EZ1, and sells for $25 at Sparkfun.
http://www.sparkfun.com/commerce/produc ... cts_id=639

This ranger puts out an analog voltage corresponding to the range to nearest object. It has a very linear response. I simply plugged it into an A/D port and it worked!


I measured the range from 1" to 4 feet, and found a best fit algorythm that works well, and is very simple! RangeInches = (value * 2) + 2


I plan to mount this on the chest of my RoboNova, there is even extra room where the metal is cut out.... I'll send pictures when done.

Dave Shinsel
shinseljunk (at sign) verizon.net
dshinsel

Post by Morbeious » Sat Apr 08, 2006 1:51 pm

Post by Morbeious
Sat Apr 08, 2006 1:51 pm

interesting can't wait to see the results/code, that would be mouted outside on the chest?
interesting can't wait to see the results/code, that would be mouted outside on the chest?
Robots Own/Operated: HeathKit Jr, OmniBot 2000, Lego MindStorms, RSV2, RoboNova-1
Morbeious
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 56
Joined: Tue Mar 21, 2006 1:00 am
Location: Metro Detroit, Michigan, USA

Post by fungo » Sat Apr 08, 2006 10:08 pm

Post by fungo
Sat Apr 08, 2006 10:08 pm

This is very interesting! I have a question though. How does one debug the RN-1 software when it comes to such values. In order words can you explain to me how you can monitor what the sensor would be recording in terms of distance? Is there a way to monitor this off the PC?
This is very interesting! I have a question though. How does one debug the RN-1 software when it comes to such values. In order words can you explain to me how you can monitor what the sensor would be recording in terms of distance? Is there a way to monitor this off the PC?
fungo

Post by Morbeious » Sat Apr 08, 2006 11:01 pm

Post by Morbeious
Sat Apr 08, 2006 11:01 pm

not sure if you can montior it off the PC, But if you put a LCD on the RN-1 you can output the values to it.
not sure if you can montior it off the PC, But if you put a LCD on the RN-1 you can output the values to it.
Robots Own/Operated: HeathKit Jr, OmniBot 2000, Lego MindStorms, RSV2, RoboNova-1
Morbeious
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 56
Joined: Tue Mar 21, 2006 1:00 am
Location: Metro Detroit, Michigan, USA

Post by Pev » Sat Apr 08, 2006 11:48 pm

Post by Pev
Sat Apr 08, 2006 11:48 pm

fungo wrote:This is very interesting! I have a question though. How does one debug the RN-1 software when it comes to such values. In order words can you explain to me how you can monitor what the sensor would be recording in terms of distance? Is there a way to monitor this off the PC?


The LCD port is the way to go - if you have a serial LCD panel that can run at 4800 baud 8-n-1 then you're sorted. If not you can do as I do.

Basically connect the LCD port to a TTL to RS232 converter then plug the converter output into a COM port on your PC. Using hyperterm or something similar set the connection to 4800 baud 8-n-1. Then in your code you'll need to call LCDINIT. That open the LCD port for output. You can then use the PRINT commands to print values to hyperterm. If you do PRINT 13,10 you get a carriage return/linefeed. Check out the Format command in the Robobasic manual too for printing number values.

Pev
fungo wrote:This is very interesting! I have a question though. How does one debug the RN-1 software when it comes to such values. In order words can you explain to me how you can monitor what the sensor would be recording in terms of distance? Is there a way to monitor this off the PC?


The LCD port is the way to go - if you have a serial LCD panel that can run at 4800 baud 8-n-1 then you're sorted. If not you can do as I do.

Basically connect the LCD port to a TTL to RS232 converter then plug the converter output into a COM port on your PC. Using hyperterm or something similar set the connection to 4800 baud 8-n-1. Then in your code you'll need to call LCDINIT. That open the LCD port for output. You can then use the PRINT commands to print values to hyperterm. If you do PRINT 13,10 you get a carriage return/linefeed. Check out the Format command in the Robobasic manual too for printing number values.

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

How to debug or monitor sensor values

Post by dshinsel » Mon Apr 10, 2006 10:37 pm

Post by dshinsel
Mon Apr 10, 2006 10:37 pm

I use a bluetooth module (bluesmirf) connected to RX, TX, but you might be able to hook up serial directly (I have not tried it), or use a MAX232 chip to leve-shift.

The test code then looks like this (put in the begining of Main):

' Read Max Ultrasonic sensor
US_Range = AD(2)


' DEBUG - test sensor:
TxOut = " "
ETX 9600, TxOut

TxOut = "U"
ETX 9600, TxOut
TxOut = "S"
ETX 9600, TxOut
TxOut = "="
ETX 9600, TxOut

PrintByteVal = US_Range
GOSUB PrintByte


... Normal processing continues here...



===============================================
At the bottom of the file, I added this subroutine:

===============================================
' Print 8 bit byte
' PrintByteVal passed in as value to print

PrintByte:

' Print Low Byte
Temp = PrintByteVal >> 4
Temp = Temp AND &H0F
IF Temp > 9 THEN
Temp = Temp + 55
ELSE
Temp = Temp + 48
ENDIF
ETX 9600, Temp

Temp = PrintByteVal AND &H0F
IF Temp > 9 THEN
Temp = Temp + 55
ELSE
Temp = Temp + 48
ENDIF
ETX 9600, Temp

RETURN
I use a bluetooth module (bluesmirf) connected to RX, TX, but you might be able to hook up serial directly (I have not tried it), or use a MAX232 chip to leve-shift.

The test code then looks like this (put in the begining of Main):

' Read Max Ultrasonic sensor
US_Range = AD(2)


' DEBUG - test sensor:
TxOut = " "
ETX 9600, TxOut

TxOut = "U"
ETX 9600, TxOut
TxOut = "S"
ETX 9600, TxOut
TxOut = "="
ETX 9600, TxOut

PrintByteVal = US_Range
GOSUB PrintByte


... Normal processing continues here...



===============================================
At the bottom of the file, I added this subroutine:

===============================================
' Print 8 bit byte
' PrintByteVal passed in as value to print

PrintByte:

' Print Low Byte
Temp = PrintByteVal >> 4
Temp = Temp AND &H0F
IF Temp > 9 THEN
Temp = Temp + 55
ELSE
Temp = Temp + 48
ENDIF
ETX 9600, Temp

Temp = PrintByteVal AND &H0F
IF Temp > 9 THEN
Temp = Temp + 55
ELSE
Temp = Temp + 48
ENDIF
ETX 9600, Temp

RETURN
dshinsel


6 postsPage 1 of 1
6 postsPage 1 of 1