bm. LEGO remote controlled truck v1.0, v2.1, v2.2, v2.3 and v2.4 (RC LEGO TRUCK)

v1.0: Click on the photo to enlarge it.

A remote controlled robot is always fun to play with. LEGO bricks enable you not only to build electronics, but also to make mechanics. A microcontroller based controller circuit is the best option to make the robot work.

You may start with a relatively expensive LEGO NXT controller and LEGO Power Functions, however a PIC32 microcontroller offers a simple, more responsive and more versatile solution. It gives you an option to use Microchip Harmony programming library functions and C and C++ programming languages that enable more complex robotic projects with true artificial intelligence (AI) functionality and a wide range of sensors, not limited to what LEGO offers.

ROBOT remote controller v5.2, v5.4 and v5.6 applications (with source code in VB.NET) are available from Downloads section: It includes logarithmic response to joystick control leavers movements and therefore much precise control over the robotic truck speed and direction. .NET4.5 and VS2015 are needed to run and compile the application. ROBOT remote controller v5.6 application supports directional steering.

v2.3: Click on the photo to enlarge it.

Microchip PIC32MX270F256B microcontrollers and HoperRF RFM69CW or RFM69HW transceivers cost just about 5 € each. 10 amps' motor divers should cost no more than 5 € as well, if you build them yourself. Four AP4525GEH-HF-3TR (ADVANCED POWER ELECTRONICS CORP AP4525GEH-HF-3TR MOSFET Transistor, N and P Channel, 15 A, 40 V, 0.028 ohm, 10 V, 1 V) motor driver chips cost each about 1/2 € at Farnell, but you also need some other components. Optionally, you may buy fully assembled motor controllers at AX Electronica's web shop. Remote controlled LEGO robot electronics was borrowed from M111 remote controlled robot. The electronic circuit and PIC32MX270F256B firmware are described in detail here.

The basic electronic components needed for the project are: 2 microcontrollers, 2 transceivers and 2 LEGO M-motors with drivers. You need a microcontroller and a transceiver to build a PC controlled remote and a microcontroller, transceiver and 2 LEGO M-motors with drivers to build the remote controlled robot electronics.

ASSEMBLY INSTRUCTIONS:

ROBOT remote controller v5.8 and v6.0 applications are intended for the lucky owners of Microchip 3D TouchPad. v5.8 application enables 2D robot control. The user has to touch the board to precisely control the front wheels and the speed of the robot. v6.0 application enables touchless control that seem almost surrealistic.

PIC32MX270F256B firmware v2.9.3 for LEGO remote controlled truck v2.3 is also available from Downloads section.

v1.0: Click on the photo to enlarge it.

Click on the photo to enlarge it.

The 9 Volt LEGO Power Functions M-motors have an inbuilt cog transmission, so they provide a lot of torque even when run at about 5 V. But, if you need more speed, simply add 1 or two 1.5 V batteries. I used a 4 AA 1.2 V accumulator batteries (which provide about 4.8 V), but 5 or 6 AA batteries would give you higher voltage and a higher top speed. However, even with four AA type 1.2 V accumulator batteries give you enough speed on a flat surface.

NOTE: If you use a battery with up to 10 V, you have to build a voltage divider to measure robot battery voltage as shown on the schematic above. RA0 pin can only receive a third of the battery voltage. The upper resistor must therefore have a value of 20 k ohms and the lower resistor has to have 10 k ohms to achieve 3:1 voltage division ratio. RA0 pin input voltage should never exceed 3.3 V to prevent damage to the microcontroller!

LEGO robot controller circuit schematic v2.3. The remote controller schematic is here.. Click on the schematics to enlarge it.

Click on the photo to enlarge it.

There is one more important thing to know about LEGO M-motors. Thought they have 4-wire cable; they only use the middle two wires to connect to a power supply. They also have no inbuilt electronics except for a small filtering capacitor that protects other electronics from electric disturbances. The only thing we need to connect the M-motors to an arbitrary electronics motor driver is a LEGO Power Functions standard electric connector. We need two such connectors to connect 2 LEGO M-motors motor drivers. So, we split an extension cable (8871) in two and we get two interfaces that we need. One may also replace the original LEGO cables or even cut of the original LEGO Power functions connectors from the M-motors, but we preferred not to modify the motors, so they can still be used with other LEGO Power Functions components. The homemade m-motor controller can also be used with other LEGO M-motors this way. The only exception is Servo Motor (88004) that needs all 4 wires to control. It also comes with an inbuilt motor driver and may be directly connected to a microcontroller and a power supply. Read more on how LEGO Power Functions work here.

