Building Lego Robots with PHP

Building Lego Robots with PHP

Hands up if you love LEGO. Just kidding, I can’t see your hands. I understand why you love it though. LEGO in general, and especially Technic, are wonderful outlets of creativity and marvels of engineering.

Everything fits together so neatly. Some of the sets also include optional motors and sensors; bringing them to life. The trouble is that they’re closed systems, not easily customised or controlled.

Until now.

Over the past few months, I have been experimenting with custom LEGO electronics. I have built a few different robots, and I’d like to show you how you can do the same.

We’ll begin by looking at a standard Technic set, and how it works out of the box. Then, I’ll show you how to customise its components to connect them to Arduino, and then to PHP, via Low Energy Bluetooth.

You’ll see how to program your robots, using asynchronous PHP code. Finally, I’ll show you how to make a simple React Native application, which you can use to interface with your robots, on Android and iOS.

I am a developer and writer, working at io.co.za. I usually work on application architecture, though sometimes I build compilers or robots.