Category Archives: Raspberry Pi

Comparing Raspberry Pi to Banana Pi

The new version of the hugely famous single board computer, the Raspberry Pi or the RBPi as it is commonly known, brings many improvements to its users. The RBPi version 2, Model B has improved on the CPU, added RAM, more USB ports and GPIO pins. However, the increasing popularity of the RBPi has sparked off a trend with several other manufacturers chipping in to make available SBCs with features similar to and sometimes surpassing those of the RBPi. The Chinese manufacturer LeMaker is one such manufacturer producing a competing product called the Banana Pi.

The Banana Pi manufacturer, LeMaker, took pains to ensure compatibility with the RBPi while improving on the performance. That made LeMaker replace the CPU with a superior one operating on dual cores clocked at 1GHz. That is, until the manufacturers of the RBPi responded with a V2, Model B that has a CPU with four cores firing away at 900MHz.

That made the difference in performance more dependent on the software running on the individual SBCs. The video processor in the new RBPi is somewhat more advanced as compared to the Mali GPU in the Banana Pi. Therefore, those using HDMI out for playback or media streaming will find the RBPi a better choice.

On the other hand, people requiring access to a large storage for consistent read and write, will find the Banana Pi more convenient. The Banana Pi has a SATA port that allows connecting a large hard drive, offering the faster and more permanent options of a mass storage device. Compare this to the MicroSD storage and USB interface that the RBPi relies on for interfacing to memory devices.

Although both devices have Ethernet ports built-in for wired network connectivity, the Banana Pi has gigabit capability. However, that does not tip the scales against the RBPi much, since many devices are yet to have gigabit support anyway. The Pro version of the Banana Pi, however, can simplify a lot of projects with its built-in Wi-Fi and 802.11n support. While with the RBPi, you need to plug in a separate Wi-Fi module, which will tie up one of its USB ports.

The design concept of the RBPi centers on its ease of use and its budget-friendliness. That has made it such an extremely popular entity in the maker community. A large support base of users enforces the usefulness of the device, providing it with a wealth of information on creating software, hardware and innumerable tutorials built specifically for the RBPi. Although such resources do exist for the Banana Pi as well, they are neither as common nor so comprehensible. Moreover, the Banana Pi is somewhat harder to set up when compared to the RBPi setup.

For those planning to use a Banana Pi as a drop-in replacement for the RBPi, there is disappointment in store. Dimensionally, as the Banana Pi is larger than the RBPi, replacement entails a bigger case or an expanded slot for the Banana Pi. A bigger worry is the placement of the CPU, which, for the Banana Pi, is on the bottom side of its board rather than on the top. That may mean additional arrangements for heat removal, as the CPU is the biggest heat generator in any SBC.

LIDAR and the Raspberry Pi

For hackers and DIY enthusiasts, it is always a challenge to make correct measurements between their robots and nearby objects such as an autonomous vehicle. Estimating the distance is important for the robot to make a decision about avoiding bumping into obstacles. Although this may be considered trivial for a small robot running into a wall, it could turn out deadly for the same robot encountering an autonomous vehicle.

In 2013, NASA held a competition called SRR or Sample Return Robot, where several entrants used various techniques for making measurements using visual aids such as cameras. Two entrants used LIDAR, which can also be used with the single board computer, the Raspberry Pi, or RBPi.

Although using similar methods, LIDAR uses light for measurements, rather than its forerunner RADAR or Radio Detection and Ranging. According to the Merriam-Webster dictionary, LIDAR was first used 1963 for measurement of clouds and Apollo 13 used it to measure the surface of the moon. Since then, the reductions in the size of lasers have led to additional uses, including the military using LIDAR for range finding.

A scanning LIDAR uses the laser beam to sweep a wide area both vertically and horizontally. The feedback provides a cloud of distantness measurement points. This is similar to aircraft control radar swinging a beam through the sky. There are two principal methods for measuring distances using a laser. One is to measure the time of flight of a laser pulse and the other is to measure the angle by which the laser beam deflects.

For the time of flight measurement, you send out a pulse of laser and measure the time for the signal to return. That time divided by the speed of light gives the distance the laser traveled out and back. The distance to the object is then half the calculated distance. Given the high speed at which light travels, it is difficult to measure distances below a meter using lasers, because light would be returning in about seven nanoseconds. LIDAR uses continuous modulation of the laser by amplitude or frequency and measures the phase difference between the transmitted and received signals. This process using modulation allows measurements down to centimeters.

