Jeff Duntemann's Contrapositive Diary Rotating Header Image

The Raspberry Pi Keyboard Stutter Problem

When I first cabled up and ran my Raspberry Pi board, it worked like a charm, first time. I was powering it with the Motorola Droid X2 charger that I had stolen from the kitchen desk upstairs. To keep peace in the valley, I went out and bought a cheap Micro-USB phone charger at Best Buy. It booted normally, but then, when I tried to log in, the keyboard began repeating characters. I’d type in “pi” and see a parade of extraneous i’s march in stately fashion across the display:

piiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

Needless to say, I couldn’t log in. Now, this didn’t happen every time, but probably half of all logins I attempted failed, with the same keyboard jitter. I tried two other USB keyboards I had on the shelf plus the known-good one attached to my GX620 USFF, and saw exactly the same behavior. It clearly wasn’t the keyboard itself. I’m using a Dell SK-8135 keyboard, which has a 2-port USB hub to which a Dell USB optical mouse is connected. This leaves one USB port on the RPi free, with any luck to use for thumb drive add-in storage. More on that once I figure it out.

Anyway. Some googling suggested a power supply shortfall. I got out my DVM and put the probes on test points 1 and 2. These are minuscule “doughnut” pads on the RPi circuit board. One is labeled TP1, the other TP2. Hunt around on the board for them; it’s not like there are a lot of square inches to search. TP1 is located next to the 220 uF filter cap at the Micro USB jack. TP2 is right next to the yellow RCA jack.

The RPi is designed to work at 5V. Anything much below that and things may start getting flaky. My reading across the test points was 4.72V. Aha! We now have a new phone charger for the kitchen desk–a cool one with a retractable cord–and I decided to dedicate the old one to the RPi. With the original Motorola Droid X2 charger in the wall, I measured 5.03V across the test points. Shazam! No more keyboard stutter.

I’m not sure it’s a question of the RPi drawing more current than the charger can provide. The Droid X2 charger that works is rated 850 ma. The no-name charger that provided only 4.72 volts is rated 2.1 A. Current sourcing ability is important, especially since different USB keyboards and mice draw different amounts of power–but accurate voltage is just as important. I’m guessing it’s sloppy voltage regulation in the cheap charger. If you’re getting keyboard weirdness, put your DVM on the test points and see what your charger is feeding the RPi.

What? You don’t have a DVM? No Pi for you!

9 Comments

  1. Erbo says:

    On my own Pi, I have a powered USB hub connected, and my USB keyboard and mouse are plugged into that. The extra power ensures I’m not draining juice through the Pi’s USB ports, so, for the Pi itself, a simple 1A 5V USB power plug (mine is branded “Emerson”) works fine.

    1. There’s actually a USB hub in the Dell flat panel monitor I’m using, but I don’t think it’s powered. It’s just a pass-through from the computer. Shame; I was hoping to power the Pi itself from the monitor hub. That way I could turn the whole system on with one switch.

      Have you figured out how to get the Pi to automount thumb drives?

  2. http://selfprogramming.bplaced.net/index.php/2012/10/23/automount-usb-drives-in-raspbian/

    Short version: apt-get install usbmount

    it apparently sets up usb automounting from the terminal.

    -JRS

  3. I’d recommend not a 5V 1A but a slightly higher voltage, say 5.25 or 5.5V and a healthy amperage of 2. Two reasons:
    1. The current drops under full usb load about .5 Volts and the Pi is very sensitive to operating voltage. Less than 4.7V and you can forget it. It also draws more power at startup.
    2. The Pi is also quite sensitive to mains ripple (you need a scope for that 🙂 ) A heavier PS may overcome that too, although, a quality PS with good quality consensors will do the job better.
    Here in Amsterdam the mains ripple is not a problem, but I know from experience that in f.e. Manhattan hotel rooms the mains is very, very poor.. But it will still power your soldering iron, so build a filter/stabiliser. And while you’re at it: connect a DVM to your Pi to let it monitor its own health.

    1. Thanks for jumping in! My cheap PS was at 4.72V, so I don’t blame the RPi for getting cold feet. The one I’m using now (which came with my Droid X2) stays very close to 5V, and doesn’t wander much. Our mains power here is very clean, if a little high. (I have a good scope and have looked at it.) I’m tempted to build a power supply for it, using an adjustable regulator and a DVM module so that I can tell with one look precisely where the voltage is at any time. I have everything but the DVM module in my junkbox, and I know where the DVM modules can be had. I may not get to it right this second, but I’m a seasoned homebrewer and it won’t be a particular challenge.

  4. Stickmaker says:

    My very first computer – a Radio Shack TRS 80 – had really bad keybounce… but it wasn’t *that* bad!

  5. Nowhereman999 says:

    Just wanted to say thanks, low voltage & current were my keyboard problems too. I upgraded the power supply to my Pi and now all is good.

    Cheers!

  6. […] way to solve the Raspberry Pi stuttering keyboard problem is to use a wireless keyboard/mouse set. The one I have (the Logitech MK520) works beautifully. […]

Leave a Reply to Jim Strickland Cancel reply

Your email address will not be published. Required fields are marked *