Telegraph Machine and Printer

One project that had been on my to do list for a long time was to build a working printer using a single LEGO Mindstorms EV3 kit (31313). In addition to having basic printing capabilities, I also wanted an easy way to tell it what to print on the fly, without having to manually change the program. For that I added a touch sensor, essentially turning it into a telegraph machine, so that you can tap out a sequence of letters using Morse Code which it will then print.

I put together building instructions for it, which you can find along with the program file and more detailed information about how it works, down below.

The printer is designed as a plotter, using a gel pen mounted on a carriage to deposit ink on the paper. It can accommodate standard sheets of letter paper cut in half. I posted a video a couple of months ago explaining how the printer works in detail, which you can watch here.

I hope to explore different ways of sending information to the EV3 unit to print, but the first step was to program it to print text on demand. The advantage of using Morse Code is that it is an extremely simple and effective way of communicating textual information, that requires only a single touch sensor to implement. In this video you can see the telegraph machine in action.

Building Instructions

Here are the building instructions and program file for the printer/telegraph machine. If you build your own, be sure to read the detailed instructions below on how to configure it and get it working correctly.


Building Guide

PDF File

Digital Model Files

LDraw File

Wiring Instructions

Motor Ports

A – the large motor that moves the pen from side to side
B – the large motor driving the paper feed wheels
C – the medium motor in the back that lifts the pen assembly up and down

Sensor Ports

1 – the touch sensor used to encode the Morse code sequence
4 – the color sensor underneath the printer

Pen Calibration

Before doing any printing, you will want to calibrate the height of the pen by following these steps.

  • Insert the pen into the pen holder. The pen should be positioned so that when the pen holder assembly is at its lowest position (the default position in the instructions), the tip of the pen is approximately just below the level of the paper.
  • Manually slide the pen holder horizontally until the pen is roughly centered in the printer (if it isn’t already).
  • Manually set the pen holder assembly to its highest possible position. To easily do this, disengage the 24 tooth gear from the worm gear by sliding it to the side along its axle. Raise the pen assembly, then slide the 24 tooth gear back to re-engage the worm gear.
  • Run the Calibrate program on the EV3 unit. The pen will lower and start moving continuously from side to side above the page.
  • Press the down button on the EV3 to lower the pen a little. Repeat pressing the down button until the pen lowers enough to touch the paper and start depositing ink.
  • Press the center button on the EV3 to indicate that the pen is at the desired printing height. After its next full pass, the pen holder assembly will return to the raised position and the program will end.


The main printing program to run is called Printer. It will wait for the user to enter Morse Code sequences and print the corresponding letters that are encoded. If a sheet of paper is not already in the printer, it will first operate the paper feed motors to pull a sheet into the printer until it covers the color sensor.

Once the paper is fed into the printer, you can start tapping out Morse Code on the touch sensor. Make sure dots are really quick taps on the touch sensor, and dashes are held down for a little while. If you correctly tap out the Morse Code for a letter, it will display the letter on the EV3 display before printing it. If it doesn’t recognize a sequence, it will issue an error beep and the EV3 light will turn orange. Currently, it only understand the codes for the basic Latin alphabet, which you can find many places online (or you can reference the image of the code book I made below).

Don’t be discouraged if you have trouble getting it to recognize letters. It might take awhile to get used to the timing. Practice with simple letters like E, T, S and O before moving to letters with more complicated sequences.

I’ve programmed it so it isn’t a strict implementation of Morse Code timing, so that it is a bit more friendly for novices. As such, I have also added two additional codes to explicitly add a space and start a new line.

Space: . – . – (dot dash dot dash)
New Line: – – – – (dash dash dash dash)

You don’t have to wait for the printer to print a letter before tapping out the sequence for another letter. In fact, you can get well ahead of the printer if you are fast enough, just make sure you pause long enough between each letter. The program keeps a queue of all the letters that have been encoded and will eventually print them all.

