Am I doing this right? (Reddit Upvote Button)

27 Jul


Update! My project has been entered in the Instructables “USB Contest” if you like it please vote here:

Not too long ago I saw the “Awesome Button” video on the Make Magazine podcast. In the video Matt Richardson shows how you can take a Teensy development board and turn it into a simple USB keyboard. In his example everytime a button is pressed a synonym for the word “awesome” is sent to the computer. While this is a pretty neat project the idea of creating a simplified keyboard out of a few buttons is what stuck with me. This lead me to start creating my “Reddit Upvote/Downvote button”.

Reddit is a website that has in the past few months taken over my life. Not unlike Digg it aggregates all the best stuff on the internet and makes it easy to consume. The way posts are sorted or brought to the front page on Reddit has to do with the number of Upvotes and Downvotes a post gets over time. Now while these voting options are usually toggled by clicking arrow icons on the webpage they can also be controlled using keystrokes after installing the Reddit Enhancement Suite. After I found this, all the stars aligned for my project.

I started by sketching out a basic design enclosure and making some measurements for the parts I planned on including. The Teensy development board really is teensy so my project box ended up being pretty tiny. In the gallery below you can see the evolution of the project box. I started off with a pretty large box and scaled down to just big enough to fit what I needed. It’s pretty amazing to be able to print a box that fits your exact project dimensions in about 30 minutes. I also printed up and down arrows, the upvote arrow using red plastic and downvote colored blue with a Sharpie. As usual I’ve uploaded my most recent model to Thingiverse as STLs and Sketchup files. These can be downloaded and printed in the comfort of your own home (assuming you own a 3D printer of course).

Programming the keyboard functions on the Teensy is surprisingly simple. There are great instructions on the Teensy development board page for sending keystrokes to your computer and because the board identifies itself as a USB keyboard it works when plugged into a PC or Mac with no additional software! One note: to use the USB keyboard mode you must use the “Teensyduino” software which allows you to program the Teensy using the Arduino programming language and IDE rather than the native Teensy language. I’ve included the code in full at the bottom of the post, but to give a brief overview, when the upvote button is pressed the key combination “CTRL + SHIFT + A” is sent to the computer over USB, likewise if downvote is pressed “CTRL + SHIFT + Z” is sent to the computer. I defined these keystrokes in the Reddit Enhancement Suite manually because they seemed like a key combination that wouldn’t conflict with other programs (default is “a” and “z”).

Above is a drawing of the circuit I put together for the buttons. As you can see it’s really simple and basically an exact copy of the “Button” example on the Arduino website. I moved the circuit from my breadboard to a scrap of circuit board I had left over from my Arc Reactor project and soldered everything down. Since I was looking to fit this into a pretty small space my tolerances (wire length, etc) were also small. Much to my surprise everything worked on my first attempt to move it to a finished board. The only thing left to do was reconnect the USB cord I snipped in half to fit into my project box and put a couple dabs of hot glue on the lid to keep it closed.

Below is a collection of video clips I took while putting this project together. I think it turned out pretty nice and is a great example of the different ways to change a previous project (yours or in this case, someone else’s the “Awesome Button”) into something to fit your needs.


Reddit Upvote/Downvote Button
This code sends the keystroke "CTRL + SHIFT + A" or "CTRL + SHIFT + Z" to your PC
or Mac. Make sure you set your Arduino compatible board to "Keyboard + Mouse" in
the "USB Type" menu. Hotkeys can be changed easily, I've added comments to make it
easier to find. 
For this to work with Reddit as an Upvote/Downvote button you will need to install
Reddit Enhancement Suite ( and set your Upvote and
Downvote hotkeys to the ones assigned in this Arduino sketch.
Code examples edited and reworked from and
TheNewHobbyist 2011 
// The inputs you're using for button presses
const int upVote = 8;     // Upvote
const int downVote = 5;     // Downvote
int upVoteStatus = 0;
int downVoteStatus = 0;
void setup() {
pinMode(upVote, INPUT);
pinMode(downVote, INPUT);   
void loop(){
// Check the buttons
upVoteStatus = digitalRead(upVote);
downVoteStatus = digitalRead(downVote);
// If Upvote button is pressed  
if (upVoteStatus == HIGH) {
// Change the following two lines to change the keys sent     
// If Downvote button is pressed
if (downVoteStatus == HIGH) { 
// Change the following two lines to change the keys sent    

[thingiverse thing=10423]

  • That’s very cool. Any chance you would sell these as a kit?

    • chris

      I’ve actually been looking for a reason to get some printed circuit boards made. Depending on interest I could totally see making this a kit. Stay tuned…

  • Ha! Nice one. I’m loving the music too!

  • Pingback: USB Reddit Upvote / Downvote butonul | ro-Stire()

  • Pingback: USB Reddit Upvote/Downvote button | The Depot of Talk()

  • Any reason you used external pull down resistors instead of the AVR’s internal pull-ups?

    • chris


      I’m still somewhat new to working with Arduino and compatibles. I built my circuit off the “Button” tutorial on While it works I’d be willing to try other methods. Is there an advantage of doing it the other way?

      • The only advantage is it elminates the resistors and a few wires from your schematic. I think the Arduino example did it with the external resistor just so new beginners don’t get confused. When you use the internal pull-up resistors, you only need one wire to the switch, and a second wire to ground; so when the button is pressed it connects the I/O line to ground. But this mean in your code, LOW = switch pressed and HIGH = not pressed. Which can seem a little backwards, but it works just as well with fewer parts.

        Anyway, welcome to Arduino!

        • I did the same thing with my first Teensy project… Next time around I got wise to just using the internal pullup resistor.

          Also, great project, thanks for sharing it!

  • randy random

    Hey! This looks really cool. Been using a K8055 myself for small input/output projects. But that board looks fantastic.

    I do have a question, a bit on the side of the project.

    What notebook is that? It seems awesome with the header like that. I always end up writing that stuff down in the top myself.

    • chris

      It’s a Maker’s Notebook from Make Magazine. It has the header and grid as you mentioned and a lot of helpful info in the back pages (resistor key, handy formulas, etc). It also has a pocket in the back like a Moleskine note book. It’s pricey at ~$20 (I got mine as a free gift for ordering way too many items from the Make store) but it’s actually really nice and I’d buy another when I run out of pages.

  • Pingback: Okay, Whatever. » Blog Archive » Google Reader Shared Items 2011-08-04()

  • As the blue Sharpie ink on the downvote arrow wears off over time, yet the red plastic on the upvote arrow remains cheerful and bright, do you worry that people who see your device over the months will become convinced that you’re hating on everything you view on Reddit, since you’ve ‘clearly’ been working it a hell of a lot more? : )

    • chris

      At this point I will be viewed as history’s greatest monster by all my Reddior peers. 🙁

  • Pingback: Vote Up Button | TechMASH()

  • Pingback: Vote Up Button | TechMASH()

  • sjking2000

    Instant awesomeness. I want to try this with an instapaper button, send email (Firefox ubiquity) …

  • Cowhunter83

    Hey, Just wondering about which teensy development board you used.

  • Ben_Golden

    I seem to be having an issue uploading the code on my teensy… Any idea if your code works for Windows 10 or is exclusive to Macs?