I have recently added another battery pack with two 1.2 V AA type accumulators and a power switch. I have simply connected the new battery pack in series with the existing 4-battery pack and the voltage increased by 2.4 V. These gave the robotic truck much more power and speed. Read more here.

Click on the photo to enlarge it.

The building instructions for LEGO Technic Mining Truck (42035) are available here. You need to build the undercarriage, so that you have the drive shaft and steering operational. Now, you have to use some imagination to add the motors, the PIC32 microcontroller circuit board with RFM69CW or RFM69HW transceiver motors, motor drivers and the battery pack. See the photos on the right side to see, how I built my robot. It is not too complicated, but you may still need some experience in building LEGO models. However, one should keep in mind that LEGO Technic requires the use of quite different building techniques that ordinary LEGO bricks. You may also find it difficult to connect LEGO Technic bricks to ordinary LEGO bricks, but there a number of interface bricks that you will get to know as you build the original LEGO Technic Mining Truck (42035). There are also a few components that I used from other LEGO sets (mostly from LEGO Creator Adventure Vehicles set (31037)), but they only make the robot look nicer. You may also buy them separately at LEGO shop.

So, let us focus on building mechanics. LEGO Technic Mining Truck (42035) is probably one of the best LEGO sets to start with, even if you are a beginner in LEGO Technic. However you, will need a few additional LEGO bricks from other LEGO sets (mostly from LEGO Creator Adventure Vehicles set (31037)) to complete the project, two LEGO M-motors (8883) and a LEGO extension cable (8871). The motors would cost about 7 € (on November 2015) each when bought separately from the LEGO shop. However, you may not order from LEGO shop in all countries. This is unfortunately also true for Slovenia. I bought 2 M-motors at http://www.mojekocke.si for 13 € each on (November 2015). And I am not not going to comment on my dissatisfaction, If you have a friend in a country that LEGO shop ships to, it is probably much cheaper to have him or her order LEGO sets for you...

Click on the photo to enlarge it.

Now, we need to connect the second M-motor to the steering mechanism. I removed the vertical shaft with a cog that was used for manual steering. Then I fixed the second M-motor with 3 bricks to the battery cassone and attached a wheel to the steering M-motor drive shaft from LEGO Creator Adventure Vehicles set (31037) with the rubber removed. I attached the other wheel with the rubber removed directly to the steering shaft that steer the front wheels. I used two small rubbers to make the connect the wheel on the M-motor to the wheel in the steering shaft. Though the steering M-motor can also be directly connected to the steering shaft, ti is a bad idea, because the steering M-motor may not stop as the robot front wheels turn fully right or left... At least two reliable switches to stop the steering M-motor should be added to cut the M-motor power supply as the front wheels are turned fully left or right.

WATCH VIDEO WATCH VIDEO 2

WHERE TO BUY PARTS:

Please, keep in mind that the undercarriage also has to be lengthened to provide enough space for the second M-motor that would be used for steering. There are enough parts in LEGO Technic Mining Truck (42035) to do this, since they were previously used to build the truck's cassone. The drive shaft has to be lengthened as well. A longer axle is also available from the previous upper structure. Note that there is no differential, so only one wheel would be driven. A small cog in the opposite wheel is not used to drive the robot. It is only mounted on the robot as a spare in order not to get "lost" among other LEGO bricks...

Let's finish building the robot! First, you have to remove the mock-up internal combustion engine block and you have to modify the mounts to attach a drive M-motor. I preserved the two cogs and the chain to connect the M-motor to the drive shaft. However, the chain had to be lengthened by 1 link that was luckily provided as a spare with LEGO Technic Mining Truck (42035).

Click on the photo to enlarge it.

Click on the photo to enlarge it.

See the photo gallery...

Click on the photo to enlarge it.

Click on the photo to enlarge it.

Click on the photo to enlarge it.

Click on the photo to enlarge it.