I am pretty new to arduino and c++ programming. I am using two HC-SR04 sensors (one in the front and one in the back) and I am using them to measure distance. The box they are in is mounted to a servo that uses two tilt switches to always keep it level with the ground or measuring surface. The sketch takes a measurement each way and then also adds the distance between them in the box enclosure and the only number that is printed on the LCD screen is the final distance in inches. It works great and is fairly accurate when measuring say between two walls or between two large objects. The servo and tilt switches makes sure it is always measuring straight for better accuracy. I have a delay between when the two sensors take a reading in hopes that they will not interfere with each others "ghost signals". The problem I have is that when I stick this inside a 5 gallon bucket and I am trying to measure the inside diameter and I know it is exactly 11" I will get all kinds of weird readings. How can I make it more accurate while measuring the inside diameter of a round object. Maybe narrow the beam? Put some kind or PVC pipe on the receiver side? Any ideas would be greatly appreciated.
Thanks a lot.