PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Ultrasonic Sensor (SRF08) to Rp6



arnob
23.02.2018, 14:49
Hi, Can anybody tell me how to connect SRF08 to Robby Rp6 Base System? I have connect it to I2C and tried I2C Master Base Example 3. But it shows only errors.

Thanks

Dirk
23.02.2018, 18:49
Hi arnob, the SRF08 should work with RP6 Base.
If not, check:
* hardware connection (SCL, SDA, 5V, GND) ok?
* using the correct I2C adress?

If no success after checking the above points:
- post a photo showing the hardware connection
- post your program

i_make_it
24.02.2018, 08:53
Hello and welcome,

the expansion connectors XBUS1 and XBUS2 contains, both a I2C bus (SDA, SCL).

I2C Tutorials and Specs: http://www.robot-electronics.co.uk/i2c-tutorial
http://www.ti.com/lit/an/slva704/slva704.pdf
http://www.i2c-bus.org/fileadmin/ftp/i2c_bus_specification_1995.pdf
#

arnob
28.02.2018, 01:31
3331533316


I have just tried ....\Rp6 Examples\RP6Examples_20120725f\RP6BASE_EXAMPLES\RP 6Base_I2CMaster_03\RP6Base_Move_05.hex

Dirk
28.02.2018, 03:14
Hi arnob,

the hardware connection seems to be ok.

The original example "RP6Base_Move_05" doesn't contain any code for the SRF08.

Try the original example "RP6Base_I2CMaster_03" first.
In this example change the line:
#define SRF_ADR 0xE6
...to...
#define SRF_ADR 0xE0

Then compile the example again and test it with the SRF08.
Post your result here.
Good luck!

arnob
28.02.2018, 04:09
Hi Dirk,
It was mistake, it should be: RP6Examples_20120725f \ RP6BASE_EXAMPLES \ RP 6Base_I2CMaster_03 \ RP6Base_I2CMaster_03.hex
Actually, I have tried this....Sorry...

I am trying this now-
#define SRF_ADR 0xE6
... to ...
#define SRF_ADR 0xE0

Thanks

- - - Aktualisiert - - -

Terminal shows the same thing. so, problem remains.
Morning, I will try to use pull up resistors.
Hope, it will work.

i_make_it
28.02.2018, 07:43
Address information for the SRF08 you can find in the document:
http://coecsl.ece.illinois.edu/ge423/DevantechSRF08UltraSonicRanger.pdf

On Page 3 you will find:
The default shipped address of the SRF08 is 0xE0. It can be changed by the user to any of 16 addresses E0, E2, E4, E6, E8, EA, EC, EE, F0, F2, F4, F6, F8, FA, FC or FE, therefore up to 16 sonar's can be used. In addition to the above addresses, all sonar's on the I2C bus will respond to address 0 - the General Broadcast address. This means that writing a ranging command to I2C address 0 (0x00) will start all sonar's ranging at the same time.

If your SRF08 is brand new it will respond on address 0xE0.
If it is a used one, you don't know, if the former owner has changed the address.
Then you can start Ranging with Address 0x00 and poll all 16 posible addresses for a value.
So you can find out the address.

Dirk
28.02.2018, 16:24
Hi arnob,

You don't need additional pullup resistors on the RP6.

arnob
28.02.2018, 16:47
It worked with #define SRF_ADR 0xE2
No pull up resistors. now terminal shows distance of objects.

Thnaks a lot.