Tag Archives: RBPi

Connecting To a Raspberry Pi via an Ethernet Cable

You can use your Raspberry Pi or RBPi single board computer in different ways. Sometimes you may have a keyboard, mouse, and display to connect to your RBPi to use it as a regular computer. At other times, you may prefer to communicate with it through another computer such as a desktop or a laptop. Your method of communication may also vary. For example, if your RBPi is at a distance, you may have to connect to it over the Internet via Wi-Fi.

However, Wi-Fi may be an unreliable and a slow way of connecting to your RBPi if you are communicating with it often using SSH or a remote desktop application. Rather, a faster method would be to use a direct Ethernet connection, which would also be a lot more stable. Since you are connecting to your RBPi directly with an Ethernet cable, you are actually bypassing your local network and not sharing the bandwidth with other computers. Moreover, a direct Ethernet connection allows you to connect to your RBPi even when you are away from your home network, experiencing slow connectivity and or network time outs.

For this, all you need is an Ethernet cable. You will need to assign a static IP address to the Ethernet port of the RBPi. The static IP address will depend on the IP address of the computer and its Ethernet adapter that you will be using to connect to the RBPi. The process of assigning a static IP address is straightforward and should be easy for any OS.

If you are using a Windows computer to connect to your RBPi, open up the Network Connections window from the task bar or by accessing the Control Panel. Now look at the Properties of the Ethernet connection under Internet Protocol Version 4. This will show an IP address of the form 10.0.0.6 or similar.

In some cases, the internet connection may also be set for automatic assignment. Here, you need to connect your RBPi to the computer via an Ethernet cable first. Now access the Windows command prompt and use the ipconfig command to see the address your computer has automatically assigned to the connected RBPi. Next, you will also need to note the default gateway IP, which is the local IP address of your network router.

Apart from the above, you will also need to find out the IP addresses of the domain name servers used by your RBPi for finding websites on the Internet. This you can find out by executing the command cat /etc/resolv.conf on the command prompt of your RBPi.

Now you must edit the /etc/dhcpcd.conf file on your RBPi and modify the three IP addresses in the file. Change the last number of the IP address of your computer’s Ethernet adapter, to any other number between 0 and 255. This becomes the static IP address you will use to SSH or connect remotely to your RBPi.

The static router is the IP address of the default gateway IP you noted earlier and the static domain name servers are the IPs you noted from the /etc/resolv.conf. Save the dhcpcd.conf file and reboot your RBPi. Enjoy your connection.

Which Raspberry Pi Should I Use?

Which Raspberry Pi or RBPi you will use is getting more and more difficult to answer as the family keeps growing. It was simple and straightforward when the RBPi first launched – there was only one model. Since then, with four major models to choose from, things are more complicated. However, this versatile beast comes in different specifications and you should select the one most fitting your requirements. Among the models available, here is a summary to help you decide:

RBPi Zero

This is the latest addition to the family. Although it is ultra-cheap, the RBPi Zero is definitely a fully functional single board computer. Compared to the first model of family, the processor used in the RBPi Zero is more than 40% faster. However, purchasing this variant compels you to make major compromises.

To start with, you will need adapters to use the mini HDMI and micro USB ports on the device. As there is no on-board Ethernet port, you need to use the single USB port. Although you can expand its functionality by adding a powered USB hub, the additions begin to detract from the major selling point of the Zero – its tiny footprint.

If the application does not require a fair amount of connectivity, is low-powered and for single-use, you may consider using the RBPi Zero.

RBPi Model A+

Although a full-sized version, this model also lacks the Ethernet port and has only one USB port. Moreover, it has only 256GB RAM that goes with the 700MHz processor. The price and lack of power makes it difficult to recommend the RBPi Model A+ for any application other than for specific ones.

RBPi Model B+

If performance is not a criteria and price is the only consideration, then the RBPi Model B is hard to beat. The model offers good connectivity as it has on-board Ethernet, four USB ports and a full sized HDMI connector. That makes the RBPi Model B+ more versatile than either the Model A+ or the RBPi Zero.

You can use it for any project that requires good connectivity, less than top-notch performance, and low power.

RBPi Model 2

This is the top-of-the-line model in the family and a surprisingly capable beast. With an updated chipset, a quad-core processor and 1GB RAM, the RBPi Model 2 makes a major difference in the large variety of Single Board Computers available in the market.

You can use the RBPi Model 2 as a media server for your network or use it for tasks of more intensive nature such as running a home surveillance system or playing games. It also allows you to explore platforms other than Linux – you can run the IoT version of Windows 10.

