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 modify the program to increase functionality.
The tutorial on how to increase your laziness by making a wireless keyboard with Arduino is given below:
The components required:
- Arduino Uno or Arduino Mega2560
- IR Receiver (SMOO38)
- Jumper wires
- and some water to pour on the electronics, just kidding 😃 that was it.
The circuit is simple; use the 11th pin on Arduino Uno.
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.
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).
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.Instructions
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.
Now unplug 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.
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 unplug 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.
3. Open Flip and Select Target Device.
Open the Flip software click the Select target device button and you will see something like this.
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 the Target device you selected is right. But if it doesn’t:
Note: You might get an error like atusbduf.dll not found or something like that or Could not open the USB device. The solution is to 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.
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 are 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.
If everything worked fine, unplug 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.
But don’t worry ,you can again use it as an 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
- To get the full code and files go to this Github link.
- Watch how it looks: [Fig: Final Project]
- Follow the Publishing page and get the latest at Google+ & Twitter. And to post your story at Arduino Community, first mail the post via Gmail.
If you have any comments or questions, write it in the comments.
Like it! Share it! Follow Me!
Happy to be helpful. Kudos.