Tag Archives: Raspberry Pi Accessories

Thin Clients with the Raspberry Pi

When deploying a large number of computers at a single location, it is a common practice to employ thin clients. In such cases, several client computers access a powerful central server computer that controls resources such as the hard disk data and Internet access. The logical operating system of the server is isolated from the clients accessing it via a concept known as desktop virtualization.

Implementation of desktop virtualization or VDI follows several conceptual models. One can broadly divide them into two categories depending on whether the operating system executes locally on the client machines or remotely on the server. Therefore, desktop virtualization may not always involve the use of virtual machines.

When the desktop virtualization uses a host-based form, users have to view and interact with their desktops over a network. For this, they must use a remote display protocol. As all processing takes place at the data center housing the server, client devices can be tablets, smartphones, zero clients and thin clients.

Citrix offers a suite of products known as Citrix Receiver with which client devices can easily connect to different desktop virtualization services from Citrix. They offer several types of client platforms and form factors. Included in these are embedded operating systems. zero clients, thin clients, Google Chromebook, Linux, Blackberry Playbook, Blackberry, Android, iPhone, iPad, Mac OS X, Windows Mobile and Windows.

For example, using Citrix Receiver technology, users can connect their client devices to XenDesktop and XenApp desktops and applications via the HDX protocol. They can also connect to the Citrix Access Gateway, XenVault secure storage and other Citrix services.

Citrix has since decided that putting a lot of effort into creating special versions of Receiver for one device is inefficient. Therefore, it has decided to work with the Pi Organization for ensuring their Linux Receiver would work with the new architecture of Raspberry Pi Model 2 or RBPi2 and its supported OS images.

With this effort, it is no longer necessary to have hardware-accelerated plugins for the RBPi2. The new HDX Thinwire and XenDesktop/XenApp 7.6 FP3 compatibility codecs work efficiently on the RBPi2. On the other hand, ThinLinx makes a Thin Client & Digital Signage Operating System for the RBPi. Citrix has tested this OS and has confirmed it is capable of handling video with impressive speed.

According to Citrix, their selection of RBPi2 as a thin client for VDI is based on the inherent security feature of the Single Board Computer. The SBC is secure as there is no on-board storage and the SD card of the computer can be removed and stored in a safe place when not in use. An additional factor is the price. RBPi is far cheaper than any other thin client available in the market. Another advantage is in addition to vanilla models, you can also have custom RBPis as thin clients.

That the RBPi is an interesting VDI option also comes from the fact that all dedicated thin clients require the same hidden costs to make them useful. This includes pointing devices, keyboards, Wi-Fi dongles, SD cards, USB hubs and monitoring devices.

A USB Hub with a Raspberry Pi Zero

Computers available today come with only one or two USB sockets. With the multitude of USB or Universal Serial Bus devices we use today, it is easy to run out of sockets. For example, you may have to connect your mouse, keyboard, printer, webcam and microphone, all operating on USB technology, to your computer. With only two ports available, it is obviously a difficult task.

However, there is an easy solution. You can use an inexpensive hub. According to the USB standard, which also covers USB hubs, they can support up to 127 devices. Typically, a USB hub has four ports, but some models can have more. Operation of a hub is plug-n-play. You plug the hub into your computer and plug your devices, including other hubs, into its ports. Chaining hubs allows you to build up dozens of available USB ports on your computer.

USB devices can use their own power supply or they can draw power from the computer they are connected. Devices that draw power from the host computer are mostly low power devices such as mice and digital cameras. According to the USB standards, a USB 2.0 port can power devices drawing a maximum of 500 mA and a USB 3.0 port allows devices to draw up to 900 mA maximum.

Self-powered devices connecting via the USB port do not need to draw power from the host computer. For example, your computer does not need to supply power to printers and scanners connected to it. For connecting many unpowered devices to your computer, you will need a hub that has its own power supply, so that the devices do not load the computer’s supply. Such hubs have their own power supply that supplies power to the bus.