Even though the total power consumed by the RBPi Model 2 is below 1W, it uses significantly more power as compared to its predecessors. For example, RBPi Model 2 consumes more than 33% power drawn in by the RBPi Model B+ and five times more power than what the RBPi Zero consumes. Use the RBPi Model 2 for anything where you need good performance.

Check our other guides for information on Model 3.

Controlling RGB LEDs via the Raspberry Pi

Digital gates are great for switching LEDs on or off. Micro-controllers are even better and so are single board computers. That is because they contain several gates to control the LEDs. To top it all, you can program single board computers such as the RBPi or Raspberry Pi to control several LEDs individually to run at different on/off cycles. Additionally, multiple color LEDs are available, such as RGB LEDs, with which you can generate any combination of the basic red, green and blue colors.

Although the GPIO pins of the RBPi can switch on an LED, the pins cannot supply beyond their limit. Therefore, when driving LEDs from the GPIO pins, a current limiting resistor is necessary in series with the LED, to prevent the IO pin from being damaged. The resistance value will depend on how much current the IO pin can source or sink, and the supply voltage of the RBPi or LED.

The RBPi has a 40-pin GPIO header among which, you can control several pins through software. The most common use of external circuits and LEDs with GPIO pins is to indicate status visually. For example, you may be controlling a remote circuit with software, and an LED nearby can indicate its status. The LED lights up to indicate the remote circuit is powered.

It is a good thing that human eyes have something called the persistence of vision. When we see something, its image persists in our eyes for a brief time. Therefore, we can see flashing lights only when they are flashing relatively slowly. Beyond a certain speed, our eyes cannot make out the individual flashes and the flashing light looks as if it is steadily lit. Using a technique called PWM or Pulse-Width Modulation, and controlling the on time of a GPIO pin through software, we can make an RBPi drive an LED such that it looks as if the LED is breathing. Doing the same with an RGB LED, the RBPi can cycle the lights to produce any color in the rainbow.

You can build a simple RGB LED board with a single bright RGB LED, three current limiting resisters and a four-pin connector on a prototype PCB. RGB LEDs have four pins and come in two configurations, common cathode and common anode. In the common cathode configuration, the package combines the cathodes of all the three LEDs into a single pin with the anodes individually available. For the common anode configuration, all the three anodes are combined into one pin, while the cathodes are individually accessible.

To drive an RGB LED you will need to connect its individual anodes or cathodes to three GPIO pins through current limiting resistors. If you use a common anode RGB LED, you will have to connect its common anode to a supply voltage. For a common cathode RGB LED, you will need to ground its common cathode. Now, you can switch on an individual LED of the combination by switching on the corresponding IO pin. See this tutorial for writing simple Python scripts for controlling the LEDs via the RBPi.

The Raspberry Pi Sense HAT

If you are targeting the Astro Pi mission, it makes sense to get the Sense HAT as an add-on board for your tiny single board computer, the Raspberry Pi or the RBPi. With a fantastic RGB LED matrix, not only is the board beautiful to look at, but it also comes with a plethora of sensors on-board. That makes it useful for the applications in the International Space Station where it is headed to in December 2015.

The Sense HAT looks like an ordinary board with an 8×8 RGB LED matrix on it. You can use it to display graphical information in color. For example, using the display you can indicate geomagnetic North. Apart from the matrix, the Sense HAT also has a five-button joystick, which allows the user to interact with the programs the RBPi is running. That includes playing games such as Tetris, Snake or Pong on the RBPi.

The Sense HAT includes several sensors such as a gyroscope, accelerometer and magnetometer. It also has sensors to read ambient temperature, barometric pressure and humidity. A Python software library that comes with the board provides the user with an easy access to everything on the Sense HAT.

Using the software library, you can conduct a huge range of projects for the Sense HAT and RBPi combination. For instance, if you are traveling with the combination, it can measure and show your speed. At the same time, it can tell you the direction it is facing, how humid is the atmosphere nearby and even the temperature of your surroundings.

The Sense HAT kit comes with the fully assembled Sense HAT board, four mounting posts and eight screws so you can mount the HAT on your RBPi securely. Mounting the board on the RBPi is simple. First, fit the four mounting posts with four screws on the board. Now, align the 40-pin connector on the HAT to fit on to the GPIO connector of the RBPi and push in firmly. The four posts will align with the mounting holes of the RBPi. Secure those with the remaining four screws and you are done.

