[translated] Arduino Vs. Raspberry Pi--Which Is The Right DIY Platform For You

This commit is contained in:
Frank Zhang 2014-05-24 20:26:25 +08:00
parent 51e730c96b
commit 26af044a3b
2 changed files with 242 additions and 244 deletions

View File

@ -1,244 +0,0 @@
zpl1025
Arduino Vs. Raspberry Pi: Which Is The Right DIY Platform For You?
================================================================================
![](http://readwrite.com/files/styles/1400_0/public/fields/arduinopi.jpg)
If youre at all familiar with do-it-yourself (DIY) electronics, youve probably heard about the comparable merits of [Arduino][1] and [Raspberry Pi][2]. You may have even, [like I did][3], assumed they were competing hardware platforms solving similar problems.
Actually, Arduino and Raspberry Pi are quite different. For starters, Raspberry Pi is a fully functional computer, while Arduino is a microcontroller, which is just a single component of a computer.
Heres a primer to differentiating Arduino and Raspberry Pi, and to determining which of the two DIY hacking devices best fits your needs as a maker.
### Overview ###
Raspberry Pi and Arduino were both originally designed to be teaching tools, which is why theyve become so popular—both devices are very easy to learn to use.
Raspberry Pi hails from the United Kingdom. Inventor Eben Upton and his colleagues at the University of Cambridges Computer Laboratory were frustrated by the dwindling number of students, and the poor skill levels of those students, entering the program. Raspberry Pi was designed to be a cheap, hackable computer for improving tinkering skills. While Upton worked on prototypes from 2006 onward, the first shipment of Pis became available in [April 2012][4].
Arduino, on the other hand, was born in Italy. It was named after the bar where inventor Massimo Banzi and his cofounders first forged the idea. Banzi, a teacher at the Interaction Design Institute Ivrea, wanted a simple hardware prototyping tool for his design students.
As teaching tools, both Arduino and Raspberry Pi suitable for beginners. Its only when examining their hardware and software that it becomes apparent theyre used for very different types of projects.
### Hardware And Software ###
Heres an overview of some of the specs that show the biggest differences between the two:
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p>&nbsp;</p>
</td>
<td>
<p><strong>Arduino Uno</strong></p>
</td>
<td>
<p><strong>Raspberry Pi Model B</strong></p>
</td>
</tr>
<tr>
<td>
<p><strong>Price</strong></p>
</td>
<td>
<p>$30</p>
</td>
<td>
<p>$35</p>
</td>
</tr>
<tr>
<td>
<p><strong>Size</strong></p>
</td>
<td>
<p>7.6 x 1.9 x 6.4 cm</p>
</td>
<td>
<p>8.6cm x 5.4cm x 1.7cm</p>
</td>
</tr>
<tr>
<td>
<p><strong>Memory&nbsp;</strong></p>
</td>
<td>
<p>0.002MB</p>
</td>
<td>
<p>512MB</p>
</td>
</tr>
<tr>
<td>
<p><strong>Clock Speed</strong></p>
</td>
<td>
<p>16 MHz</p>
</td>
<td>
<p>700 MHz</p>
</td>
</tr>
<tr>
<td>
<p><strong>On Board Network</strong></p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>10/100 wired Ethernet RJ45</p>
</td>
</tr>
<tr>
<td>
<p><strong>Multitasking</strong></p>
</td>
<td>
<p>No</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p><strong>Input voltage</strong></p>
</td>
<td>
<p>7 to 12 V</p>
</td>
<td>
<p>5 V</p>
</td>
</tr>
<tr>
<td>
<p><strong>Flash</strong></p>
</td>
<td>
<p>32KB</p>
</td>
<td>
<p>SD Card (2 to 16G)&nbsp;</p>
</td>
</tr>
<tr>
<td>
<p><strong>USB&nbsp;</strong></p>
</td>
<td>
<p>One, input only</p>
</td>
<td>
<p>Two, peripherals OK</p>
</td>
</tr>
<tr>
<td>
<p><strong>Operating System</strong></p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Linux distributions</p>
</td>
</tr>
<tr>
<td>
<p><strong>Integrated Development Environment</strong></p>
</td>
<td>
<p>Arduino</p>
</td>
<td>
<p>Scratch, IDLE, anything with Linux support</p>
</td>
</tr>
</tbody>
</table>
The price and size of the two devices are comparable; we already knew Raspberry Pi and Arduino were tiny and cheap. Its the stuff inside that sets them apart.
The Raspberry Pi is 40 times faster than an Arduino when it comes to clock speed. Even more seemingly damning for Arduino, Pi has 128,000 times more RAM. The Raspberry Pi is an independent computer that can run an actual operating system in Linux. It can multitask, support two USB ports, and connect wirelessly to the Internet. In short, its powerful enough to function as a personal computer (though not powerful enough to compete with your Mac or PC).
It might sound like Raspberry Pi is superior to Arduino, but that's only when it comes to software applications. Arduinos simplicity makes it a much better bet for pure hardware projects.
I asked Limor Fried, the founder of [Adafruit][5], a DIY electronics store that offers parts and kits for both Arduino and Pi projects, about her expert opinion on their differences. An MIT educated engineer whose mission in life is to teach electronics to people of all skill levels, Fried knows both platforms better than most.
“Arduino does have a 'real-time' and 'analog' capability that the Pi does not: This flexibility allows it to work with just about any kind of sensor or chips,” Fried said. “The Pi is not as flexible; for example, reading analog sensors requires extra hardware assistance. There are also thousands of tutorials on hooking an Arduino into just about every kind of part. On the other hand, the Pi benefits from decades of Linux software, so they're both great choices.”
The Arduino IDE is significantly easier to use than Linux. For example, if you wanted to write a program to blink an LED with Raspberry Pi, youd need to install an operating system and some code libraries—and thats just to start. On Arduino, you can get an LED light to blink in just eight lines of code. Since Arduino isnt designed to run an OS or a lot of software, you can just plug it in and get started.
Raspberry Pi can multitask processes—it can run multiple programs in the background while activated. For example, I have a Raspberry Pi that is serving as both a print server and a [VPN server][6] at the same time.
On the other hand, you can leave an Arduino plugged in as it conducts a single process for a long time, and just unplug it when youre not using it. This is why Fried would recommend the Arduino for beginners before she would the Pi:
“The Arduino is simpler, harder to 'break' or 'damage' and has much more learning resources at this time for beginners,” Fried said. “With the Pi you have to learn some Linux as well as programming—such as Python. The Arduino works with any computer and can run off of a battery. You can also turn it on and off safely at any time. The Pi setup can be damaged by unplugging it without a proper shutdown.”
While the Raspberry Pi shines in software application, the Arduino makes hardware projects very simple. Its simply a matter of figuring out what you want to do.
### Working Together ###
The ultimate answer when deciding between the Pi and Arduino is, “Why choose?” If youre looking to learn about electronics, each one will teach you something different.
According to Fried, Raspberry Pi and Arduino are complementary. She suggested a scenario where the Arduino is the sensory workhouse, while the Pi doles out directions:
“They work great together,” Fried said. “The Arduino is best for motor driving, sensor reading, LED driving, etc while you can have an Internet-connected Pi drive it, a mini computer that can play videos, music or send emails with ease.”
Author Simon Monk, who has written dozens of books on both Pi and Arduino, blogged a tutorial for [getting Raspberry Pi to talk to Arduino][7] in just a few lines of code. It makes use of a Python library, [PySerial][8], that the Arduino foundation recommends as the easiest way to get computers to talk to Arduino.
Once youve got that down, the possibilities are infinite. You could [homebrew beer][9], with the Arduino controlling the sensors and the Pi managing the brains of the operation. You could also create a [platform for making robots][10] that are much more capable than plain Arduino or Raspberry Pi bots.
### Community ###
Both Raspberry Pi and Arduino have large, active communities surrounding them. Not only are they used in schools and universities, but also in hackerspaces worldwide.
Here are some of the places you can visit to get Raspberry Pi support and project ideas:
- [The Raspberry Pi Foundation — FAQs][10]
- [The Raspberry Pi Foundation — Project Forums][11]
- [Learn Raspberry Pi with Adafruit][12]
- [Element 14 (Pis manufacturer) Raspberry Pi Community][13]
- [The Raspberry Pi Wiki][14]
Here are some of the places you can visit to get the same for Arduino:
- [Arduinos Official Getting Started Guide][15]
- [Arduino Playground][16]
- [Arduino Official Forums][17]
- [Learn Arduino with Adafruit][18]
- [r/arduino on Reddit][19]
Photo by [Simon Monk][20]
--------------------------------------------------------------------------------
via: http://readwrite.com/2014/05/07/arduino-vs-raspberry-pi-projects-diy-platform#feed=/hack&awesm=~oEFMq68riarQK2
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://readwrite.com/2014/04/21/easy-arduino-projects-basics-tutorials-diy-hardware
[2]:http://readwrite.com/2014/01/20/raspberry-pi-everything-you-need-to-know
[3]:http://readwrite.com/2014/04/16/arduino-raspberry-pi-connected-home-tutorials-projects
[4]:http://www.raspberrypi.org/archives/1081
[5]:http://www.adafruit.com/
[6]:http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing
[7]:http://www.doctormonk.com/2012/04/raspberry-pi-and-arduino.html
[8]:http://playground.arduino.cc/Interfacing/Python
[9]:http://www.brewpi.com/
[10]:http://www.raspberrypi.org/help/faqs/
[11]:http://www.raspberrypi.org/forums/viewforum.php?f=15
[12]:https://learn.adafruit.com/category/learn-raspberry-pi
[13]:http://www.element14.com/community/community/raspberry-pi
[14]:http://elinux.org/RPi_Hub
[15]:http://arduino.cc/en/Guide/HomePage
[16]:http://playground.arduino.cc/Projects/ArduinoUsers
[17]:http://forum.arduino.cc/
[18]:https://learn.adafruit.com/category/learn-arduino
[19]:http://www.reddit.com/r/Arduino
[20]:http://www.doctormonk.com/2012/04/raspberry-pi-and-arduino.html

View File

@ -0,0 +1,242 @@
Arduino Vs. 树莓派: 哪个是更适合你的DIY平台
================================================================================
![](http://readwrite.com/files/styles/1400_0/public/fields/arduinopi.jpg)
如果你很熟悉电子DIY那么应该听过[Arduino][1]和[树莓派][2]的优点比较。你也许甚至会猜测,[像我之前认为的][3],它们两个是处理相似问题的相互竞争的硬件平台。
实际上Arduino和树莓派非常不一样。对于初学者来说树莓派是一台完整功能的计算机而Arduino只是一个微控制器仅仅是组成计算机的一个模块。
这里有一些指引来帮助你区分Arduino和树莓派然后确定这两个DIY设备中的哪个更适合你的需求。
### 概述 ###
树莓派和Arduino最开始都被设计成教育工具这也是它们现在这么流行的原因它们两个都非常容易学习使用。
树莓派来自英国。开始的时候发明者Eben Upton和他在剑桥大学计算机实验室的同事对学生数量的减少和差劲的技能感到非常懊恼于是想办法解决这个问题。他们设计的树莓派是一台便宜的方便修改的计算机目的是提高动手能力。Upton在2006年设计了树莓派的原型在[2012年4月][4]的时候第一次可以在市场上买到。
另一个Arduino诞生于意大利。它是根据发明者Massimo Banzi和合伙人想到这个点子的一个酒吧的名字命名的。Banzi是伊夫雷亚互动设计学院的一名教师他想为他学设计的学生做一个简单的硬件原型制作工具。
作为教育工具Arduino和树莓派都适合初学者。而在了解了他们的硬件和软件特点之后很明显他们会应用到完全不同的项目中。
### 硬件和软件 ###
这里大概列出了两者规格上的最大差异
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p>&nbsp;</p>
</td>
<td>
<p><strong>Arduino Uno</strong></p>
</td>
<td>
<p><strong>树莓派Model B</strong></p>
</td>
</tr>
<tr>
<td>
<p><strong>价格</strong></p>
</td>
<td>
<p>$30</p>
</td>
<td>
<p>$35</p>
</td>
</tr>
<tr>
<td>
<p><strong>体积</strong></p>
</td>
<td>
<p>7.6 x 1.9 x 6.4 cm</p>
</td>
<td>
<p>8.6cm x 5.4cm x 1.7cm</p>
</td>
</tr>
<tr>
<td>
<p><strong>内存&nbsp;</strong></p>
</td>
<td>
<p>0.002MB</p>
</td>
<td>
<p>512MB</p>
</td>
</tr>
<tr>
<td>
<p><strong>主频</strong></p>
</td>
<td>
<p>16 MHz</p>
</td>
<td>
<p>700 MHz</p>
</td>
</tr>
<tr>
<td>
<p><strong>集成网络</strong></p>
</td>
<td>
<p>没有</p>
</td>
<td>
<p>10/100M以太网RJ45</p>
</td>
</tr>
<tr>
<td>
<p><strong>多任务支持</strong></p>
</td>
<td>
<p>没有</p>
</td>
<td>
<p></p>
</td>
</tr>
<tr>
<td>
<p><strong>输入电压</strong></p>
</td>
<td>
<p>7到12伏</p>
</td>
<td>
<p>5伏</p>
</td>
</tr>
<tr>
<td>
<p><strong>内部存储</strong></p>
</td>
<td>
<p>32KB</p>
</td>
<td>
<p>SD卡(2到16G)&nbsp;</p>
</td>
</tr>
<tr>
<td>
<p><strong>USB&nbsp;</strong></p>
</td>
<td>
<p>一个,仅做为输入</p>
</td>
<td>
<p>两个,可扩展外围设备</p>
</td>
</tr>
<tr>
<td>
<p><strong>操作系统</strong></p>
</td>
<td>
<p>没有</p>
</td>
<td>
<p>Linux发行版</p>
</td>
</tr>
<tr>
<td>
<p><strong>集成开发环境</strong></p>
</td>
<td>
<p>Arduino</p>
</td>
<td>
<p>Scratch, IDLE, Linux支持的任何环境</p>
</td>
</tr>
</tbody>
</table>
它们两个的价格和体积都差不多我们已经知道树莓派和Arduino都很小巧很便宜只是它们所包含的东西决定了它们的不同。
树莓派在时钟速度上比Arduino快40倍。而更打击Arduino的是树莓派拥有128,000倍的内存。树莓派是一台独立的计算机可以运行实际的Linux操作系统支持多任务支持两个USB端口还可以无线连接到因特网。总之它足够强劲完全可以作为个人电脑但是还不足以与Mac或PC比较
也许看起来树莓派比Arduino高级但那仅仅是软件应用。Arduino的简单让它在单纯的硬件项目中表现更好。
我采访了Limor Fried她是[Adafruit][5]的创办者Adafruit是一个DIY电子商店提供Arduino和树莓派的部件和工具询问了她关于这两者之间不同的专业意见。作为一个从MIT毕业的工程师立志要教所有级别的电子技术的高手Fried比其他人更懂这两个平台。
“Arduino有处理'实时'和'模拟电路'的能力这是树莓派没有的这种灵活性让它可以匹配任何传感器或芯片”Fried这样说“树莓派就没有这样灵活比如要读取模拟传感器就需要额外的硬件协助。有成千上万的教程教你把Arduino挂到几乎所有的器件上。另一方面树莓派可以受益于多年的Linux软件积累所以它们两个都是很棒的选择。”
Arduino的集成开发环境明显比Linux容易太多了。比如如果你在树莓派上想写个程序让LED闪烁你需要安装一个操作系统以及各种代码库而这还仅仅只是开始。而在Arduino上你可以用仅仅8行代码来让LED闪烁。而且Arduino并没有设计成运行操作系统或是大量软件你可以仅仅把它插到板子上它就开始工作了。
树莓派可以支持多个任务进程,它可以在后台运行多个程序。比如,我有一台树莓派同时用作打印服务器和[VPN服务器][6]。
另一方面你可以让Arduino插在板子上去长时间执行单一的任务而当你想停止的时候把它拔出来就好了。这也是为什么Fried建议初学者在玩树莓派之前先玩Arduino
“Arduino更简单更难'变砖'或'损坏'而且有更多的适合初学者的学习资源。”Fried这样说“而要玩树莓派你不但要学习编程比如Python还要学习Linux。Arduino可以在任意电脑上工作而且可以用电池供电你可以任意时候随时开关都很安全。而树莓派在没有合适关机的情况下断电可能会损坏。”
树莓派在软件应用上大放光芒而Arduino让硬件项目变得更简单。所以问题变成你先确定你想做什么。
### 一起使用 ###
选择树莓派或是Arduino的终极答案是“为什么要选择”如果你想学习一些电子知识它们中任意一个可以教你不同的内容。
按照Fried的意见树莓派和Arduino是互补的。她提供了一种场景Arduino是传感器工场而树莓派负责分发指令
“它们在一起工作会更好”Fried说“Arduino非常适合驱动马达读取传感器数据控制LED等等。而同时你可以用一个连接到因特网的树莓派来驱动Arduino一台迷你电脑可以轻松地用来播放视频音乐或是发送邮件。”
作者Simon Monk他曾经写过大量关于树莓派和Arduino的书在博客里写了篇教程用一点点代码就可以[连接树莓派和Arduino][7]。它用到了Python的库[PySerial][8]这也是Arduino基地推荐的连接电脑和Arduino的最容易的方式。
只要你做到了这个,那几乎就有无限可能了。你可以[自制啤酒][9]用Arduino控制传感器而用树莓派来处理主要流程。你还可以建立一个[制造机器人的平台][10]比单独的Arduino或是树莓派机器人强大多了。
### 社区 ###
不管树莓派还是Arduino都有很多大型的活跃的社区。这些论坛不仅仅是在学校和大学里使用世界范围的骇客们也都在里面。
下面这些地方你可以去看看,里面会有树莓派的支持和一些项目创意:
- [The Raspberry Pi Foundation — FAQs][10]
- [The Raspberry Pi Foundation — Project Forums][11]
- [Learn Raspberry Pi with Adafruit][12]
- [Element 14 (Pis manufacturer) Raspberry Pi Community][13]
- [The Raspberry Pi Wiki][14]
下面是关于Arduino的
- [Arduinos Official Getting Started Guide][15]
- [Arduino Playground][16]
- [Arduino Official Forums][17]
- [Learn Arduino with Adafruit][18]
- [r/arduino on Reddit][19]
图片来源:[Simon Monk][20]
--------------------------------------------------------------------------------
via: http://readwrite.com/2014/05/07/arduino-vs-raspberry-pi-projects-diy-platform#feed=/hack&awesm=~oEFMq68riarQK2
译者:[zpl1025](https://github.com/zpl1025) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://readwrite.com/2014/04/21/easy-arduino-projects-basics-tutorials-diy-hardware
[2]:http://readwrite.com/2014/01/20/raspberry-pi-everything-you-need-to-know
[3]:http://readwrite.com/2014/04/16/arduino-raspberry-pi-connected-home-tutorials-projects
[4]:http://www.raspberrypi.org/archives/1081
[5]:http://www.adafruit.com/
[6]:http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing
[7]:http://www.doctormonk.com/2012/04/raspberry-pi-and-arduino.html
[8]:http://playground.arduino.cc/Interfacing/Python
[9]:http://www.brewpi.com/
[10]:http://www.raspberrypi.org/help/faqs/
[11]:http://www.raspberrypi.org/forums/viewforum.php?f=15
[12]:https://learn.adafruit.com/category/learn-raspberry-pi
[13]:http://www.element14.com/community/community/raspberry-pi
[14]:http://elinux.org/RPi_Hub
[15]:http://arduino.cc/en/Guide/HomePage
[16]:http://playground.arduino.cc/Projects/ArduinoUsers
[17]:http://forum.arduino.cc/
[18]:https://learn.adafruit.com/category/learn-arduino
[19]:http://www.reddit.com/r/Arduino
[20]:http://www.doctormonk.com/2012/04/raspberry-pi-and-arduino.html