Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: icoms8 on February 28, 2009, 04:15:33 PM

Title: sonar and MCU help
Post by: icoms8 on February 28, 2009, 04:15:33 PM
ok i am buying a sonar from www.acroname.com (http://www.acroname.com) and i was wondering how to connect it to my MCU. I dont know if it comes with a cable or i have to buy one. And i have a MCU i am buying from http://www.thebotshop.com (http://www.thebotshop.com) and i dont know how to connect it to the computer. it is a ooPic R Microcontroller. can you tell me what kind of cable i will need?
 (p.s. the sonars a srfo4)
Title: Re: sonar and MCU help
Post by: SmAsH on February 28, 2009, 04:53:41 PM
this http://www.acroname.com/examples/10027/10027.html ? to connect it use the 5 holes up the top, dont know what the third one does tho???
Title: Re: sonar and MCU help
Post by: icoms8 on March 01, 2009, 05:06:52 PM
no this one http://www.acroname.com/robotics/parts/R93-SRF04.html (http://www.acroname.com/robotics/parts/R93-SRF04.html) and what i mean is there a cable i can buy
Title: Re: sonar and MCU help
Post by: Razor Concepts on March 01, 2009, 05:28:11 PM
Make your own using wire and male/female headers.
Title: Re: sonar and MCU help
Post by: Admin on March 03, 2009, 06:05:02 AM
The datasheet says exactly how to connect it, even with pics and code examples . . . ;D


edit: you *did* say which sonar you were using, but my brain wasn't working at the time . . .
Title: Re: sonar and MCU help
Post by: paulstreats on March 03, 2009, 06:30:14 AM
if its an devantech srf02,srf04 or srf08 sonar(what devantech sells), its likely that there will be an object library for the oopic already aswell as example code provided with the oopic software. From that end you are fine youve just got to decide how to connect it. it can be connected to the serial port or to an I2C port. I know definately that there is object support for the i2c connection so this is the one youre likely to want.

 The srf sonars have a 5 pin connection. Theyre not supplied with header pins so there is nothing to physically connect to, you'll have to get some male headers to solder into the holes. Only 4 of these pins are needed for I2C the mode pin should be left unconnected. Without knowing what oopic board you are getting its hard to know how you would connect to it but the sonar needs the 2 I2C pins(SCL & SDA) aswell as +5v and 0v(GND). Its likely that you are going to have to make a custom connector but it shouldnt be difficult.