I want to measure the distance between me and HC-SR04 (max 1m, min 20 cm) which is positioned in front of me at 1.10m height (at belly level).
Knowing that it's not the best sensor for it because clothes absorbs high frequencies, what is the best way to have a good measurement?
If I stay in front of it, let's say at 15 cm more or less, the sensor goes up and down continuously, from 15 cm to 72 cm, or from 15 to 132cm.
Thank you so much for your attention.
Try removing your clothing.
Another more valid idea ?
Wear clothing with in-built corner reflectors.
"Thin plastic with microscopic corner reflector structures can be used as tape, on signs, or sewn or molded onto clothing." (Microscopic reflectors won't work as intended with ultrasound, but the "hard" surface of the plastic would probably be a good reflector, anyway!)
Clothes with corner reflectors of appropriate size for ultrasound might look pretty cool, if you're into cosplay.
Or wear body armor.
Thanks DaveEvans for your kind reply, I will have to measure also other people distances form HC-SR04, your idea is great, but as long as I'm the only one.
Is there any "coding trick" I can use?
Thanks for your time.
My suggestions were made with tongue (mostly) in cheek.
I don't know of any coding "tricks" to help with this, other than the standard suggestion to use the NewPing library and its "median" method. Try varying the number of samples used to select the median.
Considering you only asked for "distance between HC-SR04 and the body", I'd consider #1 a very valid suggestion, maybe more valid than the body armour suggestion which by it's sheer thickness distorts your measurement. So does all clothing: you're measuring a point away from the body - not the body itself.
You didn't give the overall application and circumstances under which the measurement is to be done, or other requirements.
Try it out with various kinds of clothing. Some may work, others not. Some textile indeed absorbs ultrasound but not all - sheer spandex or bathing suits may be a very good option for you. I expect it to reflect ultrasound, and they're thin enough to be well within the error of the measurement.