To install the software, visit the AstroPi and the Swag websites. Here, you can find out of the world projects, a host of ideas and instructions related to the RBPi and the Sense HAT, fit for the applications on the ISS or the International Space Station.

Technical specifications of the Sense HAT are impressive, considering the inexpensive setup. The Gyroscope measures angular rate at +/- 245/500/2000 dps. The Accelerometer measures linear acceleration at +/- 2/4/8/16 g. Temperature accuracy measured in the 0-65°C range is +/- 2°C. The Relative Humidity sensor has an accuracy of +/- 4.5% within the 20-80%RH range, with a temperature accuracy of +/- 0.5°C in the 15-40°C range.

You must take care while measuring temperature with the Sense HAT. When the LEDs are lit for some time, they, together with the board, tend to get warm. That heats up the air nearby and the measurement may not reflect the ambient temperature accurately.

Create a Baby Monitor with the Raspberry Pi

The arrival of a baby nearly always alters the entire timetable for all the members of the family, whether willingly or otherwise. For the parents, if they are first timers, the joy of seeing the tiny human is never-ending – they want to see the baby even if they are away from home. That is where a baby monitor comes in and what better to use for the project other than the versatile single board computer, the Raspberry Pi or RBPi.

As a simple, cheap, and low power computer, the RBPi works as a perfect fit for a baby monitor that has a motion detector and a simple web browser interface. That allows you to see the little one on your phone or laptop any time you want.

You will need the entire RBPi kit for this project. The kit will have the RBPi, its SD Card, the USB charger, and the micro USB cable. Additionally, you will need a USB webcam, an Ethernet cable, and a Wi-Fi dongle or an Ethernet power line adapter. Although not part of the project, you will also need a laptop or a desktop to prepare the SD Card for the RBPi. To interact with the RBPi, you will also need a keyboard, mouse, and a monitor.

From the official site of the Raspberry Pi, download the latest Raspbian image on your laptop. Now transfer the image to your SD card, making sure you have backed up anything important on the SD card beforehand. Writing an image wipes off whatever you have on your SD card, so be careful. If this is complicated for you, pre-pared SD cards are also available. Insert the SD card into the slot on your RBPi, plug in the keyboard, mouse, monitor, and the Ethernet adapter and power up the RBPi.

If you do not have a keyboard, mouse, and monitor for your RBPi, you can still connect to it using your laptop. If you are using Linux or Mac on your laptop, connect using SSH. For Windows, you can use Putty. Once you have powered on the RBPi, there will be only a few LEDs blinking, but nothing else. That is why it makes such a good baby monitor – it is silent.

To connect to the RBPi, you will need to know its IP address. As the RBPi is connected to the Ethernet adapter, your router will be the best place to look – search in the connected devices, and make a note of the IP address. Now, to connect via SSH, issue the command from your laptop: ssh pi@xxx.xxx.x.x, where the xx denote the IP address you noted down from the router. When prompted for a password, enter raspberry, as this is the default.

Update and upgrade your OS to ensure you have all the updates and security patches. Now, install motion, as this is the package to allow you to monitor the baby with the webcam. Configure motion to operate in daemon mode with a low frame rate, and start it working with the command: sudo service motion start. Now browse to the webcam from your laptop with: http://xxx.xxx.x.x:8081.

Using OpenHAB with a Raspberry Pi

Nowadays it is common to have smart home products that you can remotely command to control, adjust, and to switch on and off. The single board computer, Raspberry Pi or RBPi is suitable for building a touchscreen command center to interface with such smart products and to provide a suitable interface for control and task scheduling. As an introduction, the project will consist of a Wi-Fi enabled RGB LED strip. It will interface with an RBPi running OpenHAB. This will allow wireless control to switch the LED strip on or off from a smartphone or any other computer on the network.

With OpenHAB, you can interface with over 150 different existing smart home products. Moreover, OpenHAB is very flexible, is open source, and is free to use. Although you can use OpenHAB on an RBPi, it can easily run on any platform – Linux, OS X, or Windows. That means the same setup can be run from any old laptop or desktop you may have lying around.

For this project, the main components you will need are an RBPi and its touchscreen. An RBPi2 is recommended and you can use the 7-inch Raspberry Pi Foundation touchscreen. Some of the additional things you will need are a microSD card, a USB Wi-Fi dongle, a power supply for the RBPi, the NeoPixel LED strip starter pack, a logic level shifter, an ADAfruit HUZZAM ESP8266, and some hookup wire.

