Beacon tracking with LEGO Mindstorms EV3 IR Sensor 9

Beacon tracking is a very exciting robotics area that can be used on things like Robocup, a football tournament played by robots. This robot demo how it can be done.
This weekend I have been playing with my new LEGO Education EV3 Core Set. So it was a fantastic time to revisit the IR Sensor and use one of its functionalities: tracking.

ev3-mindstorms-ir-follower

This little robot will follow the IR Beacon when you move it… my kids took a few seconds to realize that I was joking them with the beacon. :)

Ads by Google

The Robot is quite simple to build, so you shouldn’t have any problems getting it. It is just a stand for the ev3 brick and the M-motor attached to it.

The program is amazingly simple. If you recall the Line Following tutorial I wrote last week, I just applied the same idea for this robot.

The IR Sensor gives you a heading value that ranges from -25 to 25 to tell you where the beacon is, from top left to top right. So I just use this reading and use a P-Controller to make sure the error is 0. But what is the error? It is the heading, when the IR beacon is exactly in front of the robot it will report 0.

So this is the EV3 code.

ir-beacon-tracking

You can download the source code here.

Perhaps I built a player for the Robocup :). Time to built a spherical IR beacon for cheap…

9 thoughts on “Beacon tracking with LEGO Mindstorms EV3 IR Sensor

  1. Pingback: Building a short-range Radar with LEGO Mindstorms - LEGO Reviews & Videos

  2. Pingback: Poor Man's IR Ball: The Ultimate HOWTO ← LEGO Reviews & Videos

  3. Pingback: HOWTO Build your own 3-Wheels Holonomic Robot using LEGO ← LEGO Reviews & Videos

  4. Reply Joe Nov 16,2014 4:28 pm

    Is it possible to use another IR emitter as the beacon?

    • Reply Miguel Nov 16,2014 9:12 pm

      Not sure… there are some plans to build one yourself but the price isn’t interesting at all… and I am really clumsy with wires and all that :D

      The point is that the IR Beacon emits pulses of IR light so you would need to emit that kind of pulses… not just on/off

      • Reply Joe Nov 17,2014 12:33 pm

        Hmm. A lot of phones emit IR now, like my Galaxy S5. I don’t know how to program it but I’m sure it wouldn’t be that difficult to get the IR to pulse. Thanks for the reply!!

  5. Reply Glenn Jan 3,2015 4:41 pm

    How to get the remote to work?

  6. Reply Prof. Simon Williams, PhD Jan 5,2015 12:32 am

    How do I make EV3RSTORM “follow” the beacon?

  7. Reply Park Hee Sang. Feb 8,2015 3:23 am

    Hello. I’m Korean but, I can speak English a little.
    I want to open source code file. Where is EV3 program download?
    I want to make Beacon tracking program.
    so, could you give me advice about that?
    Thank you for reply.

Leave a Reply to Glenn Cancel reply