The LIDAR is actually a sealed unit with a motor at one end that spins a turret at about 300 RPM. Inside the turret are the laser and the receiving sensor. Spinning allows a 360-degree scan of the surrounding area. There are two optical ports out of the turret, corresponding to the laser and the sensor. A two-pin connector provides power to the motor. Another four pin connector is for supplying the inner control and serial interface circuits with 5V and 3V3 DC.

WiringPi is a library of programming the GPIO on the RBPi that offers an absurdly simple and minimal user interface for handling the LIDAR. Additionally, WiringPi is suitable for several RBPi models. Another advantage in using WiringPi is its ability to do hardware PWM on one GPIO pin of the RBPi. Another possibility is to use PID or Proportional Integral Differential control system in a loop to maintain constant speed of the turret motor.

Raspberry Pi and Mathematica Control Telescopes

The single board computer, the Raspberry Pi or RBPi is a versatile device helping youngsters learn computer programming. Its advantages do not stop there, because many hobbyists and DIY enthusiasts also use the RBPi for their numerous innovative projects. For example, Tom Sherlock, an amateur astronomer, has put the RBPi to good use for controlling his telescope. Along with the RBPi, Tom uses Mathematica and the Wolfram language for his telescope control.

Amateur astronomers such as Tom use Mathematica in their hobby to process and improve the images they take of planets and nebulas. They use the Wolfram language to control their astronomical hardware. This consists mainly of controlling the drive on the telescope mount, as this is necessary when automating an observing session.

The process is an important one for the amateur astronomers who use their computerized telescopes for hunting down transient phenomenon such as supernovas. Existing software can take care of the several tasks required by astronomers such as locating objects, managing data and performing image processing, However, automating all the various tasks that an observation session needs, is a great help.

Mathematica is a very useful tool for astronomers. It helps in automating and unifying many of the above operations. Within Mathematica, you have a huge amount of useful astronomical data, which includes the coordinates of several thousand planets, asteroids, galaxies, nebula, and stars. The image handling and processing capability of Mathematica is extremely useful when processing astronomical data.

Tom had earlier interfaced with telescope mounts using an existing library of functions known as ASCOM, a powerful tool for driving domes and filter wheels, mainly associated with astronomy. However, ASCOM has to be pre-installed on a PC and therefore, is rather limited in its use. Using Mathematica allows one to drive the telescope mount directly from any platform and does not need any special setup.

According to Tom, most telescope mounts follow one of two serial protocols for their control. These are the Celestron NexStar protocol or the Meade LX200 protocol. Many non-Meade telescope mounts, such as those from Astro-Physics and Losmandy, also follow the LX200 protocol. Those produced by the Orion Atlas/Sirius family of computerized mounts follow the NexStar protocol just as the Celestron telescopes and mounts do.

The LX200 protocol requires the right ascension (RA) function specified by a string such as HH:MM:SS and the declination (Dec) by a string in the form of DD:MM:SS. These are the basics for slewing the telescope to a target at coordinates specified by the RA and the Dec strings.

You will need an inexpensive USB-to-Serial adapter for creating the RS232 port that the RBPi does not normally have. You also need a small wireless network adapter that fits in the RBPi USB socket. As RBPi uses the Linux operating system, it is easy to use the Wolfram language code for controlling the telescope through the serial port. Additionally, the RBPi can be networked wirelessly. That makes it possible to control it from inside the house, necessary when the weather outside is cold.

Does the Raspberry Pi 3 Run Hotter than the Raspberry Pi 2?

Several people are now eagerly using and testing the new SBC or single board computer from the Raspberry Pi Foundation, the Raspberry Pi Model 3, or RBPi3. Although the overall response has been of enthusiastic welcome, there are some notes of concern as to the new board running rather warm under load. Michael Larabel has run some tests to compare and show just how warm the RBPi3 can get when compared to what the RBPi2 does. Finally, we suggest some remedies for cooling down the RBPi3.

Michael has used the Phoronix Test Suite while monitoring the SoC temperature on both, the RBPi3 and RBPi2, when running the same benchmarks in the same manner for both. One important point to note is the RBPi2 was running inside its case, while the RBPi3 ran completely exposed.

The average temperature of the SoC on the RBPi3 under load was 61∞C, peaking at 82∞C. Under the same conditions, the RBPi2 (within its case), recorded an average temperature of 48.9∞C, peaking at 59∞C. That means the RBPi3 under load, operating in open air, was peaking at more than 20∞C, over its predecessor. That also means if you are planning to put the RBPi3 inside a case when operating, it might make matters worse.

Therefore, if you are planning to stress your RBPi3 routinely, you might consider the following options to keep the RBPi3 temperature down.

Wait for the Linux 4.6 kernel

According to Eric Anholt from Broadcom, the VC4 DRM driver is undergoing an update to get into the Linux 4.6 kernel merge window. This will include a significant 3D improvement in performance and a fix to the HDMI hotplug detection for the RBPi2 and RBPi3. The improvement in performance comes from the RBPi kernel DRM driver pairing with the user-space driver of the VC4 Gallium3D.

Better performance is mainly due to the pipelining, binning and rendering jobs from using xllperf or GLAMOR over OpenGL, which boosts the performance by over 20-30%. The hardware is capable of running separate threads simultaneously for binning and rendering, while OpenGl waits for them to complete before it submits the next job.

Wait for the 64-bit Raspbian

Michael has done some tests to show that there is a conclusive evidence of performance difference between using 64-bit software on supported hardware over a 32-bit operating system. Since the new RBPi3 is a 64-bit system at hardware level, the results should apply to this SBC as well.

For the test, Michael has used an Intel UX301LAA ultrabook with 8GB of RAM and 128GB SanDisk SSD. The operating system was Ubuntu 16.04 daily ISO build, in 64-bit and 32-bits version.

The average power used by the 64-bit system was 30.1W compared to 31.9W by the 32-bit system. Lowest power consumption with 64-bit build was 8.5W compared to 9.4W. The peak power consumed by the 32-bit system was higher at 54.3W compared to 49.7W by the 64-bit system.

Use a Heat Sink to Cool the RBPi3 immediately

For immediate relief, you can use the passive heatsink available that fits the RBPi2 as well as the RBPi3. At $5 from Amazon, this solution is cost-effective in addition to being immediately available. Moreover, the heatsink will drop the temperature of the SoC by almost half.

Cayenne on a Raspberry Pi

If you are building projects for IoT or the Internet of Things, a single board computer such as the Raspberry Pi, also known as the RBPi, can be a great asset. Moreover, with Cayenne installed on the RBPi, you have a drag-n-drop IoT project builder that the developers of the Cayenne software, myDevices, claims is the first in the world.

Therefore, now it is easy to connect your RBPi to a mobile or online dashboard. On the other side, you have a breadboard ready to connect relays, lights, and motion sensors. Of course, you have always had the freedom to write an application, read multiple pages of documentation, and take time to learn new programming languages, write pages of code, and then debug them to make it all work together. Alternatively, you can reduce the time you spend preparing for your project, because Cayenne helps to get your project up and running in a fraction of the time, and you can build your automation projects in minutes.

With Cayenne, myDevices makes all this possible, because they created Cayenne for makers and developers eager to build and prototype amazing IoT projects with their RBPi, as quickly as possible. Users get a free Cayenne account, which allows them to create unlimited number of projects. There is also a full-fledged IoT maker support capability that allows remote control of sensors, actuators, motors, and GPIO boards.

On the free account, you can also store unlimited amount of data that the hardware components collect including triggers and alerts, providing all the tools necessary for automation. That allows you to set up custom dashboards and threshold alerts capable of highlighting your projects with fully customizable drag-n-drop widgets.

According to myDevices, Cayenne is the first of its kind of builder software that empowers developers to use its drag-n-drop features for creating quick IoT projects and host their connected device projects. Cayenne allows remote control of hardware, displays sensor data, store data, analyze it, and do several other useful things.

In the Cayenne platform, users can find several major components, such as:

The main Application – useful for setting up and controlling IoT projects with drag-n-drop widgets.
The Online Dashboard – set this up through a browser to control your IoT projects.
The Cloud – useful for storing devices, user and sensor data, actions, triggers, and alerts. Additionally, it is also responsible for data processing and analysis.
The Agent – useful for communicating with the server, hardware, and agent for the implementation of outgoing and incoming alerts, triggers, actions, and commands
Whenever you press a button from the online dashboard or the Cayenne app on your mobile, the command travels to the Cayenne Cloud for processing and travelling to your hardware. The same process takes place in the reverse direction as well. Cayenne offers users plenty of features.

You can connect to your IoT through Ethernet, Wi-Fi, or mobile apps. It is possible to discover and setup your RBPi on a network via Ethernet or Wi-Fi. Dashboards are customizable and widgets are drag-n-drop. It is possible to remotely access your RBPi, shut it down, or reboot it. Users can add sensors, actuators, and control extensions connected to the RBPi, and many more.

EEG Controlling Music through Raspberry Pi

Imagine controlling Pandora with your brainwaves. Whenever a song comes up that you do not enjoy, make it switch to the next one. All you need is an EEG sensor, a pianobar and a single board computer such as the RBPi or Raspberry Pi. Once you train the RBPi to differentiate the bad from good music, you are good to go.

You need to train the Bayesian classifier to recognize good music from the bad. However, basic machine learning techniques do not always turn out very good. Therefore, with this time-series data, you can use it in sequences to reduce false positives.

Using an EEG headset to control songs you dislike is great, especially when you are moving around or doing something away from your computer. You simply slip on the Mindwave Mobile headset from the Brainwave Starter Kit and use the included app to see your brainwaves change in real-time on your mobile. You can monitor your levels of relaxation and attention while watching the response of your brain when you are listening to your favorite music. The Brainwave store has multiple brain training games and educational apps, which are classified according to age and personal interests.

Data from the Mindwave Mobile headset travels via Bluetooth to communicate wirelessly with the RBPi. Using the free developer tools available online from NeuroSky, you can write your own programs to interact with the Mindwave Mobile headset. On the Mindwave Mobile, you can see the EEG power spectrums of alpha, beta and other waves from your brain. With the NeuroSky eSense, you can even sense eye blinks and differentiate between attention and meditation states.

When using the EEG headset with the RBPi and a Bluetooth module, you can record data of some labeled songs that you like and some that do not appeal to you. From the Mindwave headset, the RBPi will get data on waves from your brain such as the delta, theta, low alpha, high alpha, low beta, high beta, mid gamma and high gamma. It will also get an approximation of your meditation and attention levels using FFT or Fast Fourier Transform. Additionally, the headset also provides a skin contact signal level.

It is difficult to make out much from the brainwaves unless you have received adequate training to do so. Machine learning helps here, as you can use software to differentiate good music from the bad. The basic principle is to use Bayesian Estimation to construct two multivariate Gaussian models, one based on good music and the other representing bad ones.

Initially, the algorithm may only be accurate about 70-percent of the time. Although this is rather unreliable, you can use the temporal data and wait for say, four simultaneous estimates before you decide to skip the song. The result is a way to control the songs played, using only your brainwaves.

Pianobar on the RBPi controls the music stream to Pandora. You start pianobar and then start the EEG program using python. It will tell you if the headset is placed properly on your head since it gives a low signal warning. Once it detects a song, it will skip it once it detects four bad signals in a row.

Monitor Your Solar System with a Raspberry Pi

Most photovoltaic systems contain parts such as the solar modules (panels) to provide the electrical power, a battery charger for converting the panel output to the battery voltage, a battery pack to store energy during the day and provide it during the night time, an inverter to transform the battery voltage to the proper line voltage for operating home appliances and an line source selector to switch between the solar and grid power.

When the sun is shining during the daytime, the solar photovoltaic cells convert the sunlight falling on them into electricity. Although the efficiency of the conversion may be only about 17%, solar power can easily reach 1KW/m2 and suitable panels can produce 5000 Watts in these conditions.

Solar panels typically produce a high voltage, 120V DC being a common figure. The battery charger has to convert this to match the battery voltage, generally 48V DC. Solar light power charges the batteries continuously during the daytime; therefore, the charger has to keep tracking the maximum power point to optimize the yield of the system. As the charger has to charge the battery also, this device forms the most elaborate part of the system.

With the above arrangement, the solar panels charge the battery during the daytime and the battery discharges during the night. The size of the battery depends on one day of consumption plus some extra to tide over an overcast day. That also decides the size of the solar panel. Batteries are essentially heavy and the lead-acid types generally have a lifespan of about 7 years.

