Mini Emoticon Keyboard

Introduction: Mini Emoticon Keyboard

About: 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 amassed quite a collection (mainly through du...
More About tedmyers »

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!

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.

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.

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

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.

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.

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. Never heard of a switch tester before today. Seriously. So I researched... and found out they were for testing the feel of the Cherry MX type switches... I saw a whole bunch of different colors and thought, "What's up with that?"

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

You have the board type set to "Arduino Uno". 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.

It will probably work with the Leonardo-flavored Arduinos, but you might 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 "Mini", "Micro", and "Nano" 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.

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.