User avatar
Cacodemon
Posts: 19
Joined: Mon Jul 09, 2018 4:32 pm

Ultrasound sensor alternatives?

Thu Feb 21, 2019 4:09 pm

Working on a small simple robot project at the moment, currently thinking of a simple way to make it avoid obstacles, perhaps in the future also follow a certain path or moving target. After some research I found that ultrasound sensors were commonly used and easy to learn way to make your robot to avoid obstacles, but as a pet owner I've been concerned whether it would just irritate them? And which would be my best alterneatives which still serve the purpose?

User avatar
joan
Posts: 14010
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultrasound sensor alternatives?

Thu Feb 21, 2019 4:24 pm

You can buy light sensors similar to a sonar ranger. They have a transmitter/receiver and get an analogue reading of the reflected light. You would need an ADC to use the returned value.

E.g. http://www.hobbytronics.co.uk/sensors/s ... nce-sensor

A simple alternative is microswitches used as bump detectors.


User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: Ultrasound sensor alternatives?

Fri Feb 22, 2019 10:17 am

I tend to use these little time of flight sensors that are used on drone for obstacle avoidance https://www.aliexpress.com/item/GY-530- ... st=ae803_5

MarkR
Posts: 154
Joined: Fri Jan 25, 2013 1:55 pm

Re: Ultrasound sensor alternatives?

Fri Feb 22, 2019 10:50 am

Those VL53 time-of-flight sensors are super good. They really are impressive, they give very accurate ranging with a narrow beam width in my tests. I heard they don't work too well outside during the day, but I've not tried that yet.

It's an I2C interface and the address can be changed through I2C, so if you have >1 of them in your system, then you need to wire up the enable pin to another GPIO (then you can program the enabled one, to have a different address, then re-enable the other)

ElEscalador
Posts: 667
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Ultrasound sensor alternatives?

Fri Feb 22, 2019 1:38 pm

VL5xxx all the way, buuut - I ordered a couple and was disappointed that the manufacturer wanted me to install 25+pages worth of api instead of providing a normal register map like every I2C device in the world. Went with a 360 degree lidar instead and haven't gotten around to messing with it, but I still have uses for it. Since we're on the subject - does anyone have a normal register map/instructions yet so I can use mine as easily as my accelerometer?
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

MarkR
Posts: 154
Joined: Fri Jan 25, 2013 1:55 pm

Re: Ultrasound sensor alternatives?

Fri Feb 22, 2019 11:12 pm

No, there is no obvious register map. The example software is open source, but it is intended for some uncommon microcontrollers. There is at least one port to Raspberry Pi (and also Arduino, and other microcontrollers) - these ports were all made by effectively reverse-engineering or adapting the device maker's sample code.

I managed to get ranging basically working (I think, from memory) by adapting other peoples' code, maybe an Arduino sketch (which I ported to the Pi by implementing the Arduino i2c functions)

Idahowalker
Posts: 445
Joined: Wed Jan 03, 2018 5:43 pm

Re: Ultrasound sensor alternatives?

Sat Feb 23, 2019 9:06 am

I use a TFMini to scan an area, for another purpose, to obtain a rather good image of an area. I make 12 scans per degree and scan +/- 5 degrees off 90, the scan is done in both directions, takes .072 seconds per scan, I disregard any measurement over 600cm, and I am able to discern, on screen, a 2 inch pipe at 400cm. With all that, the RPi B with its OS overhead is unable to process and create an image to be displayed on screen as well as process any other functions; such as running the servos, displaying the data on screen reading a MPU 9250, doing the Mahony Quaternion Update task, calculating Euler angles, creating torque values for a X/Y stable platform, reading environmental data, posting the data for remote access, and other functions, to give meaningful timely data. I run the device using a freeRTOS, in a round robin tasking on an ESP32, no timer involved.

By round robin, I mean, the event to position the servo completes, the LIDAR task is triggered, after the LIDAR task has stored the data the task to position the servo is triggered. The servo gets to each end of the scan range, the event to display and other processing is triggered, as the servo position and scan tasks are triggered. Upon the completion of each task the next task is triggered. The timing is done through the execution of the code. I tried the project with a RPi and the system overhead...
Without knowing why you are deleting my postings, I will not know how...

User avatar
Cacodemon
Posts: 19
Joined: Mon Jul 09, 2018 4:32 pm

Re: Ultrasound sensor alternatives?

Wed Feb 27, 2019 2:55 pm

Thanks for the responses. :) Time-of-flight sensors seem like a good choice! The next question is which manufacturer would make them simple and straightforward enough to use? Saw that they work with Python which is another plus - are there much reliable guides or resources for controlling Time-of-flight sensors with Python?

I can relate to your disappointment ElEscalador: recall buying a TFT screen for my other Pi and the manufacturer's user manual didn't provide working installation guide for the screen! Made it work eventually but was frustrating to try and figure it all out. It came from rather well-known manufacturer too, so I'm a bit careful about choosing the right one now.

Light sensors don't sound a bad alternative either, at least they are also being sold in my country which makes it less of a hassle - not sure how much pros and cons do they have compared to Time-of-flight sensors though. Do you joan or anyone else have much experience of using one? Can you tell me more?

User avatar
B.Goode
Posts: 7868
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Ultrasound sensor alternatives?

Wed Feb 27, 2019 5:00 pm

are there much reliable guides or resources for controlling Time-of-flight sensors with Python?

Does that mean you have tried the code supplied by Pimoroni and found it unreliable? Or does it just mean you haven't tried it... ?

User avatar
Cacodemon
Posts: 19
Joined: Mon Jul 09, 2018 4:32 pm

Re: Ultrasound sensor alternatives?

Thu Feb 28, 2019 3:41 pm

B.Goode wrote:
Wed Feb 27, 2019 5:00 pm
Does that mean you have tried the code supplied by Pimoroni and found it unreliable? Or does it just mean you haven't tried it... ?
I haven't tried it yet.

The reason I was asking is due to the disappointment with TFT screen thing (and lack of resources with other things in few other cases) which is why I generally wondered that the same could happen with any other part you buy for your Pi. Hence I want to know more about which others have found reliable and working, so there is more to guide my decision than what online shops and guides say and how user reviews on their sites rate it. Could say, I like keeping learning simple and spending my money wisely. ;D

User avatar
omegaman477
Posts: 145
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: Ultrasound sensor alternatives?

Fri Mar 01, 2019 11:13 pm

Cacodemon wrote:
Thu Feb 21, 2019 4:09 pm
Working on a small simple robot project at the moment, currently thinking of a simple way to make it avoid obstacles, perhaps in the future also follow a certain path or moving target. After some research I found that ultrasound sensors were commonly used and easy to learn way to make your robot to avoid obstacles, but as a pet owner I've been concerned whether it would just irritate them? And which would be my best alterneatives which still serve the purpose?
Looking at domestic vacuum robots etc, the trend seems to be towards LIDR, or machine vision.
..the only thing worse than a stupid question is a question not asked.

Return to “Automation, sensing and robotics”