bn. Analog position encoder (for LEGO remote controlled truck)

- a tubular LEGO brick with a cross shaped hole

- 10 k Ohm precision potentiometer. Such a potentiometer usually has an inbuilt cog transmission that enables the control rod to do a number of rotations between minimum and maximum positions. It also reduces the force needed to turn the potentiometer control rod.

1. You need the following electronic components:

The analog encoder is easy to build and it turns out that no modifications of the original LEGO technics bricks are needed to fix the encoder in place:

An encoder enables tracking of actual position of actuators. LEGO remote controlled truck uses an analog encoder to track front wheels direction angle. This enables much easier steering for a human operator, since the wheels can be turned exactly by a desired angle instead of controlling their directional rotation speed. The robot microcontroller can also stop the steering M-motor as the steering mechanism turns fully left or right. This reduces the wear of the robot mechanical steering clutch.

Click on the photo to enlarge it.

Be careful not to overheat it to prevent the inserted LEGO brick from or the potentiometer control rod bending. However, the shrieked rubber tube must make a tight connection between the LEGO brick and the potentiometer control rod to measure the rotation angle precisely.

3. Use a soldering iron to heat the rubber tube to shrink it:

The rubber tube should cover the whole tubular LEGO brick on top of the potentiometer control rod.

2. Cut the shrinking rubber tube to the length:

- a piece of shrinking rubber tube that is used to fix the tubular LEGO brick to the potentiometer control rod

4. Build the encoder mounts from LEGO technic bricks.

Click on the photo to enlarge it.

ROBOT remote contontroller v5.6 (ROBOT remote contontroller v5.6.zip) application with source code and a new PIC32MX270F256B firmware v.2.9.3 (PIC32MX270F256B_firmware_v2.9.3 for ROBOTIC LEGO TRUCK v2.3.zip) for LEGO remote truck v2.3 are available from Downloads section.

6. Upgrade your robot software

PIC32MX270F256B microcontroller offer a number of analog inputs. PIC32MX270F256B firmware v2.9.1 or newer supports RA0 and RA1 as analog inputs. You must connect the potentiometer pins 1 and 3 between GND (ground) and the microcontroller power supply (3.3 V) and pin 2 (output) to RA1. RA0 is already used for the robot power supply voltage measurement (see the robot circuit schematic).

5. Make electrical connections to the robot controller.

Now, you are ready to use your imagination to build the rest of the potentiometer mounts that fit to your construction. See the photos on the right hand side...

A triangular LEGO brick with a circular arch is just wide enough for a standard potentiometer. Unscrew the nut on the potentiometer and also remove the washer. Then screw or gently push the potentiometer throat through the LEGO brick and place the washer and fix it firmly with the nut. The potentiometer body should not turn even if the control rod reaches minimum or maximum rotation position.

Click on the photo to enlarge it.

Click on the photo to enlarge it.