If you have the single board computer, the Raspberry Pi or RBPi, especially the Zero version, it is easy to convert it into a USB hub. Frederick had a LogiLink UA0160 USB hub lying around and he used it together with an RBPi Zero to make a powered hub with four ports. He removed the board from its casing and connected the power points to the power points of the RBPi Zero. Since the form factor of the hub board matches that of the RBPi Zero, the entire assembly looks neatly done.

For supplying power to the hub, you will need to connect PP1 of the RBPi Zero to the 5V point of the hub and PP6 of the RBPi Zero to the GND of the hub. Next, you have to connect the USB OTG from the RBPi Zero to the USB port of the hub. For this, use two wires to connect PP22 of the RBPi Zero to the D+ on the hub and PP23 of the RBPi Zero to the D- of the hub.

Use an ohmmeter to check for any shorts between the hub and the RBPi Zero. Additionally, make sure all connections are correct. Use some insulating material such as a plastic board between the hub board and the RBPi Zero, before bundling everything together. If possible, get a case to house the combination and you are done.

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.

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.

Expand the Ports of your Raspberry Pi

The ubiquitous single board computer, the Raspberry Pi, or the RBPi, as it is fondly called by its users, is rich in General Purpose Input Output or GPIO pins. These are lined up on the board in two rows of 13 easily accessible pins, totaling 26 of which 17 are GPIO pins, the others being either power or ground pins.

GPIO pins provide a physical interface between the RBPi and the external world. Speaking plainly, these act as switches that the user can turn on or off as inputs or the RBPi can turn on or off as outputs. GPIO pins are physically arranged along the edge of the RBPi board, next to the yellow output socket for video.

To allow the RBPi to interact with the real world, you can program the pins in amazing ways. For example, there need not be a physical switch to connect inputs. Inputs can come from a signal from a device such as another computer or a sensor. Similarly, outputs can be made to do almost anything, such as sending data or signal to another device such as an LED.

One of the advantages of having an RBPi on a network is you can control devices attached to it from remote places, while collecting data from those devices. Connecting to and controlling physical devices over the Internet is exciting and a powerful feature best done by the RBPi.

However, some applications demand more input and output pins apart from the 17 that are available on the RBPi. That requires the user to expand the GPIO pins and this they can easily do by using the Quick2Wire Port Expander board. The board adds 16 more GPIO pins to the RBPi’s 17, so you can now have 33 GPIO pins with one expander board.

Additionally, you can stack more boards to have more GPIO pins. Each expander board can be preset with a configurable address via DIP switches on-board. Since eight addresses are possible, you can add eight more boards. Each board communicates to the RBPi via the I2C bus.

The Inter Integrated Circuit Communication protocol, called I2C in short, links the micro-controller or microcomputer to other micros or circuits. Another similar protocol is the Serial-Parallel Interface or the SPI. Both protocols are widely used for robotics and hobby electronics projects.

NXP (originally Philips) developed the I2C protocol. This is a very popular protocol used in several equipment including computer motherboards, monitors and TVs. Although a very flexible protocol, I2C is rather limited in its bandwidth.

Freescale (originally Motorola) developed the SPI protocol, which is much faster as compared to I2C. However, it is somewhat more complicated to use and has its own limitations.

Modern micro-controllers now support both protocols. These include the RBPi, Arduino, BeagleBone and BeagleBoard. Therefore, with I2C, you can control a host of devices, treating them as slaves and using two lines SDA and SCL. With SPI, data rates of over 10 MHz are common. Data transfer happens over three lines, one of which carries the clock and the other two communicate between the master and the slave.

A Microscope with the Raspberry Pi

If you require a microscope, you can make one as a proof-of-concept using the RBPi or Raspberry Pi. It is simpler if you have a bagful of LEGO parts to build the structure, but you can also go with Plexiglas construction. Apart from being a useful addition to a science laboratory, making a microscope with the RBPi is a good way of learning computer programming and making things with your hands.

The microscope uses an electronic camera for resolving images and its maximum resolution is about 5µm per pixel. That means you will be able to see and analyze dust, salt, hair and fruit flies – objects mainly in the range of a 20th of a millimeter to 5mm. Since at high resolutions only a small area will be in focus, you may confront distortion and color effects, commonly known as chromatic aberration. That precludes seeing cell culture or blood cells.

