United Kingdom
Asked — Edited

Localised Sound

i was wondering if anyone had any knowledge of adding localised sound. Basically, i want my robot to know from what direction sound has come from


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

United Kingdom
#1  

There is already a control which can do that for 2 channels.

Sound movement will listen on 2 microphones and move or run a script depending on the direction of sound. Also, Sound Script - although I just checked the tutorial page for it and it is apparently not working.

United Kingdom
#3  

ah rite thanks guys. Would 2 mics, or sounds sensors be better? Just read that post and now i'm going to look in the builder. Ideally though, i'd like to figure out how to do it in C#. Although, from the general principles already stated in the other thread it should be fairly easy.

PRO
Synthiam
#4  

You can use two of these: http://www.ebay.com/itm/audio-sound-detector-module-with-sensitivity-adjustment-For-Arduino-circuits-/180991440945?pt=LH_DefaultDomain_0&hash=item2a23ee3831

And connect them to two ADC ports.

write a very short script that reads the ADC port and turns toward the highest value.

United Kingdom
#5  

Net been down just got back.

@DJ That was just what I was looking at. Excellent thank you again.

Do you think, if I use 4 ( 2 at the sides, one at the front and one at the back ) it would give a good all round detection?

#6  

@Jaychadw

Was wondering if you where able to get the sound detectors to work for you. If so, would you mind sharing the script? It might not work exactly for me but I should be able to adapt it for what I want.

Thanks ... Herr Ball

United Kingdom
#7  

If the sensors work the script would be very simple;


# Script to move towards sound
:loop

# Get the values for left and right
$leftchannel = GetADC(ADC0)
$rightchannel = GetADC(ADC1)

# Check the values and move towards sound
IF($leftchannel > $rightchannel)
  Left(200,500)
  Forward()
ELSEIF($rightchannel > $leftchannel)
  Right(200,500)
  Forward()
EndIf

# Wait 1 second
Sleep(1000)

# Loop back
Goto(loop)

Obviously change the code in the if nest if you want it to do something other than turn towards the sound for half a second and then move forwards.

#8  

@ Rich

As always Rich thanks for your help. Will give it a try later tonight and see whats what. Going to try and attempt to have my robot turn its head right or left towards the sound.

I have taken a basic logic programming class and now believe I can make it go with what you gave me. If not you'll hear from me again ... LOL

I have been looking at scripts now and very surprised how many are just basic code using the EZ-Script Functions. I'm I right here or not?

Herr Ball

United Kingdom
#9  

Yep you are right. DJ has done a great job with EZ-Script and it's simplicity.

The hardest part of any script I've written is the typing :)

#10  

Yeah I have to say, as far as programming goes, it's pretty simple as well as powerful. It almost seems like a custom version of Visual Basic or C#. The Aruino and Processing languages aren't too bad but, EZ is aptly named.