DIY Arduino Wireless Keyboard

SAGAR SHARMA
Arduino Community
Published in
6 min readSep 1, 2017

The Motivation starts with my laziness… Let me paint a picture for you.I was watching “Friends” in my room lying on the bed like we all do.

The episode ended and I wanted to change the episode so I stretched my arm out in order to watch the next episode for the hundredth time. BUT I couldn’t , because there was this 2 inch gap between my finger and the touchpad which was looking like a 2 Km run. I smiled, not just because I realised that I am the most lazy guy on this planet but I thought “What would it take to make a wireless keyboard???”.

So instead of covering that 2 inch gap, I jumped off the bed and ran to my desk on the other side and after five hours of Googling, Youtubing, and Hit & Trial. I made a wireless keyboard a.k.a T.V. remote to change that episode.

The device can give command from 0 to 9 and Spacebar to pause and play. But you can modify the program to increase functionality just go to page 53 in the pdf present in the repository.

It has a range of more than 20 meters. 😲 oh… Yes…

The tutorial on how to increase your laziness by making a wireless keyboard with arduino is given below:

The Components required:

  1. Arduino Uno or Arduino Mega2560
  2. IR Receiver ( SMOO38)
  3. Breadboard
  4. Jumper wires
  5. T.V. Remote
  6. and some Water to pour on the electronics, just kidding 😃 that was it.

Schematic Diagram :

The Circuit is simple AF… use the 11th pin on ArduinoUno.

Fig: Circuit Schematic

You also need to download a Software called FLIP published by the Atmel. When you click the link and go to the page you will find this…

Fig: Download Flip Software

Just click on that 21Mb link (because it has jre included, just to be on the safe side). Now install it (just like any other Next… Accept… Next… Next install).

But why do we need Flip Software on the first place ?

When we connect arduino to the computer your computer sees this (Go to Devices and Printers to check it out).

Figure : Arduino with basic Firmware

So no matter what you type it only shows on the Serial Communication section of the Arduino IDE because your computer is not reading that device as a keyboard. So to overcome that we need to change the firmware on the Arduino Chip with a keyboard’s firmware that I’ll link below.

So, just go to this Github link and download all the files and to download the IRremote library go the this link and follow the procedure.
Note: If you already have the IRremote library no need to download it.

There are only 6 steps make this lazy device:

1. Upload the Keyboard_Program.ino file.

First, select the correct board and the correct port .

Then click upload.

Fig: Upload the Sketch

Now plug out and then plug-in the arduino again.

2. Put your device in DFU Mode (i.e Device Firmware Update).

To put your device in DFU mode connect these two pins.

Fig: DFU Mode

You will hear the sound of plugging in and out of the arduino automatically. This turns the arduino in its DFU mode .

Note: Don’t plug out the arduino from the computer otherwise it will again comes back to the arduino basic firmware.

In your Devices and Printers it might look like the pictures below.

Fig: Arduino in DFU mode

3. Open Flip and Select Target Device.

Open the Flip software click the Select target device button and you will see something like this.

Fig: Select Target Device

In my case I am selecting Atmega16U2 (for both Uno & Mega).

4. Click Communication Medium & Open Port

Now click the second button (a.k.a. Communication Medium) and select USB Ctrl + U for serial communication.

Then Click open port. If everything in the background lights up, that means Target device you selected is right. But if it doesn’t

Note: You might get error like atusbduf.dll not found or something like that . or Could not open the USB device.

The Solution that is that change the target chip to correct target chip;and check that the Arduino is still in the DFU mode or not.

5. Load the Keyboard Firmware or .Hex file.

First, Click on Load HEX File button and select the right file according to your arduino.

Fig: Load the Firmware

If you are using Uno select this : Arduino-keyboard-0.3.hex

If you are using Mega select this: Arduino-keyboard-0.3-mega2560.hex

6. Run and Start Application.

Before Running and Start Application.

Make sure that all the checkboxes in the operation flow is checked above the Run button and Reset is also checked near the Start Application button.

Now click the Run and if it gets verified then click Start Application.

Fig: Run & Start Application

If everything worked fine, plug out your arduino (I mean your DIY Wireless Keyboard 😉) and Now when you plug it back in it will be show as KEYBOARD!!! in your Devices and Printers like this.

That’s it.

But Don’t worry you can again use it as Arduino. Just repeat the same procedure with the original firmware file.

For Arduino Uno use this file: Arduino-usbserial-uno.hex

For Arduino Mega use this file: Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex

or whichever one works for you.You van also find these files at C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\arduino-usbserial

To get the full code and files go to this Github link.

P.S. Don’t keep any print or Serial.print line uncommented, if you will your arduino keyboard will go crazy.

Watch how it looks:

Fig: Final Project

Contact me on Facebook, Twitter, Linkedin, Google+.

Follow the Publishing page and get the latest at Google+, Twitter.

To get more posts like this follow us on Medium.

and to post your story at Arduino Community, first mail the post at Gmail.

Any comments or if you have any question, write it in the comment.

Clap it! Share it! Follow Me !

Happy to be helpful. kudos…..

--

--

SAGAR SHARMA
Arduino Community

Freelance Writer. React developer. Deep learning/AI Electronics 📩 sagarsharma4244@gmail.com