Velleman Ultrasonic Sensors

Have any of you used Velleman ultrasonic sensors wired directly to your RIO before? Do you think this would work as an analog sensor with the RIO? We’re thinking of using one of these (or a MaxBotix 1040) for detecting and tracking our fuel cells loaded inside our bot, but I don’t like the 6-inch minimum distance on the MaxBotix. This Velleman ultrasonic sensor can resolve distances from 2cm-450cm. Also, how do you think it should be wired? Thanks in advance.

I’ve never actually used that sensor before, so i can’t speak from experience. However, I can provide some thoughts, and walk you through my thought process.

Whenever I’m evaluating a sensor that’s not directly supported or already widely-used in FRC-land, I usually ask the question “Where else is it used?”.

For me, I tend to go look for whether the sensor is commonly paired with an Arduino. If you can find Arduino code for the sensor, it’s a good “stick in the mud” to see what it would take on the roboRIO.

For example, someone has implemented this code and asked a few questions about it. I’m drawn to these lines in particular:

  // Sets the trigPin on HIGH state for 10 micro seconds
  digitalWrite(trigPin, HIGH);
  digitalWrite(trigPin, LOW);
  // Reads the echoPin, returns the sound wave travel time in microseconds
  duration = pulseIn(echoPin, HIGH);

Using this sensor requires microsecond-resolution coordination between two digital pins.

The ultrasonic() class is what you’d probably want to be looking into to do this, though again I’ve never used it, so I can’t speak much from experience.

Personally: I’d rather spend a bit more money on a proven solution with onboard processing, and not worry about sensor troubleshooting. A time of flight sensor or 1D lidar may be better suited to the application.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.