loading

Do you use emoticons?

Do you ever wish you could have a button to quickly and easily type an emoticon?

Well, look no further because I'll show you how to make a mini emoticon keyboard with a keyboard switch tester, an adafruit trinket board, and a 3d printed case.

Step 1: What Is It Exactly?

This is a mini keyboard based off the adafruit trinket that lets you easily type silly faces. The trinket can also be modified to type other words, phrases, or symbols; move the mouse; or act as a MIDI input.

However, for this project I only wanted to make a little keyboard to help me quickly type these faces, and that's what I'll show you how to make.

Step 2: Switch Tester

This project was born because I had an extra switch tester laying around. What is a switch tester you say? Well, a switch tester helps you test switches (well, duh...). More specifically, it helps you choose what switch type to use in your keyboard. You can buy mechanical keyboards which use high quality switches for a better typing experience, and I purchased this switch tester to decide which switch to get before shelling out the big bucks on a fancy new keyboard.

So now I had this device with six switches laying around. So I decided to make something cool with it! And I also wanted to quickly type emoticons and some of the switches in the tester are super cool (very clicky).

If you have a spare switch tester laying around somewhere, I recommend doing this project! If you don't, you could still use an ordinary push button switch, order cherry mx switches, or find some other way of triggering the trinket.

Step 3: Cutting the Frame

For this project, I only wanted two buttons so I needed to cut off the rest. I first removed the switches from the metal frame, then marked where the cut would be. I then got my friend to cut it at that location, because why not make your friends do your work for you, right?

Step 4: Clean Up the Edges

The dremel cutting wheel was used to smooth the edges.

Sharpie was then used to color match the now shiny silver ends with the black anodization on the rest of the frame.

Step 5: Electronics!