If you make the microscope construction from pre-produced parts and do not glue them together, it will allow for subsequent modifications, optimizations and adaptations for special applications, if necessary. You will need an RBPi2 with its SD card, a keyboard, mouse, a monitor or TV. You will also need an electronic camera similar to the WaveShare B, along with a 50 cm cable. For the pre-produced parts, you can refer here. The illumination comes from a 1.6W LED lamp working off a 9V block battery, operated through a small switch.

The construction of the microscope starts with a base plate and a sled tray for placing and holding objects or object glasses. Then there is a tower for holding the plate, which acts as the camera mount. You should be able to move the camera plate and the object sled orthogonal to each other for placing the camera precisely above the object.

There are two ways to focus the camera. You can adjust the length of the columns of the camera tower to get a coarse adjustment – this will adjust the distance between the object and the camera lens. For a better focus, you can then turn the camera objective manually. You may have a worm gear arrangement with a toothed rack (possibly from the LEGO collection) and you can use that to adjust the focus. The gear wheel with toothed rack could guide the object tray and the worm gear could be attached to the camera.

For processing images from the camera, there is a large choice of software to use. You can use very good GUIs available for raspivid (video capture) and raspistill (for still images). Alternatively, you can use raspistill along with Mathematica and its image analysis functions, for processing the images for subsequent analysis.

You can also use PiVision, which offers an option to preview the image to see if the camera is properly focused on the area of interest, before capturing the image as a still photo. During preview, PiVision allows changing the options setting for expanding the preview image to get more details and to re-focus, if necessary. Once you have captured the image, remove the unwanted areas by cropping it.

An SSD Shield for the Raspberry Pi

CSB502SSD is a multifunction storage shield for the Raspberry Pi or RBPi 2, model B. A Rhode Island based startup, Pi2Design has designed the shield and makers of the embedded modules, Cogent Computer Systems have manufactured it. The designers have targeted the shield for a variety of industrial, medical, data storage and embedded applications.

Earlier, Pi2Design had offered the PiDrive SSD expansion card to users with a 128GB mSATA solid-state drive. The CSB502SSD plugs in directly into one of the USB ports of the RBPi and similar to the PiDrive, the CSB502SSD sips power from the RBPi. Therefore, it does not completely deplete the RBPi of power, leaving enough for other peripherals.

For both products, users do not need to buy a powered USB hub for plugging in the standalone SSD – that makes them more portable. The PiDrive is a simple storage-only device and powered via its USB connection to the RBPi. More fully featured and equipped with an onboard DC/DC converter, the CSB502SSD accepts inputs from 8 to 25VDC. The shield comes with a 2A, 12VDC wall-plugin power brick. Although the price does not include the SSD, the CSB502SSD supports up to 1TB models. You also get a microUSB-B to USB-A patch cable, a Wi-Fi antenna and mounting posts with the kit. For an extra amount, you can upgrade the power brick to one of 5A rating.

The CSB502SSD has many features. Its supply powers both itself and the RBPi, including additional features such as a temperature sensor, a real time clock or RTC, a Wi-Fi radio and much more. There is also a four-port USB hub, of which two hubs are free to use – one port is for connecting to SATA and the other for connecting to the Wi-Fi. Communication between the RBPi and the CSB502SSD is via GPIO and the I2C interfaces.

Among the specifications for the CSB502SSD is a single-wire Dallas/Maxim DS18B20 temperature sensor. With this, you can monitor the health of the SSD using the I2C interface and a unique ID of 64-bits for managing assets. The DS1339 RTC from Dallas/Maxim has a programmable alarm powered by a coin cell battery backup – this ensures proper time keeping even when the network access is lacking. The 802.11b/g/n Wi-Fi module from Ogemray, the GWF-3M08, has a Soft-AP Mode support, providing 150Mbps and an on-module IPEX connector for antenna placement.

The mSATA socket can handle up to 1TB SSD storage and because of the Prolific PL2571 SATA II bridge controller, offers great Linux support for USB to SATA. The two USB 2.0 ports can provide up to 1.5A power per port and the 40-pin mating connector can let you plug the shield directly on the RBPi 2.