To begin, assemble the screen to the RBPi. This can be somewhat tricky if you do not have instructions. There will be two flat ribbon cables, a large one for the display, and a smaller one for the touchscreen. The large cable from the display connects to the display controller board, and the smaller cable from the display controller board connects to the display. Once this is done, you can screw the display controller board with the RBPi on its back on to the standoffs on the back of the screen. The ribbon cable from the controller board connects to the display connector on the RBPi. Power to the display comes from the GPIO pins on the RBPi, for which you need to connect the 5 V and the GND pins via two jumper wires of red and black color, respectively.

Flash the microSD card with the latest build of Raspbian from the Raspberry Pi website and boot up the RBPi with it. You can now connect your keyboard, mouse, and the Wi-Fi adapter. Configure the RBPi to connect to your Wi-Fi network and get the touchscreen to work. For this, you may need to update and upgrade your OS.

The next step is to install the home automation control software, OpenHAB, and its add-ons – follow the instructions here. Next, solder the logic level converter between the ESP8266 and the NeoPixel LED strip. This is necessary, as the strip works on 5 V, whereas its controller, the ESP8266 works on 3.3 V. Make sure the logic level converter is connected the right way. After this, you will need to flash the ESP8266 with the Arduino IDE.

Now, you can download and install the OpenHAB app on to your phone and set it up to control the RBPi on its IP address.

WD PiDrive for the Raspberry Pi

Most users of the RBPi (Raspberry Pi) prefer to use the single board computer for small and simple tasks suited for their low powered hardware. It is also possible for RBPi users to upgrade their hardware for augmenting functions that need more power. For example, users looking for additional memory space can use traditional SD Cards and USB drives. Now, Western Digital is upping the ante with their PiDrive, a one terabyte hard drive, compatible to the RBPi.

PiDrive is somewhat different from the average storage drive commonly seen in desktops and laptops. In place of the usual SATA interface that comes with a typical hard drive, PiDrive employs a USB 3.0 header, modified for the purpose. That means you can connect the drive to the USB port of the RBPi. However, PiDrive goes a step further. You can connect it to the power port on your SBC. The advantage is that you can now power both the RBPi and the PiDrive from the same source, using a single cable.

Since the SBC RBPi cannot boot from any source other than its microSD card, the WD PiDrive also has a built in 4GB microSD card. You can place an operating system on the card, so that the RBPi can boot from it. WD PiDrive is compatible to both RBPi Model B+ and RBPi 2 Model B.

PiDrive consists of a WD Passport drive with a built-in USB controller in place of the usual SATA interface and comes without any plastic enclosure. Earlier also, others have already toyed with the idea of an RBPi that can boot from and store information to a hoard drive. However, most such ventures needed a powered USB hub to transfer power to the drive. WD has removed the need for the USB hub, making the newly equipped RBPi much neater.

The 1TB PiDrive is available in the form of a kit. Along with the 2.5-inch USB hard disk drive, the kit consists of a 5V power adapter, a USB Micro B to Type A power cord, a WD PiDrive cable and a Class4 4GB microSD card with an SD adapter. However, the star attraction of the kit is the WD PiDrive cable. This specially designed cable supplies the necessary power to the PiDrive and the RBPi at the same time. The included power adapter has adequate capacity to handle the power required by both the SBC and the drive. WD provides a Quick Install Guide for making all the connections easily and correctly.

The microSD card with the PiDrive ships blank and you can install another operating system on it safely, without compromising the existing SD card of your RBPi. That means you can test another OS without losing the files or programs on the original SD card.

To use the WD PiDrive with the RBPi for the first time, you will need to partition it, format the partitions and mount them. You can also store your OS on the drive. For that, you must let the boot loader remain on the SD card, writing only the OS on the PiDrive. The WD Labs Community offers detailed instructions for doing this.

Volumio: Control Your Hi-Fi through a Raspberry Pi

Traditionally, amplifiers connect to loudspeakers through wires. The wires carry the electric currents that make the loudspeakers work to produce sound. So far, wires were also necessary to feed amplifiers from different sources such as CD players, TV sets and others. By placing amplifiers within the speaker enclosure, part of the ugly wiring was taken care, but the wires from the source persisted until wireless methods were discovered.

Introduction of the Walkman and other portable players changed the music scenario forever, bringing it out of the living room and allowing people to carry their music with them. However, there was a limit to the number of songs one could carry on their person. The advent of the smartphones and the Internet opened another door. People could stream music over the net, leaving their collection at home. This was the age of iTunes, Spotify and Beats Music, facilitating listening to music wherever you may be.

