Electronic – arduino – What kind of sensor can determine relative altitude with 50cm resolution

arduinosensor

I would like to know if you have any idea of what kind of sensor I need to be able to tell the relative position of an Arduino board with regard to another one. I only need to know if an Arduino is above or below another one.

Said differently, I have two Arduino boards and I want to know when one board (placed on an object) is below/above the other board (placed on another object) by about 50cm to 1 meter.

Update:
@Andyaka and @OliGlaser : no … I only need it to work when the two boards are 50cm to 1 meter away (bellow/above) from each other.

Here is the application I want to develop: each of the arduinos will be on a goat. And the idea is to know exactly when my male goat is on my female goat for mating.

Best Answer

For a simple set-up: You can send an IR signal "up" from one board (masking out the lower hemisphere) and use an IR sensor "down" on the other board (masking out the upper hemisphere.) When you get a signal, receiver is above sender. Else, assume not.

For more complex set-ups consider adding a GPS receiver to each of the Arduinos. GPS will give you height-above-sea-level as one of the outputs. Radio/antenna options and GPS receiver chipset options will affect your precision.

If both Arduinos will be in the same room or at least on the same ground, then you can use two distance sensors that measure distance-to-ground, and use a wireless transmitter (such as Xbee, nRF24L01+, etc) to compare the values.