Onboard the CSB502SSD is a 5V, 10A supply to power all peripherals in addition to the RBPi, which can take up to 2.5A. With the multi-function CSB502SSD shield, users can create a low cost, high-performance networked storage device for embedded systems. With the powerful combination of the RBPi 2 and the CSB502SSD, users can take advantage of the ever-expanding RBPi 2 ecosystem and applications.

The Raspberry Pi Zero Has It Simplified

The release of the new Raspberry Pi Zero or RBPi-Zero has taken the technical world by a storm. This tiny SBC has a 1GHz ARM11 System on Chip, 40 GPIO pins, micro-USB ports, a mini-HDMI port, a micro SD card slot and works with 512MB RAM. The 65×30 mm card has gone on sale with a price tag of a mere $5.00.

The Broadcom BCM2836, clocked to 1GHz, runs Raspbian Linux. Not only is the RBPi-Zero 40 percent faster than the original RBPi Model B, it is also 40 smaller than the B+ model of the RBPi. Although almost identical in size to the RBPi Compute Module, the RBPi-Zero has the real-world ports that the former lacks. However, like the A+ Model, the Zero lacks the Ethernet port.

People looking for the Broadcom chip on the RBPi-Zero will be disappointed at not finding it on either the top or the bottom side of the board. The Raspberry Pi Foundation has adopted the Package-on-Package or PoP manufacturing technology for RBPi-Zero. Therefore, although the Broadcom chip is present on board, the Elpida 512MB RAM chip sits piggyback on top of the Broadcom chip, hiding it from view.

The RBPi-Zero lacks the USB ports, DSI and CSI ports and the audio jack. That is because it is intended for IoT- and embedded-focused hackers. The manufacturers have kept the same 40-pin expansion header other modern RBPi boards possess. Therefore, users can attach available HATs or other expansion boards and adapters. Moreover, the Zero can run any application meant to run on the Model B+.

To use the RBPi-Zero, users will need additional cables. Although most users will have these lying around, others may need to buy them and some more. The best way to start is to go with the Adafruit kit, which is selling two versions in the US market – the Budget Pack and the more expensive Starter Kit. Other vendors offer different combos for accessories.

The Budget Pack of Adafruit comes with a RBPi-Zero board along with a 5V, 1A power supply, USB-A to USB-micro B cable, an 8GB Class 10 SD Card for the OS, a Micro-USB to USB OTG cable, 2×20 Male header strips and a Mini-HDMI to HDMI adapter.

The Starter Kit from Adafruit includes the above and adds more 2×20 male and female headers, USB Console cable and a Wi-Fi dongle. With the USB Console cable, you can put up an alternative display in place of the HDMI.

The Essential Kit from PiHut offers all the items of the Budget Pack of Adafruit (except the SD Card) and includes four rubber feet, one single row of 20-pin GPIO header, one dual row of 40-pin GPIO header, one dual row 40-pin female GPIO header and one dual row 40-pin right-angled GPIO header.

Pimroni offers similar kits to the two above, but offers useful zero-sized PiHATs. These include the Explorer pHAT, the Scroll pHAT and the pHAT DAC. The Explorer HAT is suitable for building a tiny robot as it can drive a motor over an H-bridge, has buffered digital IOs and four analog inputs for low-cost sensors. With the Scroll HAT, you can drive 11×5 LED matrix and the pHAT DAC adds a digital to analog converter to your RBPi-Zero.

The RemotePi Board for the Raspberry Pi

If you have designed a mediacenter system around a Raspberry Pi or RBPi, you would also want to control it remotely, just as commercial mediacenters allow. You can do that with the RemotePi Board. Added atop your RBPi, the RemotePi acts as an intelligent infrared remote controlled power switch and remotely controls to power on/off your mediacenter system.

The RemotePi does not need a special IR remote, as it can learn to decipher the IR code of almost any commercial remote – it works with a standard GPIO IR receiver. This allows you to switch off or on the power safely to the RBPi with any TV remote or a pushbutton. The RemotePi is available in two versions, the 2015 version for fitting on older RBPi models A or B, and the Plus 2015 version for fitting on the newer RBPi models A+, B+ or the 2. Two versions of RemotePi are necessary as the RBPi models differ in their physical dimensions as well as in the position of their connectors and mounting holes. For example, the RBPi models A and B have only two mounting holes, while RBPi models A+, B+ and 2 have four mounting holes on each corner.

For both versions of the RemotePi Board, two variants are available. One has the IR LED and receiver integrated on it, while the other has them connected via a cable. The cable-connected variant is useful if you plan to use the RemotePi Board with a non-transparent case or you intend to mount the RemotePi Board and the RBPi out of line of sight. In this case, you only have to keep the extended IR LED and receiver visible to the users. Although you can buy an acrylic case specifically designed to fit the RemotePi Board piggy backing on the RBPi, most of the readily available cases need only minor modifications to accommodate the two.

When using the RemotePi Board with the RBPi, you need to connect the power to the RemotePi Board and not to the RBPi. The RemotePi routes the power to the RBPi, decided by a micro-controller, which switches the power on or off based on the command it receives from a push-button on top of the board or the infrared remote control.

When you command the power to be switched off, the RemotePi first sends a notification to the RBPi via a signal on the GPIO port. The RBPi has a script running in the background that picks up the signal and initiates a clean shutdown of the operating system, avoiding data corruption.

The RemotePi Board cuts off the power to the RBPi completely, after the RBPi has successfully shut itself down. That reduces the power consumption of the duo to a few mA of standby current.

You must teach the RemotePi software to remember the infrared remote control button you want to use for switching power to the RBPi. For this, the RemotePi software has a learning mode and it stores the button information in its flash memory. Of course, you can make it learn a new button any time you like.

A Slice of the Raspberry Pi

The Compute Module of the credit card sized popular single board computer, RBPi or the Raspberry Pi, is not an end-user product. Manufacturers can use the device when they require an ARM-based platform to build their devices on and sell. Therefore, computing hobbyists will find it difficult to get their hands on the Module if they want to evaluate it.

The RBPi itself is readily available to anyone who wants to buy and use it for projects. However, this Compute Module is not sold as such to hobbyists and for evaluating the Compute Module, it is necessary to get hold of a real product based upon it.

Five Ninjas, some people from the RBPi Foundation and the Pi-friendly accessories seller Pimoroni has a compact media player based on this Compute Module. Their product – Slice – was the result of inspiration based on the original Apple TV.

The first Apple TV was based on the x86 and was silver colored. This was eminently hackable, unlike the later iOS running black box that Apple made. People ripped out the custom Mac OS X installed, replacing it with a Linux desktop. They then added a more open, flexible media center, which ran XBMC.

The FiveNinjas Slice Media Player turned out to be more powerful than the modified x86 version of the Apple TV. The first few Slices have just left the Sheffield assembly plant of Pimoroni. Each has a custom motherboard with a single Compute Module in a DIMM-slot.

The Slice looks like a small metal box that has a translucent plastic spacer running all round the middle. The metal of the box is anodized aluminum in one of choice of three colors – red, gunmetal and black. The entire device feels and looks very stylish. Although you cannot see inside the box through the spacer, Slice puts out a very cool light through it. The light comes from Slice’s 25 NeoPixels. These are individually addressable RGB LEDs, with each containing an in-package controller.

The Slice uses these LEDs to create a rainbow of various color sequences. These sequences are triggered as the user interacts with the Slice using its remote control. While Apple had a slimline aluminum remote, Slice has a somewhat thicker one made of plastic.

Slice has 4GB of flash, which allows it to run any Operating System without a hard disk. It actually runs OpenElec, which is a simplified Linux distro capable of booting straight into Kodi, the media application. Therefore, users can simply play video and music files on their NAS or share from their computers.

Internally, Slice has a SATA connector mounted on the underside of the motherboard. Users can put in a small 2.5 inches disk drive and fasten it on to the motherboard within the case. There are four USB ports and users can hook up Slice to their computers to mount as an external drive automatically.

Currently, there is no app to control the display of colors from the LEDs. However, one is in development and will be available soon. The Compute Module uses a powerful 900MHz Broadcom SoC with a graphics core.