Most often, these new methods prove expensive for those on a budget, and they are forced to bypass the newer ways of consuming music. An RBPi (Raspberry Pi) is a great help in these cases, simply because the single board computer is affordable, flexible and of a convenient size. Its flexibility makes it a perfect fit for use as a home audio solution and you can control your music wirelessly without having to invest in expensive high-fidelity stuff.

An RBPi gives you many modes of selecting songs to play and the manner in which they are played. For this, the RBPi uses a specially tailored Operating System by the name of Volumio. The major attraction is the nice and simple cross-platform web interface through which you can control music.

The RBPi sits as a controller just in front of the amplifier. It can pick up songs from a USB stick plugged into one of the USB sockets, select it from your local home NAS or take your picking from Web Radio. For the last part, you will need a Wi-Fi dongle to connect the RBPi to the Internet.

Volumio is easy to set up, as not much of advanced functions or graphics are to be handled. Simply download the Volumio disk image, transfer it to your microSD card and use it to boot up the RBPi. You will not require a keyboard, mouse or monitor to set up the software, as the entire configuration is possible through the web interface of Volumio.

Use your computer to connect to Volumio. You can find it by connecting your computer to the same network where you have your RBPi plugged in. You may also use Volumio over a wireless network, for which, you will have to first connect to the RBPi via Ethernet to configure its settings for use with a Wi-Fi dongle. This also allows you to control the software with the browser on your smartphone – simply type in the URL ‘http://volumio.local’ in your browser.

Using the RBPi makes it simple to select songs and set up other parameters for playing them on your home Hi-Fi system. As an advanced arrangement, this is affordable and one can easily modify it to suit specific needs.

Build a Humanoid Robot from Raspberry Pi

Raspberry Pi or RBPi is the ubiquitous low-cost, credit card sized single board computer with huge potential starting from teaching youngsters computer programming to driving robots on Mars. However, when Tyler Spadgenske tried his hands on RBPi, he used the SBC to create Andy – a completely open-source humanoid robot.

Tyler has tried to make Andy a connected robot. Andy can connect to humans through speech, using language as humans do – for answering questions. With access to the Internet, he (Tyler assures Andy is male) can also talk to client programs over the Web. With ability to connect via Bluetooth, Andy communicates with other robots such as the Mindstorms NXT.

Using a bipedal mechanism that offers him mobility, Andy can do additional tasks such as moving stuff. Of course, Andy has his limitations, but then, he can collaborate with other robots to get those things done, which he cannot. Tyler has given Andy only speech as the user interface, since he feels a humanoid should have no other. However, that does not limit Andy from interfacing with other computers over the Internet, because basically, he is a computer himself.

Initially Tyler was using Robosapien for Andy’s bipedal movement, but that did not work out satisfactorily. He is using a new bipedal system using SolidWorks. Later, Tyler plans to add a torso, a head and arms for Andy, again using SolidWorks and 3D printing.

Starting up Andy is very simple – flip the switch on his back to the on position. Andy has LiPo batteries rated for 11.1V, 1.3A and 1300mAH. These power his motors through the L298 motor drivers, which the RBPi drives. As soon as the RBPi receives power, which is regulated with a UBEC, it starts executing Andy’s software. This begins with some configuration checks such as for starting the server and running some modes. Then Andy settles down and prepares to listen to his microphones.

Now, Andy is up and running as a state machine. He will listen to commands from either his microphones or his server – first converting any command received from either to text and then executing it.

After converting the command to text form, Andy interprets it by comparing it to the command set in his repertoire. That gives him the correct function he must execute for a specific command. For example, for a shutdown command, Andy initiates a complete sequential software and hardware shutdown, ultimately switching himself off. For any other command, however, Andy executes it and then goes back to wait for commands from his microphone or server.

Andy’s brain, the RBPi, controls almost everything for him, including speech recognition and motor control to Andy’s software. Andy has three L298 motor drivers, with each capable of controlling and driving two motors each. Therefore, Andy is capable of driving a total of six motors. As the RBPi had only a limited GPIO pins, Tyler had to expand them using an MCP23017 chip.

Tyler plans to give Andy 10 degrees of freedom with the new SolidWorks hardware. His new features will include monitoring the battery voltage, a power on LED, an LED output with five segments and ten servos – six for the arms and four for the legs.

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.