Important! To stop the program, press the center button on the EV3. It will return the pen to the raised position and feed the printed sheet of paper out. If you just cancel the program like you would normally, you will have to reset the pen position manually and probably have to re-calibrate it.

Printing a Test Page

If you want to print a full test page like I did in the printer video, you can run the PrintTestPage program.

Program Overview

If you poke around the program you will notice it is fairly complex, and there are a lot of MyBlocks. Most of these are documented via comments within them, but you may be asking ‘Where do I start?’. The main programs are a good place to start, as you will see the high level MyBlocks that they use to operate the program.

Aside from the main programs, there are a few MyBlocks of particular interest. The ReadCode and TranslateCode MyBlocks are used to read the sequence of button presses from the touch sensor and translate the Morse Code into a letter index. The letter index is then added to the letter queue to be processed.

The ProcessQueue MyBlock will continuously wait for and process letters added to the letter queue by the encoding MyBlocks. As it processes each letter, it will call the corresponding letter MyBlock to print it.

Wireless Telegraph

If you happen to have 2 Mindstorms units, you can set one up with the touch sensor as the transmitter, and one connected to the printer as the receiver,. The transmitter can then send the text sequence to the receiver wirelessly using Bluetooth.

To do this, you will first need to configure the 2 EV3 units so they can communicate via Bluetooth. To do that follow these steps.

On the EV3 unit being used as the transmitter.

  • Go to the settings page, select Brick Name and name the brick TRANSMIT.
  • Go into the Bluetooth settings and make sure ‘Visibility’ and ‘Bluetooth’ are checked.

On the EV3 unit connected to the printer.

  • Go to the settings page, select Brick Name and name the brick RECEIVER.
  • Go into the Bluetooth settings, make sure ‘Visibility’ and ‘Bluetooth’ are checked.
  • Select ‘Connections’ and select ‘Search’. It should find the TRANSMIT brick. Select it.

On the EV3 brick configured as the transmitter, run the Transmitter Program. On the EV3 brick connected to the printer, run the Printer program.

Halloween Chocolate Thrower

For Halloween this year I thought it would be an interesting challenge to break out my LEGO Mindstorms EV3 set and build a robot for dispensing candy. These mini chocolate bars are pretty common where I live, so building a machine that would toss them at the kids seemed like a great idea!

It uses the EV3 Infrared sensor to detect when something is in front of the machine to trigger the delivery mechanism. The chocolates are stored in a gravity feed stack and are pushed out from the bottom using a simple piston arm. Once they are pushed out, they land on a platform that is rotated up to throw them.

I designed the feed system to be adjustable, so it can accommodate a range of these mini chocolate bars. Or pretty much anything that will fit and stack reasonably well.

The building instructions and program file for running it are here, and there are some construction notes below, along with the wiring info.


Building Guide

PDF File

Digital Model Files

LDraw File

Instructions for wiring the motors and sensor are as follows.

Infrared Sensor: Port 1
Motor under the throwing platform: Port A
Motor under the feeding tower: Port B

This robot performs best with items that are rectangular and stack well. Some mini chocolates which are rounded on the top might not stack so well, so you might get mixed results with them. All the chocolates I showed in the video work quite well.

I had an absolute blast building and playing with this model, and eating all the chocolate that’s been lying around! I hope you have fun with it too.

Chocolate Machine

Jason Strikes Back!

This week marks three years since I built my Ultimate Useless LEGO Machine! In all that time, I still haven’t figured out a way to turn it off. At last I will have my revenge! Or will I?

There is actually some cool programming going on here. The black box and the hand robot coordinate their behaviors using the Mindstorms Bluetooth capabilities. I have to say, I was super impressed with the ease and performance of this feature. Kudos to the EV3 team for such a fantastic implementation!

Despite what it might look like, the black box robot is actually driving the entire sequence. It sends messages to the hand robot to tell it what to do, then it either does an evasive maneuver, or waits for the hand to turn the switch off.

