The Raspberry Pi, and the WiPi USB dongle, with questions about power…

I’m having lots of fun with my Raspberry Pi, and I’ve decided to launch one of my crazy spare-time projects: inspired by this article detailing the construction of RUDEBOT, a kind of mobile tablet robot, I decided to build a robot of my own. But, anything worth doing is worth changing and adapting, so I thought I’d put my own spin on it, and use the Raspberry Pi and an Arduino combined to provide the brains of this robot.

wipi The original incarnation of the RUDEBOT used an Arduino and a WiFi shield. I didn’t like this approach because the WiFi shield is, by all accounts, fairly buggy and limited, and the actual cost of the shield is rather high. It dawned on me that I could buy a Raspberry Pi and a WiPi (the tiny USB 802.11n dongle you see on the right) for less money, and I’d have the advantage of also carrying a full Linux computer on board. I could turn my incarnation into a kind of mobile hotspot, which seemed like it might be a fun thing to try. I would still use the Arduino to handle the basic motor controls with commands sent over a serial port from the Raspberry Pi. Having that much hardware on board makes all sorts of software possible.

robotWhile waiting for parts to arrive, I just sort of began doodling using OpenSCAD to design the basic layout. I built CAD models for the motors and the platform, and selected a 12V 7 amp hour SLA battery. And then… began to think about power.

The documentation says that the Raspberry Pi can consume up to 700ma of current while running. Often, you’ll see that whenever anyone adds any significant USB peripherals to a Pi, they use a powered USB hub. In theory USB devices are supposed to be able to request 500ma of current from the host, but the Raspberry Pi (the second version, the originals ones had even lower power capabilities) has fuses which limit total current at 1A. So clearly, power hungry peripherals can require additional power, and a powered hub is the common solution.

But which peripherals are power hungry? In particular, it would be great if I could hook up the WiPi wireless dongle without having to provide additional power. So, I set out to research whether it was feasible. I saw three ways to proceed:

  1. Simply try it. If it works, then it works. Hard to argue with that, but it doesn’t tell you a lot about what the limits are. Would adding an additional keyboard/bluetooth/mouse push it over the edge? Undisciplined trial and error doesn’t seem like a good approach.
  2. Try it, but measure the current required. This seems like a better approach, and gives you hard data. Basically I’d need to tap a microusb cable so that I could put in my trusty multimeter, and I could measure the current directly. I probably will do that soon.
  3. Try to research how much current these things are spec’ed to use.

The last is easy to do when you have an iPad in front of you during lunch, so that’s of course what I did. But the figure that I’m interested in (power consumption) is not very often listed for USB peripherals. But it turns out that USB peripherals are supposed to give some hints to the host about how much power they require. If you plug in a peripheral to your Linux box (including the pi), you can simply use the command “lsusb -v” to get a dump of all the USB devices, and see what the driver for the hardware thinks it needs.

So, I did just that. I plugged my WiPi into the powered hub, and had a peek. Here’s the dump, most of which is pretty uninteresting, but which contains the Max Power…

Bus 001 Device 008: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x148f Ralink Technology, Corp.
  idProduct          0x5370 RT5370 Wireless Adapter
  bcdDevice            1.01
  iManufacturer           1 Ralink
  iProduct                2 802.11 n WLAN
  iSerial                 3 1.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           67
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              450mA

450ma. Ouch. That seems like a lot. I find it kind of hard to believe that such a tiny transmitter can pull that much current without melting itself (it’s tiny). So, I’m left with some questions:

  1. Can the WiPi really pull that much current?
  2. Can I use it without plugging it into a powered hub? Some people do seem to be doing that, and have even said that it doesn’t work properly when plugged into some powered hubs.
  3. I’m also interested in hooking an Arduino to the Pi. How much current can the Arduino pull?
  4. Ultimately, I probably will want to power all of this equipment with my 12V SLA battery. What’s a reasonable solution to powering the Pi, Arudino and potentially a powered hub? I’m looking for quick and dirty, but also reasonable and reliable.

Any hints from robot/power/Raspberry Pi experts are welcome, here or via twitter @brainwagon.

4 thoughts on “The Raspberry Pi, and the WiPi USB dongle, with questions about power…

  1. Russell Davis

    i’ve had no problem using an edimax wifi dongle that claims to pull upto 500mA on a rev1 board. idVendor 0x7392 Edimax Technology Co., Ltd
    idProduct 0x7811 EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
    bcdDevice 2.00
    iManufacturer 1 Realtek
    iProduct 2 802.11n WLAN Adapter
    iSerial 3 00e04c000001
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 46
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0x80
    (Bus Powered)
    MaxPower 500mA

    It’s been running 24/7 for ssh for

    uptime
    19:42:34 up 18 days, 13:40, 1 user, load average: 0.02, 0.04, 0.05

    so i think the Max Power thing is just some random number they feel like using rather than real world requirements.

  2. Robert

    USB MaxPower can be extremely misleading, but usually is a fairly accurate ceiling.
    I’ve seen extremely low-current devices advertise a MaxPower greater 500ma, and I’ve occasionally seen devices (a couple of “smart” keyboards with integral hubs) advertise a factor-of-ten lower MaxPower than they actually used. 500ma is actually reasonable for most small-factor wifi adaptors, but it’s not enough to power a maximum-FCC-limits device, especially if it’s a multiband, multi-radio device.

    Useful wifi power draw data in http://www.qca.qualcomm.com/media/resource/resource_15_file2.pdf even though it’s mainly about relative energy-efficiency. Dig around and you can find actual current numbers.

    Note also that your RasPi will end up drawing slightly more current itself due to the software half of the wifi stack. At an extreme, the extra load can easily be 2-3x the load induced by the actual radio, although that seems to be less common on modern wifi devices.

  3. David

    Regardless of the answers to your questions about the power taken by the Arduino and WiFi dongle, there is an easy way to reduce the power consumption of the entire setup: replace the Raspi B with the new Raspi A. Apparently losing Ethernet, the second USB port and 256MB of RAM means a dramatic reduction in the power requirements of the board.

    I use a Dynamode WL-700N wireless dongle directly plugged into the Pi without any problem even on one of the first batch of boards that includes fuses on the USB power.

Comments are closed.