Pico typewriter, scroll wheel and a bell

So, I’m planning on turning the Lego Typewriter into a USB keyboard driven by a pico. I’s not going to be a particularly good typewriter, but it’s a fun project :laughing:

I’ve worked out how to get the keys to work. carriage return is actually moving the carriage (a switch when the carriage is pushed back), but the 2 parts I haven’t got sorted are:

  1. a bell when you hit the end of the line
  2. up & down arrow with the turning of the paper scroller wheel

For the first: what’s the easiest way to get the pico to make a “ping” sound? My current thought is a solenoid and a cheap bike bell, but I’d prefer something simpler. Is there a way for the pico to play a sound through a speaker?

They other part, all I want to do is register the direction and speed of the turn, not the angle. Is a rotary encoder going to be the easiest way? Is there a good guide on how they work? Or would something like this be the best bet? 8421 Encoder-Vertical | DFRobot DFR0721 | Core Electronics Australia


Hi Doug,

Sounds like a sick project!

Definitely a few ways to do this:

An encoder is definitely the way to go - the Core guide outlines the working principal and implementation on an Arduino, for the Pico in micropython I’ve had success with this guide: Rotary Encoder - MicroPython for Kids

Personally I like these encoder modules since they are so low-frills with all of the passives to drive them onboard: Encoder Module with button | Core Electronics Australia

(Shoutout to Bob for teaching everyone about encoders over many posts!)


The PWM audio looks like it might be the go, also I have all the parts I need to give it a try :slight_smile:

Thanks, that coder dojo link explains it really well with this picture, thanks
Directional Encoders


Hi Doug
8421 Encoder-Vertical | DFRobot DFR0721 | Core Electronics Australia
This is an “absolute position” encoder. I am not sure exactly how they work or what the output is. It may not suit your purpose.
Cheers Bob