It responds to the switch being turned off the same way it always has, using the light sensor inside. It doesn’t use the proximity sensor to detect when the hand is there though. Since it is telling the hand what to do, it always knows what is going on. The hand would always trigger it anyway, since it is always above the sensor.

Instructions for building the the black box can be found in my original blog post. I haven’t put together instructions for the hand robot. Had a lot of fun making this video, hope you enjoy it!

LuuMa Hand

EV3 Egg Decorator

With Easter just around the corner I thought it would be a great time to dust off my EV3 and build an egg decorating robot. These machines, commonly referred to as Egg Bots, have been around for a while. In fact, an early version dates all the way back to 1990! Since then, many versions have been created, some scratch built and some others using LEGO Mindstorms. I really enjoy the challenge of designing my own models, so here is my version, the EV Egg Bot! Instructions, program file, and notes for building your own can be found below. Other than the eggs and marker, all the pieces you need to build this model come in the EV3 Home Edition kit 31313.


Building Guide

PDF File

Digital Model Files

LDraw File

The motors should be connected to the ports as follows:
Port A – the large motor that turns the egg
Port B – the medium motor that raises and lowers the marker
Port C – the large motor that moves the arm from side to side

Operating the EV Egg Bot is pretty straight forward. Once the program is running, you can use the left and right buttons on the EV3 unit to scroll through the available patterns and select the center button to ‘print’ it. Before decorating you’ll want to make sure the marker is about .5 cm/.25 in above the surface of the egg. I’m using standard Sharpie markers, but I think any felt tip marker that can draw on an egg will do.

The video should give you a pretty good idea of how it all works. Feel free to delve into the program file to design your own patterns!

EV Egg Bot

EV3 Cookie Icing Machine

After returning from my trip to Qatar for the Word Robot Olympiad, I was super psyched to build another LEGO Mindstorms machine. Kristal suggested that we build a cookie icing machine for the upcoming holiday season, and so, we present to you, the EV Icer!

EV Icer

I have put together building instructions for the EV Icer, along with the program file for running it, but be sure to read the operation notes below! The icing results can vary drastically depending on many factors. When everything goes according to plan it actually works quite well. All of the cookies in the picture at the end of the post were iced using the machine. To build the EV Icer you only need the LEGO Mindstorms retail set number 31313.


Building Guide

PDF File

Digital Model Files

LDraw File

The motors should be connected to the ports as follows:
Port A – the medium motor for the cookie turntable
Port B – the large motor for the squeeze roller
Port C – the large motor that pushes and pulls the turntable assembly

The most important factor to successfully icing a cookie is the consistency of the icing. If it is too runny you will get a blobby mess. If it is too thick you won’t get a complete design. It’s hard to describe the ideal consistency, but it’s probably about the same as you would want if you were icing the cookies by hand. You may have to experiment to find the right balance. Don’t expect it to work perfectly the first time you try it.

You will probably get icing everywhere, especially if it is too runny. Be sure to adjust the height of the ‘ice stopper’ so that it blocks the end of the icing tip when it’s not icing. For smooth operation of the squeeze roller it is best to fold the sides of the icing bag in on itself as you drape it over the squeeze plate, before securing it in the back.

We are using a Wilton brand decorating tip (#4 Round) with a Wilton brand Coupler, which fits snugly in the bracket I have designed (see picture below). I don’t know if other brands of icing tips/couplers are much different, but if they are you will need to improvise to keep the icing tip secure. We are just using a generic icing bag.

The height of the icing tip should be adjusted (by sliding the entire squeeze roller/plate assembly up or down) so that it is just above the top of the cookie.

The patterns are designed to work with cookies that are 9 LEGO studs in diameter. Any larger and the cookie will get caught up in the frame. If they are much smaller the icing will be placed off the edge of the cookie.

Feel free to delve into the program file to adjust some of the variables. Manually adjusting the power applied to the motors is one way to accommodate icing of different consistencies.