Is there any way to only enable one Sonar/Ultrasonic sensor at a time?

We need to use multiple Ultrasonic Sensors at different heights and want to minimize the interference between each of the sensors on a Cortex Vex controller.

Ideally, we would like a way to enable one sensor, wait for the reading, then disable the pings from that sensor, then enable a 2nd sensor.

Is there any way to do this?

Thanks.

Paul Tan.Coach of Polar Bear RoboticsVRC Team 2027

Mon Oct 18, 2010 10:23 pm

DiMastero

Expert

Joined: Wed Jun 30, 2010 7:15 amPosts: 181

Re: Multiple Ultrasonics with RobotC

Ok, I'm not really sure about this, but I think the US sensors only give out/ receive signals when they're told to, and won't interfere with other ones when activated at different times. As they take one reading per 70 mSecs, it might be best to let them function with about 75 mSecs in between them, I suppose. To do that, I think you could just make one variable per sensor, make a (while) loop to let it repeat until that variable is filled (which is once), and make the variable become the reading from the US sensor at the end of the loop. Example:

Ok, I'm not really sure about this, but I think the US sensors only give out/ receive signals when they're told to, and won't interfere with other ones when activated at different times....DiMastero

Thanks for the thoughts, DiMastero, but can someone confirm or deny the above? I was told (I think the posts are still on this forum for NXT/FTC) that at least for RobotC on the NXT this was not possible, and that the Ultrasonics would be on continuously.

Can someone confirm that this is not the case for Vex/Cortex, and that we could use several Ultrasonics as DiMastero has suggested we could?

Thanks.

Tue Oct 19, 2010 4:34 am

jbflot

Site Admin

Joined: Tue May 15, 2007 9:02 amPosts: 406

Re: Multiple Ultrasonics with RobotC

Multiple ultrasonic sensors (unless aimed directly at one another) should not interfere with each other. However, they do operate using sound waves which are subject to interference and can bounce off in various directions.

There is a way to turn on and off sensors in ROBOTC. Below is a program that turns on sensor 1 for 5 seconds, then turns on sensor 2 for 5 seconds, over and over. Note that I have ultrasonic sensor 1 plugged into digital ports 1 and 2, and ultrasonic sensor 2 plugged into digital ports 3 and 4.

Is that only two (2) ultrasonics sensors active at at time? I.e. can I have two ultrasonic sensors on ports 1/2, 3/4, and then have two more at 5/6, 7/8, and activate the first set, deactivate it, and then activate the second set?

Do I have to wait any settling times between activations/deactivations?

Thanks.

Paul Tan.

Tue Oct 19, 2010 8:26 pm

ivanseidel

Rookie

Joined: Tue Sep 07, 2010 10:56 amPosts: 43

Re: Multiple Ultrasonics with RobotC

Hi, to test if they are on while in not in use, use your ear, and place it to the emitter, it's a very low noise, if in silence you can hear it, i already tried, but i wasn't doing that task...put it to check constantly and see if you can hear the sound, test it with no data being received in the program, and have a conclusion Ivan

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum