📜 ⬆️ ⬇️

Arduino and Raspberry PI: sworn enemies or best friends?

Hello.

We are currently thinking of publishing something on the topic of Arduino, since in 2015 this topic finally began to spit up on the Russian market, both in the form of books and in the form of complete sets of constructors. However, the study of this topic inspired us to translate wonderful material from the Digitaltrends website, the author of which very sensibly and objectively compares the Arduino with the latest miniature computer Raspberry Pi, analyzes the advantages and disadvantages of both technologies.

We would like to publish the translation of this material today, and at the same time add a small survey in our traditional style. Share your impressions, preferences, tell us about your experience with one or another of the described platforms, if any.
')
So, you are invited under the cat.

image

At present, amateur engineers who are fond of “do-it-yourself” design do not lack special devices to equip any product with a good electronic filling. One of the most popular solutions of this kind is a cheap Raspberry Pi microcomputer, a system on a chip (SoC), using a fully functional version of the Linux operating system (this computer was developed for educational purposes). There is also an Arduino platform - a microcontroller that has impressive technical support (a whole community of developers) and has hundreds of extension schemes (the so-called “shield”).

After the announcement of the appearance of the computer Raspberry Pi, many might have thought that the Arduino platform was obsolete, but it is likely that this is too hasty a judgment. In fact, the niches of the use of both devices are different, each of them has its advantages and disadvantages, as well as a range of tasks that are solved differently. In addition, if you rely only on dry data specifications, a direct comparison of the two platforms is very ambiguous, given that the Arduino processor with a frequency of 16 MHz is clearly inferior to the processor Pi with a frequency of 900 MHz.

Raspberry pi

image

Of course, the Raspberry Pi is a full-featured computer. It has all the attributes of a real computer: a dedicated processor, memory and a graphics driver for output via HDMI. It even runs a special version of the Linux operating system. Therefore, most of the programs for Linux are easy to install on the Raspberry Pi. It is worth a little work - and Raspberry Pi can be used as a full-fledged media server or a video game emulator.
Although there is no internal data storage in Pi, smart cards can be used on this computer as flash memory serving the entire system. Thus, you can quickly unload various versions of the operating system or software updates for debugging. Since this device provides independent connectivity over the network, it can be configured for access via SSH, or send files via FTP.

Arduino



Arduino boards are microcontrollers, not full-fledged computers. They do not have an operating system as such, Arduino simply executes code interpreted by the firmware. In this case, you do not have at your disposal the basic tools provided by the operating system, but, on the other hand, such direct execution of a simple code is simpler, and there is no cost associated with the operating system during operation.
The main purpose of the Arduino board is interaction with sensors and devices, so the Arduino is great for hardware projects where you just need to respond to various sensor signals and manual input. It may seem that this is nothing special, but in fact the Arduino is a complex, calibrated system that greatly simplifies device management. It is perfectly suited for articulating other devices and actuators, where a full-fledged operating system is simply not required, as it is simply a matter of recording actions and responding to them.

Nutrition

The power requirements for these two systems are very different. Raspberry Pi for work needs a constant voltage of 5V, moreover, the work of the Raspberry Pi ends with a software process - like a regular computer. Arduino, in turn, begins to execute the code immediately after switching on and stops working when you remove the plug from the outlet. To expand the functionality of the device with Arduino, you connect the device either directly to the pin contacts of the Arduino board itself or to the expansion cards (shildam) for it. There are hundreds of different shields, each of which is designed to solve a specific task, can interact with various sensors, as well as with other shields, which together form a complete control unit.

Raspberry Pi is difficult to move from place to place, as you can not just insert two AA batteries into it. For the operation of this computer, it is necessary to provide uninterrupted power supply, as well as to connect additional equipment that guarantees DC supply. In the case of the Arduino, the whole process is somewhat simplified, since the system requires only a set of batteries, providing a voltage not lower than a certain level; i also need a simple shield for power management. Even with emergency power outages on the Arduino, you risk neither damaging the operating system, nor getting any software errors. It is necessary to reconnect the Arduino to the power source - and the device will simply resume operation.

Network

The Raspberry Pi has a built-in Ethernet port that provides easy access to any network and requires almost no configuration. It’s also easy to carry out wireless Internet on the Raspberry Pi: buy a USB adapter for WiFi and install the appropriate driver. Once this is done, you can use the operating system to connect to web servers, process HTML or just write something on the Internet. You can even use the Raspberry Pi to create a virtual private network or as a print server.



Unfortunately, the Arduino system without additional modifications is not adapted for work on a network. You need to tinker with it to establish a reliable connection, but it is quite possible. You will need an additional circuit equipped with an Ethernet port, you will also need to plug in some cables and write the necessary code to make it work. In general, this is quite a difficult job, so some companies produce Arduino platforms with already built-in Ethernet functionality.

Sensors

Both the Raspberry Pi and the Arduino have a set of interface ports, but analog sensors are much easier to connect to the Arduino. The microcontroller easily interprets various signals based on the code you write and reacts to them. Therefore, the Arduino is great for those cases where you plan to execute a series of commands or respond to the readings of the sensors, depending on which the operation of the servos and devices will be adjusted.

In turn, the Raspberry Pi requires special software for effective interaction with such devices - this is probably unnecessary complexity if you just want to automate the watering in the garden or store beer at the right temperature. In many projects, the Arduino and the Raspberry Pi are used together, and the Arduino acts as a control board on which commands issued by the Raspberry Pi software are executed. Information from the sensors is sent to the Raspberry Pi, where it is recorded, or in response to it, certain operations are performed.

Results

So which of the two technologies will suit you? There is no definite answer, as it depends on the specific project.

When is it better to choose Arduino? This is done if your main task is to read the sensor data, change the values ​​on the engine or other devices. Given the Arduino power requirements and ease of maintenance of this system, the device can be fully operated without shutting down, while almost without interfering with its work.

When is the best time to stay at Raspberry Pi? This is done when solving such tasks that it would be logical to perform on a personal computer. Raspberry Pi makes it easy to manage your workflow in different situations: if you connect to the Internet to read or write data, play some media or connect to an external display.

Given that Arduino and Raspberry Pi solve different problems, in certain situations it is convenient to use these devices together. There are a number of possibilities for connecting two devices; in this case, you get client access to the settings and code through Pi, while the Arduino controls the control of the working bodies and collects information from the sensors. There are many options for such a connection: via USB, local network or in the form of a simple connection of the Arduino input / output ports to the Raspberry Pi.

Source: https://habr.com/ru/post/255701/


All Articles