LEGO NXT Beach Buggy Controlled via Web Browser    Send article as PDF   
This LEGO Mindstorms NXT Beach Buggy is controlled via an Internet Browser Interface using a LEGO Mindstorms NXT [NXT2WiFi]. This is my first project using one of Daniele Benedettelli’s [NXT2WiFi]. Any Internet Browser capable device can control it. The NXT2WIFI is a miniature Webserver Module featuring a fully integrated 802.11 b/g/n Wi-Fi interface, giving your LEGO® MINDSTORMS® creations access to any Wi-Fi network.

Beach Buggy -7.png

The main code for interpreting the commands relayed from the [NXT2WiFi] is held in the WebEvents.nxc file. Each Button area of the Remote Control HTML file has a ‘ctrlID Number’ which corresponds to a behaviour control listed in the WebEvents.nxc file:
  • Move Forward: ctrlID = 1
  • Move Backwards: ctrlID = 7
  • Turn Left: ctrlID = 5
  • Turn Right: ctrlID = 3
  • Stop: ctrlID = 4

To change the ctrlID Numbers, you will need to edit the buttonEvents.js file found in the Webserver ‘Scripts Folder’. You can also add extra ctrlID Numbers if required for your project.

NXC Source Code: WebEvents.nxc


When using Daniele Benedettelli’s NXC library, for the [NXT2WiFi], the only file you need to edit for most projects is the WebEvents.nxc file. For most requirements, the other files can be left unchanged.

NXT2Wifi  Remote Control
Download the NXT2WiFi Remote Control HTML File

When using Daniele Benedettelli’s Default Webserver source code, for the [NXT2WiFi], the only files you need to edit for most projects are the index.htm and buttonEvents.js files. For most requirements, the other files can be left unchanged. You will need to rebuild the webserver compressed image. The custom webserver compressed image I have used for this project, BeachBuggy.bin, is uploaded to the [NXT2WiFi] using Daniele Benedettelli’s NXT2WiFi Webtool.

HTML Source Code: index.htm



NXT Beach Buggy






The BeachBuggy.bin, image is great for use with Mobile Devices such as Mobile Phones due to it’s very small footprint.

Beach Buggy -2.png

Of the [NXT2WiFi] Wi-Fi connection profiles, I just use the the default one which is adhoc. Using this is very convenient as you have no need to set-up the security for each device you wish to access the the [NXT2WiFi] with. To access the [NXT2WiFi], just type ‘http://nxt2wifi/‘ into your browsers’ address bar. Alternatively you can use

Beach Buggy -4.png

If you are having issues getting the [NXT2WiFi] to start, I suggest you use a Terminal Program such as Termite, to reset and start the [NXT2WiFi]. This is done by entering te following into the Terminals Command Line: $RST, $DBG1, followed by $WFC0. If all goes well, you should see the following screen:

Starting Server withTerminal Program

I have also put together a [LDD] CAD file of my Beach Buggy. You will need a number of parts not available in the LEGO Mindstorms NXT Kits to build the Robot. Extra parts can be purchased from [bricklink].

Download the Instructions in LDD CAD File or as an Adode PDF Document

Beach Buggy -5.png

The [NXT2WiFi] is far more powerful than the example I have shown here. Not only can the [NXT2WiFi] control a Robot, but it is capable of relaying Sensor Data as well. With this capabilities you can log your Data, and even automatically post the Data to Twitter and post real time graphs on @thingspeak!

Beach Buggy -8.png

The [NXT2WiFi] is not an add-on for the absolute beginner to the LEGO Mindstorms NXT system. You will need a grasp of Webpage HTML and Java Script Programming, plus your preferred NXT Programming Language of your choice. But, with some perseverance and by going through the provided examples, you should soon have a Remote Controlled Robot up and running in a few hours. Reading Sensors and Posting Data will take you some more patience and learning.

Previous Post

LEGO Mindstorms NXT Forklift - Mark II (Follows Line)

My Original Forklift was part of my NXTLog FoodFactor Competition Entry, which needed a method to transport models of the large open top pallet type bins used to transport vegetables, ... Read more

Next Post

LEGO NXT Thermometer using CatCan SmartSensor Lite

I decided to put my CatCan SmartSensor Lite's Temperature measuring capabilities to use by constructing a simple LEGO Mindstorms NXT Mechanical Linear Display Thermometer. The Thermometer is graduated in 1 ... Read more

Short URL:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Do NOT follow this link or you will be banned from the site!