Chapter 14. Arduino and Raspberry Pi
Arduino boards are superficially a little like a Raspberry Pi in that they are small and essentially a computer. However, Arduino boards are very different from the Raspberry Pi in a number of respects:
- They do not have any interface to keyboard, mouse, or screen.
- They have just 2 KB of RAM and 32 KB of flash for storing programs.
- Their processor runs at just 16 MHz compared with the Raspberry Pi’s 700 MHz.
This might lead you to wonder why you would use such an apparently feeble board rather than the Raspberry Pi directly.
The answer is that Arduino boards, the most common being the Arduino Uno, are better than the Raspberry Pi at interfacing to external electronics in several ways. For example, Arduino boards have:
- 14 digital inputs/outputs, like the Raspberry Pi’s GPIO pins, but each pin can provide up to 40 mA compared with the Raspberry Pi’s 3 mA. This enables them to power more devices without the need for extra electronics.
- 6 analog inputs. This makes connecting analog sensors much easier (see Chapter 12).
- 6 PWM outputs. These outputs are hardware-timed and produce a much more accurate PWM signal than can be achieved with the Raspberry ...