IR Sensor

Can the IR sensor detect an object that tell its size like
" its size is blah blah Height, Its Length is blah blah blah,"

Or can you suggest some sensors that can detect the size…
(if there is)

Not Objects, edges…

You really can’t find “objects”, instead you can find “edges”. Let’s put some kinda sensor on a servo so we can sweep it back and forth. We will read our sensor every few degrees. Lets say the readings are:

  • 100
  • 100
  • 100
  • 100
  • 100
  • 10
  • 10
  • 10
  • 10
  • 10
  • 100
  • 100
  • 100

Now, you can see in the numbers, we went (suddenly) from far away to a very close reading (there was a large difference between sequential readings) --This is our “edge”. Later, you can see the opposite happens, we go close-close-close then far away. This is the other edge. We can assume an “object” is between these two “edges”. 

From there, I am with Max, you will be getting into some Trig. To get good numbers relating to size, you will have to calculate servo angle v.s distance and then a lot of smart-person-math that I don’t know about.

This post might help:

https://www.robotshop.com/letsmakerobots/node/316