The batteries feed the inverter, which converts the 48V DC into the line voltage – usually 230V AC or 110V AC. With a 5KW continuous rating, inverters can essentially run almost all household appliances such as the clothes dryer, the washing machine, the dishwasher and the electric kitchen oven. When the inverter is supplying a large load, the battery current may climb up to 200A.

Multiple sensors measure the solar field power from and temperature of the solar modules divided into arrays. The information comes to a PV panel via a CAN bus, which unites all the sensors. The PV panel also acts like a gateway between the CAN bus and a single board computer.

The tiny, versatile single board computer, the Raspberry Pi or RBPi is suitable for gathering data from the PV panel and storing them in a database. On the RBPi is a web server connected to the home Ethernet network.

Another set of sensors monitor the battery voltage, current and temperature. These are also on CAN bus and the information collects on a PV battery monitor board. A Wi-Fi module on the board acts as a gateway between the CAN bus and the Ethernet.

The boards and modules of the monitoring subsystem do not provide any interface with the user, except for a few activity modules. The system is meant for being supervised and controlled remotely. This is possible with a Web User Interface or an Android application.

Latest Touch Display for the Raspberry Pi

Those who were on the lookout for a proper touch display for their single board computer, the Raspberry Pi or RBPi can now rest easy. The official RBPi touch display is on sale at several stores and others will be receiving stock very soon. Users of RBPi models such as Rev 2.1, B+, A+ and Pi 2 can now use the simple embeddable display, instead of having to hook it up to a TV or a monitor. Watch the You-Tube video demonstration for a better understanding.

The new official touch display for the RBPi is a 7” touchscreen LCD. A conversion board interlinks the display module with the LCD and plugs into the RBPi through the display connector. Although the ribbon cable is the same as that used by the camera, the two do not work interchangeably. Therefore, identify the display connector first, before plugging in the ribbon cable from the display.

You can power up the display in one of three ways: using a separate power supply, using a USB link or by using GPIO jumpers. When using a separate power supply, you need a separate USB power supply with a micro-USB connector cable. The power supply must have a rating of at least 500mA and requires plugging in to the display board at PWR IN.

It is also possible to power the RBPi through the display board. For this, use an official RBPi power supply of rating 2A and plug it into the display board at PWR IN. Use another standard micro-USB connector cable from the PWR OUT connector and plug it into the RBPi power in point.

Powering the display from the RBPi GPIO requires using two jumpers – one from the 5V and the other from the GND pins of the GPIO.

After plugging in the ribbon cable and making one of the above power connections between the RBPi and the display, using the display requires updating and upgrading the OS on the RBPi. On rebooting, the OS automatically identifies the new display and starts to use it as its default display rather than the HDMI. To allow the HDMI display to stay on as default, the config.txt file must contain the line:

display_default_lcd=0

For further setup steps, follow these instructions.

The RBPi display comes with an integrated 10-point touchscreen. The driver for the touchscreen is capable of outputting both full multi-touch events and standard mouse events. Therefore, it is capable of working with ‘X’ – the display system of Linux, although X was never designed to work with a touchscreen.

For finger touch operations in cross-platform applications, the Python GUI development system Kivy is a great help. Although designed to work with touchscreen devices on tablets and phones, Kivy works fine with RBPi.

The 7” touchscreen display for the RBPi is of industrial quality from Inelco Hunter and boasts of an RGB display with a resolution of 800×480 at 60fps. It displays images with 24-bit color and a 70-degree viewing angle. The metal backed display has mounting holes for the RBPi and comes with an FT5406 10-point capacitive touchscreen.

The GoPiGo Robot Kit for the Raspberry Pi

Making a robot work with the tiny computer Raspberry Pi or RBPi has never been so easy. If you use the RBPi robot kit GoPiGo, all you will need is a small screwdriver with a Phillips head. The GoPiGo kit comes in a box that contains a battery box for eight or 6 AA batteries, two bags of hardware, two bags of acrylic parts, two motors, the GoPiGo board and a pair of wheels. For assembling all this into a working robot, follow these step-by-step instructions.

You start with the biggest acrylic part in the kit, the body plate or the chassis of the GoPiGo. Lay the plate on the GoPiGo circuit board and align the two holes with those on the circuit board. Place two short hex spacers in the holes below the body plate to make sure of which way is the upper side.

