Sensors

16 replies [Last post]
MillburnHigh
Title: NooBot
Joined: 04/08/2013
Posts:
BotPoints: 8
User offline. Last seen 5 years 14 weeks ago.

Hi all, we are missing a sonar sensor, and we were wondering if anybody else was missing one as well. We also received a green sensor that was not listed in the parts manifest.

Thanks

YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 4 years 23 weeks ago.

The green sensor might be the sonar sensor and the sonar sensor is not included in the 2013 kit... I think.

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 3 years 23 weeks ago.

The SONAR sensor looks like a speaker (a black cylinder with slits at the top) put on top of a small motherboard (its green). Under it, I think it has like a blue LEGO piece stuck to it for easy of attaching it to your robot.
What SONAR stands for is SOund Navigation And Ranging. How it works is by sending ultrasonic sound out and then measuring how long it takes to get back. If you have ever used the LEGO Mindstorms ultrasonic sensor, then it works almost just like that (also it works kind of like a bat's echo-location).
When the SONAR has multiple objects (or one really big object), it will return the closet object (or part of an object) as its reading. This means that if you are to use the SONAR sensor, you must make sure that nothing is interfering or close to it. Remember that the range of the echo gets bigger as it gets further away from the SONAR sensor. Sometimes the SONAR sensor will not be able to find certain objects, such as Botguy since he is a soft plush toy, meaning that he will probably absorb more sound than he will reflect back.

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 3 years 23 weeks ago.

While I was researching the SONAR sensor, I found an example code from a PDF file that was created by the University of Missouri. It looks very interesting and looks like it would work, however this code might not work anymore. Once I try it, though, I will post my results. So, here it is:

  1. /*This program demonstrates how to use the SONAR for sensing distances.
  2. You need to plug the SONAR sensor into port 0.
  3. This program beeps if anything changes from when the program starts, i.e. if someone walks by.
  4. Remember - when the SONAR is plugged in, or the CBC is turned on, the SONAR needs about 17 inches of free space in front of it for 350 ms while it calibrates.*/
  5. int main(){
  6. int i=0; //comparator variable
  7. set_each_analog_state(1,0,0,0,0,0,0,0); //set port 0 to floating
  8. sleep(0.02); //wait for state to change
  9. i=analog(0); //take initial SONAR reading
  10. while(1){ //loop forever
  11. if(analog(0)>(i+15)){ //if object moves away beep(); }
  12. if(analog(0)<(i-15)){ //if object moves closer beep(); }
  13. }
  14. }

YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 4 years 23 weeks ago.

Ok, the program does not look faulty, but, it could benefit from pointers. But, thats not the real point, is it. SONAR is useful for detecting objects that are spread out. Sound works in a manner called diffusion, while light is a beam that does not diffuse. The angle of reflectance is equal to that of the angle of incidence. While sound, bounces back in almost direct waves. The frequency of the waves determine the pitch of the sound. And, as sound travels, the waves spread out more and more and according to the first law of thermodynamics, export cannot increase if input doesn't, so the sound would lessen more and more as it spreads out. For the detection of botguy, yes, it would be a bit less accurate, but, the difference would not be too noticeable because of the ultrasonic sound waves. So, because you are allowed zero sonar sensors, I'll talk about the usefulness of of multiple sensors. If you attach a medium that is proportional to the plushness of botguy to a sonar sensor, but, have it so that ultrasonic is able to break through the medium, then, have a regular sonar sensor that reads it. Then, use the mathematical average equation to solve for the average of the two readings. But, like I said before, the low frequency of botguy should not affect ultrasonic sound.

Jesus Arzapalo
Title: NooBot
Joined: 10/23/2013
Posts:
BotPoints: 82
User offline. Last seen 2 years 2 weeks ago.

I think it is included in the kit but it is sometimes useless when trying to find any type of cloth material like bot guy the red cube or the orange ball.

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 3 years 23 weeks ago.

@JArzapalo: After looking around my classroom a little bit for the SONAR sensor, I couldn't seem to find it nor did I seem to locate it on the updated parts list either. However, I did find a "SONAR" sensor that instead of having one cylinder, it had two same-sized cylinders attached to it, however it had 4 pins.
So, for anyone who might know, why does it have 4 pins? And is the "SONAR" sensor that I found the actual or new SONAR sensor? Also, can someone else look at the parts list and tell me if you see it on there?

Thanks!

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 3 years 9 weeks ago.

@Harrison: The sonar sensor with two cylinders is the SRF-04 sensor; it was used with the Handy Board and XBC, but does not work out of the box with the CBC and Link. The CBC/Link-compatible sonar (with one cylinder) is the Maxbotix EZ-1, if I recall correctly.

The SRF-04 is quite a bit more precise (you can get millimeter precision) than the EZ-1 (centimeter precision), but has a shorter range (3 meters) than the EZ-1 (something like 6 meters, I think).

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 3 years 23 weeks ago.

@Jeremy Rand: But do you know whether the SONAR sensor that works for the Link is still in the Botball Kit because I still can't seem to find a one cylinder. I have literally checked everywhere!
I even checked in my classroom's locker that is full of random parts and still couldn't seem to find it. :)

Thank you!

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 3 years 9 weeks ago.

I think the EZ-1 was not included in the kit after roughly 2010. I'm not 100% certain though.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

rockyone
Title: NooBot
Joined: 02/17/2014
Posts:
BotPoints: 6
User offline. Last seen 4 years 21 weeks ago.

hi
i finally got the top hat sensor to sense the black line , but i cant make it walk on its path :(

pls help