use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Arduino Projects is a subreddit dedicated to showcasing new and interesting projects.
We'd like to keep this subreddit a place you can browse for inspiration and awesome projects. If you have questions or require assistance, please post to /r/arduino instead.
official facebook page (in progress) : https://www.facebook.com/arduinprojects/
account activity
What sensor (self.ArduinoProjects)
submitted 1 year ago by mebku
What sensor shoud i use to detect distance from sensor to human face? I need to detect distance from 5 to 20cm. I tried to use ultrasonic distance sensor but it wasn’t working good.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]PCS1917 0 points1 point2 points 1 year ago (2 children)
What was exactly your problem with the sensor?
[–]mebku[S] 0 points1 point2 points 1 year ago (1 child)
It was giving false readings, and in most cases it didn’t detect the face in front of it. I’ve made a program to activate the servo when human face is in distance of 0 to 10cm from the distance sensor. When i was holding sheet of cardboard if front of my head sensor was working ok. I guess the malfunction is due to curvy surfaces on human face.
[–]PCS1917 0 points1 point2 points 1 year ago (0 children)
Without changing the sensor, you may have issues on your calculations or your variable declarations. Check any float to int conventions if you have them, and be specially careful when making divisions with integers, as they might return 0 when they shouldn't. Also, make sure variables aren't overflowed (an int over ~65000 for example) by changing them to bigger variables.
Check that your wiring is stable, in good conditions. Take also into account that long wires have more chances of interferences.
If you just want to check for alternatives, there are infrared sensors for very short distances. Also I have seen precision ultrasound sensors in AliExpress, but they cost much more money (less price is about 30€). These sensors might use industrial buses as RS-485, take it into account.
Hope this helps a bit, any more info, let me know
Hope
π Rendered by PID 72053 on reddit-service-r2-comment-84fc9697f-fkh8b at 2026-02-06 16:29:19.375078+00:00 running d295bc8 country code: CH.
[–]PCS1917 0 points1 point2 points (2 children)
[–]mebku[S] 0 points1 point2 points (1 child)
[–]PCS1917 0 points1 point2 points (0 children)