Distance Meter for the MakerPort Using 3D Printed LEGO Designed Parts

by ddthornburg in Design > 3D Design

44 Views, 0 Favorites, 0 Comments

Distance Meter for the MakerPort Using 3D Printed LEGO Designed Parts

IMG_4132.JPG

The ability to make a device to measure distance electronically can be a fun way to develop skills using programmable design tools like the MakerPort. This device (https://makerport.fun/) is a versatile electronic platform for creating an immense variety of projects, ranging from robotics to virtually anything that utilizes the power of a computer device, such as the Arduino.

Unlike the Arduino, MakerPort makes it easy to connect sensors, motors, lights, and other items through the use of special connectors. This project continues the ease-of-use theme by using special LEGO-compatible bricks to hold the various sensors and displays used in your projects.

Supplies

IMG_4134 2.jpg
IMG_4137.JPG
IMG_4139.JPG
IMG_4145.JPG

In addition to the MakerPort, you will need

  1. Distance sensor like the HC-SR04 ultrasonic sensor
  2. Two line LCD display using the I2C interface like the FREENOVE I2C IIC LCD 1602 Module, New Type TWI Serial 16x2 Display
  3. 0.5 inch wide double-sided foam tape, 1/8" minimum thickness
  4. These items can be bought from Amazon and other online retailers.
  5. Four 4-40 x 3/4" machine screws and nuts.
  6. Screwdriver
  7. Install the free Microblocks program on your computer (https://microblocks.fun/)

Print the LEGO-Compatible Shapes

Four parts are needed. The baseplate and holders for the MakerPort, the distance sensor, and the two-line LCD panel. Use supports during printing for everything but the baseplate. Tree-shaped supports are easiest to remove. I used PLA filament with excellent results. Note that the printer needs a large (200 mm+) base to accommodate the baseplate.

Assembling the Distance Sensor

IMG_4138.JPG
IMG_4143.JPG

Use a small tab of double-sided tape on the front of the sensor to hold it to the frame when inserted. Next push the sensor into the frame so the tape holds it in place. Finally connect the sensor to the Extra port on the MakerPort using a four-lead cable shipped with the sensor. Note that the wire order is not the same for the MakerPort and the sensor. Be sure to the wires match the labels listed by each pin of the sensor and MakerPort.

Assembling the LCD Display

IMG_4135 2.jpg
IMG_4136.jpg

Use the four machine screws to attach the LCD display to its frame and tighten the nuts on the screws by hand to hold the display in place. Next, attach the four-lead cable from the display to the 5V I2C LCD connector on the MakerPort, ensuring each wire is connected to its same pin at both ends of the cable.

Putting It All Together

IMG_4146.JPG
IMG_4148.JPG

First, connect the MakerPort to your computer and follow the MakerPoirt instruction book on downloading software from the MakerPort's SD memory card. The program you want is called Distance Sensor Example.upb Once this is opened in Microblocks and your MakerPort is connected to your computer through the USB cable, the program should load automatically. Now you can disconnect the MakerPort from the computer. Because the distance sensor requires 5V to work, be sure the 3/5V jumper on the side of the MakePort case is set to 5V position, or the sensor won't work.

Using the 12x24 Lego baseplate, assemble the sensor, LCD, and MakerPort along with the 9v battery connector from the MakerPort kit.

Finally, connect the 9V battery to the connector and in a few seconds the display will light up and show the distance between the front of the distance sensor and an object like your hand or a wall. If you have problems, be sure the cables are connected properly, and double check that the right program is in the MakerPort.