2
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ Do you have line of sight between them? Is there anything common to both than can be used as a reference (e.g. stick with markings, notches, etc) How accurate exactly do you need? \$\endgroup\$
    – Oli Glaser
    Commented Sep 2, 2013 at 3:08
  • \$\begingroup\$ Would you expect the sensor to work if one board is 3m above or below the other one i.e. do you have a limit situation where any idea should not be expected to have to work? \$\endgroup\$
    – Andy aka
    Commented Sep 2, 2013 at 7:03

2 Answers 2

1
\$\begingroup\$

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.

\$\endgroup\$
7
  • \$\begingroup\$ Would a GPS provide vertical resolution of 0.5 to 1 meter? If so, which ones? \$\endgroup\$ Commented Sep 2, 2013 at 7:18
  • 1
    \$\begingroup\$ GPS would be awful for that, its altitude resolution is not great due to the way the system works, and despite marketing claims to the contrary you really can't get <1m resolution out of anything you can practically buy. For such short distances you'd be better off with ultrasonic (as used in ultrasonic tape-measures and parking sensors). \$\endgroup\$
    – John U
    Commented Sep 2, 2013 at 10:41
  • \$\begingroup\$ BTW I would upvote the "use an IR sensor" idea, but downvote the GPS idea - cancels each other out... \$\endgroup\$
    – John U
    Commented Sep 2, 2013 at 10:42
  • 2
    \$\begingroup\$ @PhilFrost A significant component of the GPS significant error in the vertical axis is due to triangulation precision. In the horizontal directions the spread between satellites provides much more positional diversity than in the vertical. \$\endgroup\$ Commented Sep 2, 2013 at 13:56
  • 1
    \$\begingroup\$ What Anindo said - I knew the theory, didn't know the big words. Nurse, fetch the coffeeee! \$\endgroup\$
    – John U
    Commented Sep 2, 2013 at 15:11
1
\$\begingroup\$

The current generation of MEMS barometers (LPS331AP, MS5611) are supposedly good down to centimeters or tens of centimeters of resolution. You will need to calibrate the absolute accuracy though, and if my (brief) experience with the last generation of barometers is any indication, do some smart filtering.

You don't mention how quickly the Arduinos need to figure out their altitudes but if you have time to do a lot of averaging, you can probably make it work, assuming you're not working in vacuum or in a wind tunnel.

On update: the IR emitter/sensor idea is a lot simpler and is better suited to your application. The major issue would be IR from sunlight, which will saturate your sensor if no precautions are taken.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.