Results 1 to 3 of 3

Thread: Arduino Uno vs. Raspberry Pi Zero robotics performance

  1. #1
    Join Date
    Apr 2016
    Detroit Region
    Rep Power

    Arduino Uno vs. Raspberry Pi Zero robotics performance

    How does execution speed compare between a 16MHz Arduino Uno and a 1 GHz RPi Zero? For instance I read that A/D conversion is max 9kHz for Arduino and loop speed for one io pin write only is about 100kHz. Do you have any good references that compare the speed of running similar code or functions on the RPi and Arduino? I am mainly interested in comparing the speed of robotics type functions.

    A more practical question, if you implement the same robotic functions in both, would you notice differences or improvements if using the Pi instead? Things like reading sensor values, simple calculations, moving servo and stepper motors (aside from more complex things like vision and voice recognition).


  2. #2
    Join Date
    Sep 2010
    Rep Power

    Re: Arduino Uno vs. Raspberry Pi Zero robotics performance

    An Uno uses an 8-bit AVR microcontroller that runs only the sketch you compile with no intermediary (like an OS) required, while the various Pi versions use 32/64-bit ARM requiring an OS and running any, and as many, programs you want. The PiZero has no ADC and requires a complete OS that will likely not have a real-time kernel. The PiZero can control external digital devices easily enough (as long as the logic level is no more than 3.3V) using its hardware serial communication ports (UART, I2C, and SPI), but may not be as responsive with plain digital pin control as the Uno using its hardware PWM and easy pin manipulation. If you are using any USB devices like webcams or commercial lidar units, then the Uno is not an option. If you are wanting to interface to multiple analog or non-UART digital sensors, the Uno is the better choice as it can perform admirably on its own and further act as a USB connected sub-controller for a PiZero. The Uno also runs at 5V, so does not require level-shifting to interface to 5V sensors.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    gives free advice only on public threads

  3. #3

    Re: Arduino Uno vs. Raspberry Pi Zero robotics performance

    The Raspberry Pi runs several of orders of magnitude more code per millisecond. If you include the GPU, you can add another order of two of magnitude.

    However, the problem you're asking about has nothing to do with the execution speed. Instead, there is a built-in limitation to the frequency at which you can read the ADC device. A faster CPU coupled with a slow ADC will just spend more cycles doing nothing, waiting for the ADC to return the value, which is a waste. Although a better OS will let other parts of the program do work while the ADC is busy working -- this is what threads and processes is for.

    The Raspberry Pi has different peripherals than the AVR. The serial port can run faster, and has more buffering. The GPIO can toggle really fast, but only if you use a very low-level API; most sample code use wiringPi or Python or even file I/O to the /sys/class/gpio file system, which is slower per-pin, but provides other benefits. Meanwhile, the Raspberry Pi has very few PWM channels, and has no ADC at all.

    The difference between a "microcontroller" and a "microprocessor" is typically just that -- the microcontroller has more peripherals (I2C busses, SPI busses, GPIOs, PWM channels, UARTs, etc) and the "microprocessor" focuses more on actual code (math) execution.

    If you want an easy-to-program microcontroller that runs faster than the AVR / Arduino Uno, yet has a robust set of peripherals (and also is 5V tolerant) then you can't go wrong with the Teensy 3.2. It's great!
    My robot actually uses a Raspberry Pi for vision/camera/configuration/smarts, and a Teensy 3.2 for the low-level device interfaces (UARTs, GPIOs, PWM, ADC, etc.)
    The Teensy3.2 has higher-performance devices than the AVR for most things (including three UARTs with deep FIFOS plus USB!) and a faster CPU (the ARM Cortex M4.) It's still less than 1/10th the CPU speed of one core of the Raspberry Pi if you want to use heavy lifting math.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Still getting crunchy performance from Xbee
    By jwatte in forum Mech Warfare
    Replies: 10
    Last Post: 02-06-2015, 08:36 PM
  2. raspberry pi for robotics? ROS? Rover bot
    By SuperMiguel in forum Software and Programming
    Replies: 6
    Last Post: 05-23-2013, 06:43 PM
  3. Kinect+PC performance thread
    By tician in forum ROS - Robot Operating System
    Replies: 1
    Last Post: 12-14-2012, 10:30 PM
  4. How to performance test servos?
    By billyzelsnack in forum DYNAMIXEL & Robot Actuators
    Replies: 32
    Last Post: 03-25-2011, 11:23 AM
  5. Question(s) Which microcontroller is best in terms of price and performance?
    By DannyDeth in forum Robot Computers
    Replies: 13
    Last Post: 03-31-2010, 12:54 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts