# Pico typewriter, scroll wheel and a bell

**URL:** <https://forum.core-electronics.com.au/t/pico-typewriter-scroll-wheel-and-a-bell/16282>\
**Category:** Finding Parts\
**Created:** [2 February 2023 05:00 UTC](https://forum.core-electronics.com.au/t/pico-typewriter-scroll-wheel-and-a-bell/16282 "2023-02-02T05:00:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doug27394](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/doug27394/32/7961_2.png) [@Doug27394](https://forum.core-electronics.com.au/u/Doug27394)\
**Post date:** [2 February 2023 05:00 UTC](https://forum.core-electronics.com.au/t/pico-typewriter-scroll-wheel-and-a-bell/16282/1 "2023-02-02T05:00:59Z")

</div>

So, I’m planning on turning the [Lego Typewriter](https://www.lego.com/en-au/product/typewriter-21327) into a USB keyboard driven by a pico. I’s not going to be a particularly _good_ typewriter, but it’s a fun project 😆

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](https://core-electronics.com.au/8421-encoder-vertical.html)

---

<div class="post-metadata">

**Author:** ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)\
**Post date:** [2 February 2023 05:47 UTC](https://forum.core-electronics.com.au/t/pico-typewriter-scroll-wheel-and-a-bell/16282/2 "2023-02-02T05:47:40Z")

</div>

Hi Doug,

Sounds like a sick project!

> [@Doug27394](#):
>
> 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?

Definitely a few ways to do this:

- Use an off the shelf MP3 player module: [DFPlayer - A Mini MP3 Player | DFRobot DFR0299 | Core Electronics Australia](https://core-electronics.com.au/dfplayer-a-mini-mp3-player.html)
- I stumped across this interesting Repo the other day, using PWM audio gets a ‘good enough’ sound out - I didnt test the raw output listed in the guide but used an amp to drive a higher power speaker: [GitHub - danjperron/PicoAudioPWM: PWM audio on pico with 8KHz stereo wave file](https://github.com/danjperron/PicoAudioPWM) ([speaker](https://core-electronics.com.au/makerverse-enclosed-speaker-8-ohm-5-watt.html))

> [@Doug27394](#):
>
> 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](https://core-electronics.com.au/8421-encoder-vertical.html)

An encoder is definitely the way to go - [the Core guide](https://core-electronics.com.au/guides/digital-electronics/how-to-use-rotary-encoders/) 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](https://www.coderdojotc.org/micropython/sensors/10-rotary-encoder/)

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](https://core-electronics.com.au/encoder-module-with-button.html)

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

---

<div class="post-metadata">

**Author:** ![Doug27394](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/doug27394/32/7961_2.png) [@Doug27394](https://forum.core-electronics.com.au/u/Doug27394)\
**Post date:** [2 February 2023 07:39 UTC](https://forum.core-electronics.com.au/t/pico-typewriter-scroll-wheel-and-a-bell/16282/3 "2023-02-02T07:39:32Z")

</div>

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

Thanks, that coder dojo link explains it really well with this picture, thanks  
 ![Directional Encoders](https://www.coderdojotc.org/micropython/img/Incremental_directional_encoder.gif)

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [2 February 2023 11:16 UTC](https://forum.core-electronics.com.au/t/pico-typewriter-scroll-wheel-and-a-bell/16282/4 "2023-02-02T11:16:46Z")

</div>

Hi Doug  
[8421 Encoder-Vertical | DFRobot DFR0721 | Core Electronics Australia](https://core-electronics.com.au/8421-encoder-vertical.html)  
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
