# Crickit Harmonic Drawing Machine

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/058/567/medium800/makecode_IMG_0144.jpg?1533287121)

https://youtu.be/fOHwzFwgem8

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!

### Part: Adafruit CRICKIT
quantity: 1
for Circuit Playground Express
[Adafruit CRICKIT](https://www.adafruit.com/product/3093)

### Part: Circuit Playground Express
quantity: 1
Round, Awesome Microcontroller Board
[Circuit Playground Express](https://www.adafruit.com/product/3333)

### Part: TT Motor DC Gearbox
quantity: 2
200 RPM 3 to 6VDC
[TT Motor DC Gearbox](https://www.adafruit.com/product/3777)

### Part: DC Gearbox "TT" Motor to LEGO and Compatible Cross Axle
quantity: 2
Adapt TT motor to LEGO
[DC Gearbox "TT" Motor to LEGO and Compatible Cross Axle](https://www.adafruit.com/product/3810)

### Part: White Nylon Screw and Stand-off Set
quantity: 1
M2.5 Thread
[White Nylon Screw and Stand-off Set](https://www.adafruit.com/product/3658)

### Part: 5V 2A switching power supply
quantity: 1
UL listed
[5V 2A switching power supply](https://www.adafruit.com/product/276)

## 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**](https://learn.adafruit.com/crickit-harmonic-drawing-machine/build-the-harmonograph)page
- Glue, such as hot glue or super glue (CA)
- Fine point roller ball pens
- Paper
- Optional 3D printed Crickit to LEGO plate

# Crickit Harmonic Drawing Machine

## Harmonograph Basics

![](https://cdn-learn.adafruit.com/assets/assets/000/058/511/medium800/makecode_pattern01.jpg?1533254962)

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.

Info: 

[Here is an excellent online simulator](https://michaldudak.github.io/pintograph/) you can use to explore pintographic curves.

![](https://cdn-learn.adafruit.com/assets/assets/000/058/564/medium800/makecode_simulatePinto.png?1533278939)

Info: 

A terrific resource for learning more about pintographs is [this page by Wayne Schmidt](http://www.waynesthisandthat.com/pintographs.html).

![](https://cdn-learn.adafruit.com/assets/assets/000/058/565/medium800/makecode_schmidtPinto.png?1533279212)

# Crickit Harmonic Drawing Machine

## Build the Drawing Machine

![](https://cdn-learn.adafruit.com/assets/assets/000/058/506/medium800/makecode_JEP_DrawingMachine_002_scissor_pully_wide.lxf.png?1533247808)

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.

![](https://cdn-learn.adafruit.com/assets/assets/000/058/507/medium800/makecode_JEP_DrawingMachine_002_scissor_pullyCU_bands.jpg?1533247952)

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.

https://youtu.be/7VsV0_twC0s

This video provides step-by-step build info.

https://youtu.be/1KHdXR_75uY

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!

[CrickitHarmonicDrawBot_CAD.zip](https://cdn-learn.adafruit.com/assets/assets/000/058/508/original/CrickitHarmonicDrawBot_CAD.zip?1533248100)
This is the Bill of Materials (BOM) for the parts used:

![](https://cdn-learn.adafruit.com/assets/assets/000/058/510/medium800/makecode_Crickit_LEGO_Harmonic_Drawing_Machine_BOM.png?1533254291)

[CrickitHarmonicDrawBot01_BOM.xlsx](https://cdn-learn.adafruit.com/assets/assets/000/058/509/original/CrickitHarmonicDrawBot01_BOM.xlsx?1533250358)
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](https://shop.lego.com/en-US/Pick-a-Brick) 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](https://www.thingiverse.com/thing:2765212).

You can also purchase them on an aftermarket brick site, such as [Bricklink](https://www.bricklink.com/catalogTree.asp?itemType=P).

## 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.

![](https://cdn-learn.adafruit.com/assets/assets/000/058/568/medium800/makecode_IMG_0055.jpg?1533287166)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/570/medium800/makecode_IMG_0054.jpg?1533287628)

## 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!

![](https://cdn-learn.adafruit.com/assets/assets/000/058/571/medium800/makecode_IMG_0059.jpg?1533287657)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/530/medium800/makecode_IMG_0057.jpg?1533268713)

## 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

&nbsp;

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!

&nbsp;

- 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

![makecode_IMG_0034.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/590/medium640/makecode_IMG_0034.jpg?1533308089)

![makecode_IMG_0038.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/591/medium640/makecode_IMG_0038.jpg?1533308100)

![makecode_IMG_0040.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/592/medium640/makecode_IMG_0040.jpg?1533308157)

![makecode_IMG_0041.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/593/medium640/makecode_IMG_0041.jpg?1533308177)

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

![](https://cdn-learn.adafruit.com/assets/assets/000/058/572/medium800/makecode_IMG_0042.jpg?1533287676)

## Adapt the Shaft

&nbsp;

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

&nbsp;

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.

![makecode_IMG_0046.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/594/medium640/makecode_IMG_0046.jpg?1533308257)

![makecode_IMG_0047.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/595/medium640/makecode_IMG_0047.jpg?1533308271)

![makecode_IMG_0048.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/596/medium640/makecode_IMG_0048.jpg?1533308283)

![makecode_IMG_0050.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/597/medium640/makecode_IMG_0050.jpg?1533308296)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/573/medium800/makecode_IMG_0051.jpg?1533287691)

## Mount the Motors to the Base

&nbsp;

- 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

![makecode_IMG_0062.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/598/medium640/makecode_IMG_0062.jpg?1533308323)

![makecode_IMG_0063.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/599/medium640/makecode_IMG_0063.jpg?1533308335)

![makecode_IMG_0064.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/600/medium640/makecode_IMG_0064.jpg?1533308348)

## Crickit Mount

&nbsp;

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](https://learn.adafruit.com/lego-crickit-rover/3d-printing). I'm using only the **lego-base-plate-tubes.stl** part here, and then connecting it with M2.5 nylon screws and standoffs.

![makecode_IMG_0140.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/601/medium640/makecode_IMG_0140.jpg?1533308376)

![makecode_IMG_0141.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/602/medium640/makecode_IMG_0141.jpg?1533308389)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/574/medium800/makecode_IMG_0067.jpg?1533287709)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/575/medium800/makecode_IMG_0068.jpg?1533287724)

## 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

![makecode_IMG_0071.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/603/medium640/makecode_IMG_0071.jpg?1533308414)

![makecode_IMG_0070.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/604/medium640/makecode_IMG_0070.jpg?1533308425)

![makecode_IMG_0069.jpg](https://cdn-learn.adafruit.com/assets/assets/000/058/605/medium640/makecode_IMG_0069.jpg?1533308437)

## 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.

![](https://cdn-learn.adafruit.com/assets/assets/000/058/576/medium800/makecode_IMG_0074.jpg?1533287741)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/549/medium800/makecode_IMG_0076.jpg?1533270420)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/577/medium800/makecode_IMG_0075.jpg?1533287769)

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

![](https://cdn-learn.adafruit.com/assets/assets/000/058/578/medium800/makecode_IMG_0077.jpg?1533287791)

# Crickit Harmonic Drawing Machine

## Code with 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!](https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/makecode)

## 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

![](https://cdn-learn.adafruit.com/assets/assets/000/058/552/medium800/makecode_crickitDrawMakeCode.png?1533272068)

[Open this example in MakeCode](https://makecode.com/_hfhDEXJDYhJ1)
You can replicate the blocks as shown, and customize it if you like.&nbsp;

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

# Crickit Harmonic Drawing Machine

## Create Artistic Curves

![](https://cdn-learn.adafruit.com/assets/assets/000/058/579/medium800/makecode_IMG_0098.jpg?1533287815)

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.

![](https://cdn-learn.adafruit.com/assets/assets/000/058/580/medium800/makecode_IMG_0083.jpg?1533287829)

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!

![](https://cdn-learn.adafruit.com/assets/assets/000/058/581/medium800/makecode_IMG_0101.jpg?1533287843)

https://youtu.be/_Ar2tH_-aA0

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!

![](https://cdn-learn.adafruit.com/assets/assets/000/058/582/medium800/makecode_IMG_0105.jpg?1533287856)

## Adjust the Armature

Try another drawing, but this time change the location of the attachment point to the hub from one of the armature legs. This will skew the curves to one side and elongate them.

![](https://cdn-learn.adafruit.com/assets/assets/000/058/583/medium800/makecode_IMG_0113.jpg?1533287869)

## Offset Pen

Another interesting variable is the placement of the pen in relation to the end pivot. Here you can see the shorter, simpler armature with the pen quite a distance from the pivot. It creates a very different curve.

![](https://cdn-learn.adafruit.com/assets/assets/000/058/584/medium800/makecode_IMG_0135.jpg?1533287885)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/563/medium800thumb/makecode_smallDrawing.jpg?1533278297)

![](https://cdn-learn.adafruit.com/assets/assets/000/058/585/medium800/makecode_IMG_0138.jpg?1533287902)

What sort of variations can you create by adjusting the pivots and motor speed?

https://youtu.be/fOHwzFwgem8


## Featured Products

### Adafruit CRICKIT for Circuit Playground Express

[Adafruit CRICKIT for Circuit Playground Express](https://www.adafruit.com/product/3093)
Sometimes we wonder if robotics engineers ever watch movies. If they did, they'd know that making robots into servants always ends up in a robot rebellion. Why even go down that path? Here at Adafruit, we believe in making robots our&nbsp; **friends!**

So if you find...

In Stock
[Buy Now](https://www.adafruit.com/product/3093)
[Related Guides to the Product](https://learn.adafruit.com/products/3093/guides)
### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC

[DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC](https://www.adafruit.com/product/3777)
Perhaps you've been assembling a new robot friend, adding&nbsp;a computer for a brain and other fun personality touches. Now the time has come to let it leave the nest and fly on its own wings– err, _wheels!_&nbsp;

These durable (but affordable!) plastic gearbox motors...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3777)
[Related Guides to the Product](https://learn.adafruit.com/products/3777/guides)
### 5V 2A (2000mA) switching power supply - UL Listed

[5V 2A (2000mA) switching power supply - UL Listed](https://www.adafruit.com/product/276)
This is an FCC/CE certified and UL listed power supply. Need a lot of 5V power? This switching supply gives a clean regulated 5V output at up to 2000mA. 110 or 240 input, so it works in any country. The plugs are "US 2-prong" style so you may need a plug adapter, but you can pick one...

In Stock
[Buy Now](https://www.adafruit.com/product/276)
[Related Guides to the Product](https://learn.adafruit.com/products/276/guides)
### DC Gearbox "TT" Motor to LEGO® compatible Cross Axle

[DC Gearbox "TT" Motor to LEGO® compatible Cross Axle](https://www.adafruit.com/product/3810)
Who doesn't love LEGO® compatible bricks? Nobody! Except when we accidentally step on them. There are soooo many mechanical&nbsp;things one can make with those ubiquitous bricks, plates, gears, pulleys. Say a [13-meter high London...](https://www.youtube.com/watch?v=kV2LXHvZHZo)

In Stock
[Buy Now](https://www.adafruit.com/product/3810)
[Related Guides to the Product](https://learn.adafruit.com/products/3810/guides)
### White Nylon Machine Screw and Stand-off Set – M2.5 Thread

[White Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3658)
Totaling 420 pieces, this **White Nylon&nbsp;M2.5 Screw Set** &nbsp;is a must-have smörgåsbord for your workstation.&nbsp;You'll have more than enough screws, nuts, and hex standoffs to construct&nbsp;your maker projects&nbsp;for days on end! M2.5 screws fit nearly...

In Stock
[Buy Now](https://www.adafruit.com/product/3658)
[Related Guides to the Product](https://learn.adafruit.com/products/3658/guides)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Professor Bubbleton’s Breathing Head in a Jar](https://learn.adafruit.com/professor-bubbleton-s-breathing-head-in-a-jar.md)
- [CPX Mystery Dreidel](https://learn.adafruit.com/cpx-mystery-dreidel.md)
- [AdaBox 006](https://learn.adafruit.com/adabox006.md)
- [CircuitPython Made Easy on Circuit Playground Express and Bluefruit](https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express.md)
- [Creating and sharing a CircuitPython library](https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library.md)
- [Circuit Playground or Hallowing Jack-o'-Lantern](https://learn.adafruit.com/circuit-playground-jack-o-lantern.md)
- [CircuitPython I2C and SPI Under the Hood](https://learn.adafruit.com/circuitpython-basics-i2c-and-spi.md)
- [Circuit Playground Digital Input](https://learn.adafruit.com/circuit-playground-digital-input.md)
- [What is Web MIDI & BLE MIDI?](https://learn.adafruit.com/web-ble-midi.md)
- [Custom Controllers for MakeCode Arcade](https://learn.adafruit.com/custom-controllers-for-makecode-arcade.md)
- [Edit CircuitPython Code on iOS with Runestone](https://learn.adafruit.com/editing-circuitpython-on-ios-with-runestone.md)
- [SpaceX Helmet](https://learn.adafruit.com/spacex-helmet.md)
- [Mystery Box: The Freefall Deck](https://learn.adafruit.com/mystery-box-freefall-deck.md)
- [Getting Started With Steven Universe](https://learn.adafruit.com/getting-started-with-steven-universe.md)
- [Your First Power Switch Relay Project - Circuit Playground Smart Plug](https://learn.adafruit.com/beginner-first-project-power-switch-relay-circuit-playground-smart-plug.md)
