You can build a machine that draws wonderful geometric curve patterns using Crickit, Circuit Playground Express, TT motors, and LEGO. This type of harmonograph drives the pen armature from two motorized hubs running at different speeds, generating and mapping complex harmonic motion!

for Circuit Playground Express
1 x Circuit Playground Express
Round, Awesome Microcontroller Board
2 x TT Motor DC Gearbox
200 RPM 3 to 6VDC

Materials

In addition to the parts listed above, you'll also need the following:

• LEGO bricks and Technic pieces, as listed in the Bill of Materials on the Build the Drawing Machine page
• Glue, such as hot glue or super glue (CA)
• Fine point roller ball pens
• Paper
• Optional 3D printed Crickit to LEGO plate

A harmonograph is a type of drawing machine that creates geometric illustrations. There are a few kinds of harmonographs, we'll be making a type called a pintograph, that employs a pair of motorized rotating hubs to drive an armature with a pen attached to it.

The relative motion of the hubs, which move at slightly different speeds, typically, generates harmonic relationships that drive the curve continually off of the original path, yet bounded by four extreme points. This is in contrast to a roulette drawing machine, such as a Hoot Nanny or Spirograph, which is bounded by a circle and generates petal-like lobes.

If you're interested in learning more about roulette-style drawing machines, check out the incredible Cycloid Drawing Machine by Joe Freedman, and the excellent simulator of it created by Jim Baumgartner https://wheelof.com/sketch/

Here is an excellent online simulator you can use to explore pintographic curves.

This type of curve is called a Lissajous curve, which describe complex harmonic motion as a system of equations.

The key features we need to create our drawing machine are a pair of variable speed motor drives and an armature to move the pen across the paper. The two drives rotate at different speeds, pushing the armature (and the connected pen) along a repeating, yet slightly changing path.

There are nearly limitless ways to do this with LEGO blocks and Technics parts. You can adapt this to work with parts you have on hand, or follow these instructions to build one that uses very few parts, most of them easily obtainable in a moderate sized Technics set and a few pick-a-bricks.

This gear reduction section is the key to slowing down the fast motion of the TT motor and increasing the torque. Without this, the machine would draw way to fast, get out of control, and probably tear itself to pieces! You can use actual gears to accomplish this, but pulley wheels and belts are easier to connect, more forgiving of slop, and dampen the motion a bit.

Watch this video for a CG timelapse build of the parts.

This video provides step-by-step build info.

If you'd like to take a close look at the model, download the files below and open them in Lego Digital Designer or any LDraw compliant program!

This is the Bill of Materials (BOM) for the parts used:

Most of these parts can be found in any larger Technic-based kit. If you have any trouble finding certain parts, you have a few choices. First, search for them on the LEGO Pick-a-Brick site or at a LEGO store.

If you have access to a 3D printer, you can 3d print them -- just search for the part on a 3D model hosting site such as Thingiverse. Here's a very nice looking collection of the key components.

You can also purchase them on an aftermarket brick site, such as Bricklink.

Base Build

Following the video build instructions above, build the base of the machine. The two stacks hold the axles for the drive and the gear reduction pulleys, which will be connected to the TT motor later.

Armature

Again, following the build instruction video, make the scissor armature as shown. You can then set it onto the two drives with the short axles. You can use pegs, but this makes it harder to lift the arm on and off, which you'll do every time you want to cap your pen!

TT Motor Mount and Shaft Adapter

In order to introduce our Crickit controlled TT motors into the world of LEGO, we'll need to do two things:

1. Mount the TT motor chassis to a 2x2 flat tile
2. Adapt the motor shaft to LEGO cross axle

TT to LEGO Tile Mount

Some LEGO purists will dislike this next step, and for that we are sorry. But one of the best ways to bridge the worlds of electronics and LEGO is to sacrifice some tiles and glue them to your non-LEGO parts!

• Place the 2x2 LEGO tile onto a 2x3 brick -- this will allow overhang for the motor axle
• Clean all surfaces well that will be glued together
• Put a bit of super glue (CA) onto the tile
• Place the TT motor onto the tile as shown -- note that only one side of the motor can press flat
• Squeeze together or clamp the pieces until dry

Now, this motor can attach to the baseplate of the drawing machine -- or any other LEGO for that matter!

This couldn't be easier -- simply press fit the LEGO cross axle adapter onto the shaft!

Now, it's ready to connect to any cross axle compatible part, such as gears, wheels, pulleys, and half bushings, such as the one shown here that we'll use to drive the machine.

Mount the Motors to the Base

• Mount the TT motor and its connected tile to brick as shown
• Wrap a Technic belt or hobby band (remember those? Used for the bracelet making fad a few years ago!) around the half bushing on the TT axle on one side and the reduction pulley on the other
• Repeat for the second motor on the other side of the base

Crickit Mount

This step is optional, but very stylish! You can 3D print (or have 3D printed by a company) a Crickit-to-LEGO plate using the instructions in this tutorial. I'm using only the lego-base-plate-tubes.stl part here, and then connecting it with M2.5 nylon screws and standoffs.

Motor Connections

Next, you'll connect the two motors to the Crickit's Motor 1 and Motor 2 ports.

• Plug the motor cables into the Crickit's motor ports
• You can always adjust direction of motors in software, so the red/black or black/red order here doesn't matter, just make sure to connect one motor's wires to Motor 1 and the other to Motor 2, ignoring the GND port in the middle

Pen Holder

The pen needs to be connected securely to the armature. You can place it in the holder and then wrap rubber bands or Technic belts around it to hold it tightly in place.

Now, plug in the 5V 2A power plug to the Crickit and get ready to program the Circuit Playground Express in MakeCode!

Crickit Install for MakeCode

You can code your Crickit and Circuit Playground Express using MakeCode! Head on over to the Crickit with MakeCode guide to get set up!

Code Functions

The primary goal is to run the two motors at different speeds, with the ability to adjust one motor's speed and direction while the other remains constant.

Here are some of the ways we can achieve that goal:

• Set initial speed of both motors to 70%
• Graph the motor 1 speed with the CPX NeoPixel ring
• Indicate the motor 1 direction with the Crickit's on-board NeoPixel
• Decrease or increase motor 1 speed by clicking either the A or B button
• Reverse direction of both motors by clicking both buttons at the same time
• Pause both motors by flipping the on-board CPX switch to the left
• Resume both motors by flipping the switch to the right

You can replicate the blocks as shown, and customize it if you like.

When you're ready, plug in your Circuit Playground Express and upload the code to the board. Next, we'll make some drawings!

Place a stack of paper underneath the pen, remove the cap, and turn on the Crickit! You can adjust the height of the pen relative to the armature by pushing it up or down inside of the holder.

Once the Crickit Harmonic Drawing Machine starts up, press the B button on the Circuit Playground Express two or three times to increase the speed of Motor 1. Then, watch your drawing develop!

You can stop at any time by moving the Circuit Playground Express slide switch to the left. Some beautiful images may emerge quickly. Or, let it run until you have a very dense image!