Excellent. I just wanted to use an arduino to replace my keyboard on my old Apple II clone which is horribly bad (bounces like hell). I thought I would need an USB shield but thanks to your trick I might away without it.
I have tried three brands of keyboard and none of them have shown signals on my scope yet. EDIT: Looking up new keyboards that support both USB and PS2 I find there are some still available but they are not low price! One example is from Adafruit. EDIT2: After more looking I see one can get a better price purchasing a PS2 only keyboard but it is still almost twice the cost of some low price USB keyboards.
great video ! could you tell me more about the oscilloscope software that you are using and these two things that you have hooked on the resistors ? Thanks in advance
Sir, thanks for your guide, i have a problem in a moment, when you got 3 bytes of data in 2:44, i got 4 - 6 samples. I`m not a pro in programming, may you give an advice how to fix this and read correctly the keyboard? On oscillo i have the same picture.
Maybe you pick up the "make code" when you press the key plus the "break code" when you release it. Together that's 4-6 bytes. Try pressing the key, then holding it a bit before you let go of it. Then you'd see this better.
@@DoctorVolt , thanks for your answer. When i`m holding the button, some bytes are repeated lika you showed in video, but sometimes another byte is mixed in this scope. Excuse me, what is the 'make code' and 'break code'? While testing , i pressed only 'q' and 'w' on the keyboard. And when i press 'q' i had, for example 77 FF EF FF 77, and when i press 'q' again i had 7F EF EE FE. It`s not the correct symbols i have, its like showing the situation i got. Sorry for long reading, thanks for your time.
@@DoctorVolt I learned how to interpret osci data in your video, thank you for that. If you find the time, make a video about it! I am more of a programmer than an electronic...er? so once I know where to start, I could easily create a library :)
How can I use up and down button to scroll the letters and use ok to select letters (to replace the key board )and also save what I have written to eeprom
I tried to do this using two different USB keyboards, and the code is in an infinite loop, in the serial appears FF and when I click on any key, nothing appears, I tried to change the BaudRate, but it didn't work, does anyone know what I can try?
Changing the baud rate does not help, because the clock is supplied by the keyboard itself. Also check whether the keyboard does really output the PS/2 signals like shown in the video if you have an oscilloscope or logic analyzer. There are some keyboards around that only send the USB protocol and not PS/2. The Arduino cannot handle this.
hey , im trying this project , im using an old keyboard but it won't get the 5v to light up and i checked the keyboard before , what to you think the problem is?
@@DoctorVolt what do you mean? i talked about the connection of the keyboard to the circuit , the keyboard doesn't get 5v to send the letters to the LCD
@@escapZe Some times with what people call "bit banging" which can be very tedious to get working for some protocols. UART for example is fairly simple.
I searched for a long time, but most sites say this is not possible without extra hardware. I'm just a rookie, but I knew there had to be a way to do this electronically. I do have one question though. I have this experiment working with a wired numeric keypad, but it does nothing when I hook up a wireless keypad. I got a good clock and data signal with the wired keypad, but the wireless keypad shows nothing. I'm pretty sure I have my triggers set wrong to catch whatever is going on, but that is just a wild guess. Could you offer your thoughts please?
If you have an oscilloscope or logic analyzer, you can check if the keyboards really output the signals described in the video. If not, it will not work.
Hello, it doesn't work on my arduino. When I put data + and data - to 5v of arduino my keyboard turns off because of short circuit of data + and data -. What should I do?
If you wired everything correctly and it still doesn´t work, your keyboard might not support the PS/2 protocol. Many of the modern keyboards don´t support this any more.
I have a problem, I have a ps/2 usb keyboard with rgb leds, and every time i commect the keyboard to the arduino it open and close after half a second, so i tried to remove the transistors, and i discovered that the data transistor connected to the 5v with the red usb wire make this happend, but when i remove the transistor completly it just doesn't open anymore, how do I resolve this? Thanks.
"I blew up my house, is it a good sign? Will it finally work? EDIT: still not working, any advice??" 😂 Real question: can I just connect the 5V to Arduino's 5V, not using electronic buckle?
Its not USB keyboard. It's only PS2 keyboard. Because USB keyboard have D+ and D- and PS2 keyboard have data clock +5v and GND. He using PS2 keyboard not USB.
That's right. Only the keyboard connector is USB but the actual protocol is PS/2, as I clearly stated in the video. So the keyboard must be capable of PS/2 for this to function.
Excellent. I just wanted to use an arduino to replace my keyboard on my old Apple II clone which is horribly bad (bounces like hell). I thought I would need an USB shield but thanks to your trick I might away without it.
By the way, thank you for the excellent explanation.
This video was awesome. No fluff. Direct to the point. Easy to understand. A+
thanks for explaining in really good detail it was a good walk through for me. i learnt a lot of little things along the way!!
Excellent project!
Very useful, many thanks
This is a great video. Very informative, and lightyears ahead of me. Your are very easy to understand. Thank you.
This is very good. Thank you!
This video was awesome.
Much appreciated.
Very good!
Wonderful.
Thanks!!!
I love it thank you!
Very cool! Have been looking for some kind of a solution but all were kind of difficult. I'll try that on my esp32s!
Bro is a genius
This only work on special old keyboards when usb was just introduced, modern cheap usb don't support this anymore.
Thank you. This is the main reason when it does not work.
I have tried three brands of keyboard and none of them have shown signals on my scope yet.
EDIT: Looking up new keyboards that support both USB and PS2 I find there are some still available but they are not low price! One example is from Adafruit.
EDIT2: After more looking I see one can get a better price purchasing a PS2 only keyboard but it is still almost twice the cost of some low price USB keyboards.
Good job !!
Thanks man
You're welcome!
gut gemacht...bravo!!! bravo!!! bravo!!!
Thank you!
S+ video, can i run it without using 10k resistor?
Ha ha! My cat also likes to rest on the laptop keyboard...
This is brilliant. I wonder if I can get it to write the input from the keyboard to an SD card 🤔
Hello
Clock and data are output in keyboard
Very Good thanks
great video ! could you tell me more about the oscilloscope software that you are using and these two things that you have hooked on the resistors ? Thanks in advance
It's the probes of my USB oscilloscope. I'm using a Hantek6254BC
Sir, thanks for your guide, i have a problem in a moment, when you got 3 bytes of data in 2:44, i got 4 - 6 samples. I`m not a pro in programming, may you give an advice how to fix this and read correctly the keyboard? On oscillo i have the same picture.
Maybe you pick up the "make code" when you press the key plus the "break code" when you release it. Together that's 4-6 bytes. Try pressing the key, then holding it a bit before you let go of it. Then you'd see this better.
@@DoctorVolt , thanks for your answer. When i`m holding the button, some bytes are repeated lika you showed in video, but sometimes another byte is mixed in this scope. Excuse me, what is the 'make code' and 'break code'? While testing , i pressed only 'q' and 'w' on the keyboard. And when i press 'q' i had, for example 77 FF EF FF 77, and when i press 'q' again i had 7F EF EE FE. It`s not the correct symbols i have, its like showing the situation i got. Sorry for long reading, thanks for your time.
@@qweqwerty7537 I think by "make" and break", he meant key press and key up
Cool!
How to read any unique serial data when pressing key. I collect into database and use for comparing what the key is pressing.
Would it be possible to read out and use a universal USB game controller with this technique?
Yes, it might work with old ones.
@@DoctorVolt I learned how to interpret osci data in your video, thank you for that. If you find the time, make a video about it! I am more of a programmer than an electronic...er? so once I know where to start, I could easily create a library :)
Vielen Dank ! 🐈⬛
Gerne!
Hello, i have à challenge for you. can you make a version for attiny, thanks very much !
How can I use up and down button to scroll the letters and use ok to select letters (to replace the key board )and also save what I have written to eeprom
this does not work with any of my USB keyboards, apparently only some older keyboards work that way.
i want to do this because i want to troubleshoot my undetected keyboard so that im sure that the problem is on the firmware
Hi, very nice! Is it possible use an Mega2560 todo this? How manage the INT?
Yes, with a few adaptions it will also work with a Mega2560
Hi davide, how do you made it work on arduino mega? i can't make it work.
How did u get that keymap array? is that array can be used for all type of keyboard? Such a great video btw 👍
It's taken from a list of PS/2 keycodes which you can find anywhere.
great that what I search
I guess this will work with nodeMCU aswell.
If I would like to make it just like a real keyboard of my pc,not print on the LCD sceen,what else should be done?
Great video. I'm wondering what is the signaling makes the Caps lock light on? Is it possible to capture the signaling after you press it?
It is the same serial protocol, but in oppoosite direction.
Does it only work with an arduino Nano/Micro or is it possible with an Arduino UNO? I am struggling with the keyboard integration
It works with both Uno and Nano, but the keyboard must support the PS/2 protocol.
I tried to do this using two different USB keyboards, and the code is in an infinite loop, in the serial appears FF and when I click on any key, nothing appears, I tried to change the BaudRate, but it didn't work, does anyone know what I can try?
Changing the baud rate does not help, because the clock is supplied by the keyboard itself. Also check whether the keyboard does really output the PS/2 signals like shown in the video if you have an oscilloscope or logic analyzer. There are some keyboards around that only send the USB protocol and not PS/2. The Arduino cannot handle this.
@@DoctorVolt Thanks in advance my friend 💚
For me it doesnt work, the serial monitor starts to print things without me pressing a button. When i press a button nothing happens :(
Maybe your keyboard does not support the PS/2 protocol. You can Try another (older) one or check the cabling.
hello could i attach an output to each key
Of course.
can you make a basic pc with this and a 16 by 4 lcd display
yes
hey , im trying this project , im using an old keyboard but it won't get the 5v to light up and i checked the keyboard before , what to you think the problem is?
Because it does not control the LEDs.
@@DoctorVolt what do you mean? i talked about the connection of the keyboard to the circuit , the keyboard doesn't get 5v to send the letters to the LCD
The keybard cable shoud have 4 connectors: Plus 5V and ground, one for clock and one for data. So I don't exactly understand the issue.
@@DoctorVolt yea we realise that but when the keyboard wires are connected to the circuit it doesn’t send a letter to the lcd , it not even turn on.
Hey 👋👋 I liked your video soo much but I have a question. Can this be used to make a keylogger ?????
Yes, but note that the Arduino has only very limited memory to store the key strokes.
@@DoctorVolt how many characters is the limit
SAMD21. Datasheet specifies USB host mode. I'm sure there are others too.
Yes, but Arduino is based on Atmega 328, which has no USB support at all
couldn't you hook up a USB module onto a bread board and set it to some pins?
@@escapZe Some times with what people call "bit banging" which can be very tedious to get working for some protocols. UART for example is fairly simple.
@@Marc_Wolfe k
Thank you so much I’m trying to make a typewriter that reads everything and saves it to a sad card🎉🎉🎉
As card
Sd card I hate autocorrect
Funky tnx à lot
I searched for a long time, but most sites say this is not possible without extra hardware. I'm just a rookie, but I knew there had to be a way to do this electronically. I do have one question though. I have this experiment working with a wired numeric keypad, but it does nothing when I hook up a wireless keypad. I got a good clock and data signal with the wired keypad, but the wireless keypad shows nothing. I'm pretty sure I have my triggers set wrong to catch whatever is going on, but that is just a wild guess. Could you offer your thoughts please?
That's because wireless keyboards don't support the legacy PS/2 protocol. They only use USB, of which the Arduino/Atmega328 is not capable at all.
@@DoctorVolt Thank you for the quick response.
Hello, I want to interface a usb keyboard with an Arduino for an application that involves multiple simultaneous key presses. How could I do this?
This is only possible with modifier keys like Shift, CTRL, Alt. It´s not possible with normal keys like "a" and "b" for example.
Do you still have the schematic and the source code? I clicked on the link but it's not showing up on the "new project hub".
Here is the new link: www.hackster.io/michalin70/connect-a-usb-keyboard-with-an-arduino-50c077
@@DoctorVolt thank you!
Would it work with a barcode scanner?
It depends on which protocol your scanner is using.
@@DoctorVolt I don't know but when I connected it to Android smartphone it been treated like a keyboard
He doubts?? Is there any way to connect a wireless keyboard instead of a wired keyboard? Thank you Thales Gustavo
I tried with mine, but it didn´t work.
Could you post the code?
Link is in the description.
Thank you so much
I tested three USB keyboards and finally got one to respond, but it only prints FF.
If you have an oscilloscope or logic analyzer, you can check if the keyboards really output the signals described in the video. If not, it will not work.
@@DoctorVolt What if I don't have oscilloscope. Is there way to test?
@@csicee Then, a $10 USB logic analyzer from China can do the job. You can get these on Ebay or Aliexpress.
delivery: 42 days ;-;
Is there a version of this with a small LCD?
Of course. You only need to adapt the sktch a bit
@@DoctorVolt k !
would it still work with a Arduino mega and a shield? I've tried but don't know if I did something wrong.
Also what would be the easiest way to find out what level of a resistor I would need?
@@escapZe 10k is a good value.
Hello, it doesn't work on my arduino. When I put data + and data - to 5v of arduino my keyboard turns off because of short circuit of data + and data -. What should I do?
If I just connect data + to pin 7 and data - to pin 6 nothing happens. I have codded that if you press enter, led turns on but nothing happens
I am using arduino uno. Can you help me please?
If you wired everything correctly and it still doesn´t work, your keyboard might not support the PS/2 protocol. Many of the modern keyboards don´t support this any more.
@@DoctorVolt thank you for answering! In that case i will buy mini USB host shield. I think it will work the same way
I am using PS/2 keyboard and still nothing shows up
Mate how do I make it work for Arduino due because my native pott is use for something else
I have a problem, I have a ps/2 usb keyboard with rgb leds, and every time i commect the keyboard to the arduino it open and close after half a second, so i tried to remove the transistors, and i discovered that the data transistor connected to the 5v with the red usb wire make this happend, but when i remove the transistor completly it just doesn't open anymore, how do I resolve this?
Thanks.
"I blew up my house, is it a good sign? Will it finally work? EDIT: still not working, any advice??"
😂
Real question: can I just connect the 5V to Arduino's 5V, not using electronic buckle?
Its not USB keyboard.
It's only PS2 keyboard.
Because USB keyboard have D+ and D- and PS2 keyboard have data clock +5v and GND.
He using PS2 keyboard not USB.
That's right. Only the keyboard connector is USB but the actual protocol is PS/2, as I clearly stated in the video. So the keyboard must be capable of PS/2 for this to function.
Red doch einfach Deutsch 🙄
Warum nur Deutsch? Ich verstehe Englisch besser als deutscher Sprache (that was nowhere near grammatical correct 🤔)
Deutsche Untertitel wären nett.
Zum Glück für mich ist Dein gesprochenes Englisch noch so deutsch gefärbt, dass sogar ich das meiste verstehe.
It. Will.work with barcode scanners?
Maybe if they use PS/2