Next, you must attach the motors to the chassis. Use the four acrylic Ts in the kit for attaching two motors. Do not over tighten the bolts while attaching the motors, as this may crack the acrylic.

With the motors in place, it is time to attach the two encoders, one for each motor. These encoders fit on the inside of the motors and poke through the acrylic chassis of the GoPiGo. Encoders are an important part, providing feedback on speed and direction of rotation of the motor. If the encoders will not stay on, use blue ticky tacky to make them stay.

Now it is time to attach the GoPiGo board to the chassis. Place the GoPiGo board on the spacers and line its holes with the holes in the board before holding them together with screws. Two hex supports on the back of the GoPiGo board allow you to attach the castor wheel.

That brings us to attaching the wheels to the GoPiGo. You must do this gently, backing the wheels so they do not touch or rub against the screws. The battery box comes next, to be placed as far back on the chassis as possible. This gives it extra space and prevents the box from hitting the SD card on the RBPi.

This completes the mechanical assembly of the GoPiGo robot and only the RBPi remains to be attached. Locate the black plastic female connector on the GoPiGo and slide the GPIO pins of the RBPi into this connector. The RBPi remains protected by a protected plate or a canopy that has to be attached by screwing it on to the chassis.

Make the electrical connections according to the instructions. Be careful while flashing the GoPiGo hardware and leave the motors unconnected during the flashing. After connecting the GoPiGo for the first time, if you find any motor running backwards, simply reverse its connector.

GoPiGo comes with an ATMega 328 micro-controller, operating on 7-12VDC. SN7544 ICs handle the motor control part, which has two optical encoders using 18 pulse counts per rotation and a wheel diameter of 65 mm. External interfaces include single ports of I2C, Serial, analog and digital/PWM. The idling current consumed is about 3-500 mA, and full load current is 800 mA – 2A with both the motors, the servo and the camera running with the RBPi model B+.

A Raspberry Pi HAT with 16-Channel PWM Servo

DC servo motors are a few of the things that the single board computer, Raspberry Pi or RBPi, finds uncomfortable. The reason being the specific and repetitive timing pulses these motors require for setting their position, which the RBPi is unable to provide in the absence of a real time clock. Although the Linux kernel can do the job, it leaves the RBPi rather over taxed.

A HAT or Hardware Attached on Top board eases the situation. It takes care of all the timing requirements, runs and controls 16 Servos, and is capable of delivering pulse width modulated or PWM signals up to 1.6 KHz using 12-bit precision. Additionally, all this is completely free running that leaves the RBPi to handle everything else.

The 16-Channel 12-bit PWM/Servo HAT from Adafruit can drive 16 servos simultaneously or output PWM signals. It communicates with the RBPi through only two pins using the I2C protocol. Additional RBPi processing overhead is not required for the on-board PWM controller on the HAT board to drive all the 16 channels at a time. Moreover, you can stack more HAT boards – up to 62 of them and control 992 servos – all with only the same two pins.

Adafruit offers a Python library that you can use to immediately set up and run the servos to make your robotic system come to life. When you need to run several servos, this HAT and the Python library to go with it are the simplest and perfect solution.

The HAT board requires two levels of DC voltages. The 3V3 DC comes from the RBPi to power the PWM chip and to decide the logic levels for the PWM signals and the I2C signals. The voltage is available as soon as you plug in the RBPi – shown by the PWR or the red LED on the RBPi.

The other voltage is required for the servos, for which you need to supply 5-6V DC. Usually, most servos will be happy with only 5V, and will work a little more strongly if you give them 6V. You can connect this supply via the DC jack or the blue terminals on the HAT board. A reverse-polarity diode protects the board in case you have the wires connected in reverse. However, do not use both the DC jack and the terminal block at the same time.

Keep in mind that servos need a lot of current from the 6V DC supply. Even if you are using micro servos, they will draw several hundred mA when moving. Larger servos will need more power and you should have provision of about 2A for up to four servos. That means it is not recommended drawing this power from the 5V supply of the RBPi, as it could cause your RBPi to behave erratically. Keeping the servo power supply and the RBPi power supply totally separate gives good results.

On the RBPi, there is a place for soldering a through-hole capacitor. It is a good idea to use one if you are driving many servos. Switching motors generate dips and spikes on the power lines and these can upset the RBPi. A capacitor takes care of the sudden variations – use n*100µF, where n is the number of servos.