For this project I will be using an Adafruit Trinket, a cool little board I only just learned about. (link: https://www.adafruit.com/products/1501)

It's a very affordable ($6.95 at the time of this posting) board, similar the official Arduino boards, that allows you to easily program a microcontroller (in this case the ATTiny85) with the Arduino IDE. You only need a mini-USB* cable, which most people have lying around anyway. Because of the low size and small cost of this board, it's great for embedding in projects for very rapid prototyping (it was perfect for this project!)

It has 5 I/O pins, and three available if you're communicating over USB. It also has 8k of RAM, analog inputs and outputs, and USB bootloader. We'll be using the bootloader to load code onto the device.

*These now ship with a micro-USB connector; I had one that had been purchased earlier so it was mini-USB.

Step 6: Electrical Assembly

Now it's time to solder!

Each switch has two metal pins that stick out, and these become electrically connected to each other when the switch is depressed. In order for the Trinket to understand that this happens, it needs to change the state of the pin. So one pin of each switch is connected to ground, and the other connected to an input pin on the Trinket. In our program, we tell the trinket to normally keep that pin high, so that if the switch is pressed it brings it low and it can sense it, triggering it to send data to our computer.

How it works:

switch pressed -> switch pins connected -> Trinket pin brought to ground -> Trinket sends signals to computer

What you need to solder:

  • One black wire that connects one pin of switch 1 to one pin of switch 2 to GND on the Trinket.
  • Each of the remaining pins on the switches go to pins 0 and 2 on the Trinket.

And that's it! No more connections to make (besides plugging in the USB cable). It's as simple as that!

Step 7: Designing the Case

I decided to make a nice case for it, because why not! First, I covered the Trinket board in some spare heatshrink I had lying around to electrically insulate it from the ground and switch wires (you could also wrap it in electrical tape).

Next, I measured the metal frame with some calipers and modeled it in a 3D CAD program, in this case Solidworks (though you could use any other suitable program for this project). I created my case so that it would slide in from the top, and added a hole for the USB connector and sent it to my friend's 3D printer (thanks Ashley!).

Step 8: Print It!

Use your 3d printer, find a friend has one, or find a nearby makerspace to 3d print the case.

Step 9: Programming the Trinket

Programming the Trinket is fairly simple, though it could be confusing if you're new to Arduino and/or have limited experience with computers.

Adafruit has written a very nice tutorial here: https://learn.adafruit.com/introducing-trinket/

But I'll also go over some of the important steps below.

1. Read the adafruit tutorial (it's well made and thorough)

2. Install the trinket HID library from this link: https://github.com/adafruit/Adafruit-Trinket-USB

(this lets you use your trinket as a mouse, keyboard, or midi device. You could make almost anything out of this board, very easily and cheaply!)

You'll need to drag the folder TrinketKeyboard into your libraries folder, which is most likely "Documents/Arduino/Libraries" (Mac) or "My Documents\Arduino\Libraries" (Windows). Quit the Arduino program and open it again.

You should also be able to add a library from a .zip file by going to

Sketch->Include Library->Add .ZIP Library

3. Download the arduino sketch from the following link: https://github.com/tedmyers/emoticon_keyboard

4. Upload the code to the Trinket with the following steps:

  • Select Tools->Programmer->USBTinyISP in the Arduino IDE
  • Press the reset button or unplug/replug the trinket USB cable
  • Flash the code by pressing Upload within the next 10 seconds (a red LED will be pulsing during this window of time)
  • Your code should be uploaded!

Step 10: Computer Setup (Mac Only)

Follow the steps above for a mac. You have to set your keyboard settings to use unicode hex input, which lets you type special characters with alt-codes.

The Windows OS has this native, so this step isn't necessary for windows. However, I wrote this specifically for my OSX based computer, so if you use linux or windows you'll probably have to change the code a bit in order to type the emoticons you want.

I used the following website: http://r12a.github.io/apps/conversion/ to help find the correct codes to use for each special characters.

Step 11: Customization! Make Your Keyboard Do Anything You Want

Feel free to modify the code to type anything you want.

I had novelty keycaps for the "lenny" and the "are you serious" face so I made it type those faces when pressed. (I got them through a massdrop here: https://www.massdrop.com/buy/novelty-shine-keycap...)

You can have it print anything you want. Just have it call the functionTrinketKeyboard.print("your text here")

instead of print_serious() or print_lenny() in the main loop and you're set! Your imagination is the limit here!

You're done!

That's it, now you have a working mini emoticon keyboard, that lets you type faces with the touch of a button. Make sure to view the example video in the first step if you want to see how it's like in use, and visit my website at tedfmyers.com or look at my instructables profile for more of my projects.

<p>emoticonkeys.ino:7:29: fatal error: TrinketKeyboard.h: No such file or directory</p><p>compilation terminated.</p><p>Error compiling.</p><p>please help me to solve this</p>
<p>quick question please? how many keys it can support please?(adafruit trinket) thanks</p>
<p>Really Cool project! hope you make more great ideas</p>
this is great I want to design a mini clicking keyboard for osu to eliminate bulk and this is perfect thanks for sharing
<p>Great idea!</p>
<p>This is pretty damn brilliant! :D<br>What make and model is your cute little keyboard? I kiind of want one!</p>
<p>It's custom; you'll just have to follow the instructable and make one yourself!</p>
<p>Ok... I'm an electronic tech (CET), I've been doing computer in one form or another since 1978, and I'm a bit of an all-around geek. <strong>Never heard</strong> of a switch tester before today. <em>Seriously</em>. So I researched... and found out they were for testing the feel of the <strong>Cherry MX</strong> type switches... I saw a whole bunch of different colors and thought, &quot;What's up with that?&quot;<br><br>So... I finally found out about the differences: <a href="http://www.keyboardco.com/blog/index.php/2012/12/an-introduction-to-cherry-mx-mechanical-switches/" rel="nofollow">CHERRY MX SWITCH TYPES</a>.</p><p>Now I got it... and I've learned something for when I go looking for switches in projects... <em>so thanks for that</em>! </p><p>Overall... <strong>great instructable!</strong> I like the ability to hit one key and have it type some text. Could be useful for other things like frequently typed commands, logon names, or similar things.</p>
<p>Thanks, glad I helped you learn something new!</p><p>And you're totally right, this project could be modified just slightly to type almost anything; the sky's the limit!</p>
<p>You could probably make a whole keyboard with just emoticons on it and sell them. I myself don't own a 3D printer and I am not that computer savvy but I want one. One with a lot of emoticons on it. Great instructable, thank you </p>
<p>Very nice; I think this is a great use for the Trinket. Well done!</p><p>Build_it_Bob </p>
<p>Hi I'm having a problem with the code, I think I installed all the libraries correct. It gives me this error:</p><p> This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p><p>Arduino: 1.0.6 (Windows 7), Board: &quot;Arduino Uno&quot;</p><p>In file included from C:\Users\TIM\Documents\Arduino\libraries\TrinketMouse\usbdrvasm_includer.S:24:</p><p>C:\Users\TIM\Documents\Arduino\libraries\TrinketMouse\/usbdrv/usbdrvasm.S:17:1: warning: &quot;__SFR_OFFSET&quot; redefined</p><p>In file included from c:/program files (x86)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/avr/io.h:99,</p><p> from C:\Users\TIM\Documents\Arduino\libraries\TrinketMouse\/cmdline_defs.h:26,</p><p> from C:\Users\TIM\Documents\Arduino\libraries\TrinketMouse\usbdrvasm_includer.S:22:</p><p>c:/program files (x86)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/avr/sfr_defs.h:141:1: warning: this is the location of the previous definition</p><p>In file included from C:\Users\TIM\Documents\Arduino\libraries\TrinketMouse\usbdrvasm_includer.S:24:</p><p>C:\Users\TIM\Documents\Arduino\libraries\TrinketMouse\/usbdrv/usbdrvasm.S:384:34: error: usbdrvasm16.inc: No such file or directory</p><p>Could you help me out?!</p><p>Really love your instructable though.</p>
<p>It does the same with \Trinketkeyboard\</p>
<p>You have the board type set to &quot;Arduino Uno&quot;. The Trinket uses a different CPU (the ATTiny85), so the CPU-dependent code won't work. The Uno doesn't have the direct-to-USB connection that some Arduinos (like the Leonardo) do, so it can't be used for this project.</p><p>It will <em>probably</em> work with the Leonardo-flavored Arduinos, but you <em>might</em> have to tweak the code for the different CPU (I haven't tried any ATTiny85 projects, so I'm not familiar with the differences. Ladyada is a real pro, so she might already have written the code so it will work with the Leonardos, too). The simplest thing would be to just buy a Trinket from Adafruit. If you want to use a Leonardo-style Arduino, you can get them cheap on ebay. I got some micro-sized ones for about $5 apiece from a US seller. You have to be careful when shopping for them, because the naming is really confusing: there are &quot;Mini&quot;, &quot;Micro&quot;, and &quot;Nano&quot; boards that are not the same hardware. Some of them have the ATMega32U4 chip with the direct USB interface, but most of them use an FTDI chip, or a CH340 chip, for the USB like the older Arduinos do. If there's a chip on the bottom of the board in the illustrations, it's probably the FTDI or CH340.</p><p>You might also need to upgrade your Arduino IDE to a 1.6.x version: I don't remember when they added support for the newer chips like the ATTiny85 and the 32U4, but I think it was after 1.0.6.</p>
<p>can i use arduino for this project ?</p>
<p>Yes, you can. ATiny85 or 32u4 will work. The Nano v3 will not.</p>
<p>thnx for answring me <br>so i can just upload the same code to the arduino and it will work ok i? </p>
<p>thnx for answring me <br>so i can just upload the same code to the arduino and it will work ok i? </p>
<p>Wow, are you serious? ಠ_ಠ</p>
a really nice project, i also planned to one my self but with producing a PCB etc. You could have btw used these little attiny85 kickstarter board (1-3$ each).
<p>Wow, great instructable! You could probably really annoy your friends with that, ha! I like the custom keycaps!</p>

About This Instructable

19,906views

325favorites

License:

Bio: Ted hails from sunny California, and is definitely not a robot created by Silicon Valley scientists. He enjoys collecting tools, components, and devices, and has ... More »
More by tedmyers:Delicious and Easy Thai Iced Tea Mini Emoticon Keyboard Slow Cooker Pulled Pork 
Add instructable to: