Category Archives: Computing

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.

What is an Integrated Development Environment?

Those who develop and streamline software use IDEs or Integrated Development Environments. IDEs are software applications providing a programming environment for developing and debugging software. The older way of developing software was to use unrelated individual tasks such as coding, editing, compiling and linking to produce a binary or an executable file. An IDE combines these separate tasks to provide one seamless development environment for the developer.

Developers have a multitude of choices when selecting an IDE. They can choose IDEs made available from software companies, vendors and Open Source communities. There are free versions and those whose pricing depends on the number of licenses necessary. In general, IDEs do not follow any standard and developers select an IDE based on its own capabilities, strengths and weaknesses.

Typically, all IDEs provide an easy and useful interface, with automatic development steps. Developers using IDEs run and debug their programs all from one screen. Most IDEs offer links from a development operating system to a target application platform such as a microprocessor, smartphone or a desktop environment.

Developing executable software for any environment entails creating source files, compiling them to produce the machine code and linking these with each other along with any library files and resources to produce the executable file.

Programmers write code statements for specific tasks they expect their program to handle. This forms the source file and developers write in statements specific to a high-level language such as C, Java, Python, etc. The language of the source file is evident from the extension that developers use for the file. For example, a file written using c language usually has a name similar to “myfile.c.”

Compilers within the IDE translate source files to the appropriate machine level code or object files suitable for the target environment. The IDE will offer a choice of compilers suitable for the proper environment. In the next level, a linker collects all the object files that a program requires and links them together. Linking also takes in specified library files while assigning memory and register values to variables in the object files. Library files are necessary for supporting the tasks needed by the operating system. The output of the linker is an executable file, in low-level code, understood by the hardware in the system.

Without an IDE, the task of the developer is highly complicated. He or she must compile each source file separately. If the program has more than one source file, they must have separate names so that the compiler can identify them. While invoking the compiler, the developer must specify the proper directory containing the source files along with specifying another directory for holding the output files.

Any error in the source files leads to a failure in compiling and the compiler usually outputs error messages. Compilation succeeds only when the developer has addressed all errors by editing individual source files. For linking, the developer has to specify each object file necessary. Errors may crop up at the linking stage also since some errors are detectable only after linking the entire program.

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.

How Gray Are The Gray Codes?

Many data acquisition systems and rotary encoders use the Gray Codes for their operation. As only one bit changes state while the numbers progress, read errors from timing and mechanical issues are minimized. Initially, use of Gray Codes was limited to specific applications, but now this versatile coding scheme is extensively used in Karnaugh maps, error detection systems, and in rotary and optical encoders.

In general, a Gray Code represents numbers using the binary encoding scheme and it groups a sequence of bits such that only one bit in the group changes from the number before and after it. Frank Gray, a researcher from Bell Labs, described the code in his 1947 patent, where he called it the Binary Reflected Code. After the patent was granted in 1953, the encoding system was referred to as the Gray Code.

Being an un-weighted code, the columns of bits in the Gray Code do not imply any base weight in contrast to the Binary number system. For instance, in the Binary number system, the right most column holds the most significant bit and carries a weight of 20=1; the second column has the weight of 21=2; the third 22=4, and so on. That means each column represents a base (2 in Binary) raised to a power, with the final value calculated by multiplying the bit by the weight of its column and adding the results of the columns.

Although columns in the Gray Code are also positional, they are not weighted, as the Gray Code is a numeric representation of a cyclic encoding scheme. The code rolls over and repeats, therefore, it is unsuitable for mathematical operations. To be used in displays or in mathematical computations, Gray Code sequences need to be converted to Binary or Binary Coded Decimal (BCD).

Gray Codes are a member of unit-distant, minimal-change codes. That means only a single bit of the sequence changes with the progress of the number count. Therefore, Gray Codes are more flexible during synchronization and misalignment as they limit the maximum read error to one unit. This property makes them useful in error detection schemes as well. Communication systems use Gray Codes in preference to parity check, as detection of unexpected changes in data is better with Gray Codes. If you sum up the bits in a number, the sum of the next number will change only by one, with the sum alternating even and odd.

Rapidly changing values can lead to errors due to interfacing or hardware constraints. This is where the Gray Code is most useful, as only a single bit quantifies the change. That is also the reason most mechanical rotary and optical encoders offer Gray Code outputs. However, Gray Codes have progressed farther than the encoding mask that Frank Gray documented in his patent.

For example, aircrafts use mechanical altimeters where the encoding disk is synchronized to the dials, producing a sort of Gray Code output known as the Gillham Code. The specialized code offers a single-bit change for each increment of 100 feet – allowing an easy tracking of the altitude.

A New Raspbian for your Raspberry Pi

Your single board computer, the Raspberry Pi or RBPi runs an operating system, or more specifically a Linux OS. Keeping true to its form, the Linux OS comes in umpteen flavors and you can choose and pick the one most suitable to your purpose. Operating Systems are built for the processor in the system, and the most popular so far are the Intel family of processors. Since SBCs generally use the ARM family of processors, a special version of the Linux OS is available for them. Of the many versions of the Linux OS for the ARM processors, the Raspbian is the most popular. A new version of Raspbian is now available.

Although people consider versions of operating systems primarily as updates and bug fixes, the new Raspbian is something more. The existing Jessie image used for the desktops and laptops has been modified and adapted to work with the ARM family of processors. Among the standard applications that come with Raspbian, many have been upgraded to offer newer features.

The new Raspbian offers Sonic Pi, version 2.9. If you view the history section of the Info window in Sonic Pi, you can read the full list of changes. The most important are two new effect functions – all articles of SAM Aaron of The MagPi magazine are now included as part of the online tutorials, and there is a new logging system.

Scratch, at version 20160115, has an improved capability for sound input, and supports the CamJam Edukit 3 robotics board. It offers basic PWM support in its GPIO server, and adds several improvements to the font scaling and display.

You will get the new Mathematica at version 10.3 with added support for additional functionality as described by Stephen Wolfram in his book. It supports Sense HAT, includes several new functions, and adds more interfacing to the Arduino.

WiringPi library has been upgraded to version 2.31 and now it allows access to the GPIO pins without use of the the sudo command from applications that use the library. Another Python library, the Rpi.GPIO is at version 0.6.1, and includes several bug fixes that plagued the GPIO Zero library. Additionally, the ping command does not require sudo anymore.

The ALSA system had earlier made it very difficult to get some USB devices to work as the default output. Now it has a new volume/audio device icon on the taskbar. That allows it to be compatible with a wider range of audio devices than before.

With the improved Main Menu editor, you can now create new menus. Earlier, the LXDE desktop environment did not allow visibility of all other menus, and this has now been addressed to work correctly.

Overclocking options for the RBPi models 1, 2, and Zero boards are now available from the command-line and the RBPi Configuration GUI. Updated language translations are also available for those not using English.

Earlier, there was a wide selection of names in different places such as Trash, Rubbish Bin, and more. Now, the name is consistently Wastebasket everywhere when you set the desktop to British English.

Fanless Mini-PC Consumes only 5W

Industrial control applications, digital signage and thin client users require low-power computer systems. The F200 mini PC from Giada Technology is an ultra-compact unit measuring only 4.6 in x 2 in and a thickness of only 1.2 in. Other desktop PCs use up more than 100 W of power, but the F200 takes up only 5 W at full load. At this level of power consumption, there is no need for cooling, and consequently, the mini PC is a fanless unit.

The fanless F200 mini PC takes up the minimum real estate on your desktop. With a VESA mount, you can do a clean installation of this mini PC on the back of a monitor or display, where it fits easily. An Intel Celeron N2807 processor with dual cores powers the mini PC, and it can operate at up to 2.16 GHz. With 8 GB of DDR3 DRAM and 16 GB of eMMC flash directly soldered on its motherboard, the fanless F200 gives out very little heat. The sturdy build resists shocks and vibrations. You can operate the F200 with Android, Linux, Windows 7 or Windows 8.1. If you want to add a solid-state disk of your choice, F200 has an mSATA II slot as well.

Unattended operations on the F200 are easy because of its built-in capabilities. You can schedule power on and off, and program it for auto power-on after a power failure. Therefore, F200 is eminently suitable for simple digital signage and other industrial installations. For those looking for pushing signage content over a network, the F200 offers a SIM card slot for Wi-Fi, BT or 3G module connectivity.

The F200 ultra compact mini PC can act like a virtual desktop. As industrial environments can be typically harsh, Giada Technologies has made F200 durable, noise proof and dust resistant. Its Intel Celeron Processor N2807 operates with two cores, 2 threads at 1.58-2.16 GHz, reaching a TDP of 4.3 W.

Display interfaces on the F200 consist of Intel HD Graphics, with Microsoft DirectX 11 on a single HDMI port. With an optional VGA output, the display resolution can be 3200 x 2000 at 60 Hz for DP, or 3840 x 2160 at 24 Hz for HDMI.

F200 offers three expansion slots. The first is for a SIM card capable of connecting 3G enabled Wi-Fi modules. There are two Mini-PCI Express slots where you can connect full-length mSATAII SSDs, full-length PCIe, USB Wi-Fi & BT or a 3G enabled module.

The F200 is rather rich in IO interfaces. A single port offers Microphone and audio in/out. A Realtek Gigabit Ethernet Controller connects to a single RJ45 port on the back panel. There are two USB2.0 ports and a single USB3.0 port, one COM port, and one SIM card slot. 12/19V DC in is through a Jack on the back panel. Optional ports include IEEE 802.11 ac/b/g/n, a Bluetooth module and an IR module.

Several built-in features provide system management on the F200. For example, there is JAHC support, a watchdog timer, auto power on, wake on LAN and RTC wake up to control the mini PC. The operating temperature range is from 0-40°C.

An Energenie Pi-Mote controller Board for Your Raspberry Pi

Those looking for a low-cost automation and home control solution can use the Pi-Mote controller board from Energenie. The Pi-Mote controller board is an add-on for your single board computer, the Raspberry Pi or more simply, RBPi. With this combination, you can control electrical appliances connected to special radio controlled electrical sockets.

Working at 433.92 MHz, the Pi-Mote controller board for radio-controlled sockets is easy to install and command. The product offers a safe and simple way to let your RBPi control mains powered devices and appliances. The Pi-Mote controller board from Energenie is compatible with all RBPi models such as the A, A+, B, B+ and B2.

The Pi-Mote controller has a range of up to 30 meters and puts out an output power of 3V, 27mA at +12 dBm. The output is encoded at four data bits, offering a 20-bit address pre-set with OTP. The user can select the output modulation with software from OOK or FSK.

The product actually comes in two parts, the RF board and the electrical socket. The RF board attaches to the RBPi for controlling several 13A, 3-pin electrical sockets. Although the original Energenie sockets are meant for use in the UK, plug adapter sockets are available, which make these almost universal. You can also get kits with a 4-way extension lead and other compatible sockets from Energenie. All can be controlled from the Pi-Mote controller board.

A small Python program allows the add-on RF transmitter board to control up to 4 radio controlled sockets simultaneously by toggling the socket on and off individually. The add-on board attaches to the GPIO pins of the RBPi. In its basic form, each board transmits a frame of information to the sockets. The frame is made up of a 20-bit address and a 4-bit control data. Additionally, the frame uses the On-Off Keying or OOK technique, a basic form of Amplitude Shift Keying or ASK. The source addresses are pre-programmed and the user cannot change them.

When using the Pi-Mote controller, you are required to insert the radio-controlled socket into the mains wall socket and switch it on. The socket then enters a learning mode, which is indicated by the slowly flashing LED in front of the socket housing. You can force a socket to enter the learning mode at any time by pressing the green button on its housing form, holding it for five seconds and releasing it.

Once it is in the learning mode, send the socket a signal from the program running on the RBPi. The LED on the socket housing gives a brief flash and stops glowing. This indicates the socket has accepted and memorized its address. You can then program the rest of the three sockets in turn; otherwise, they will react to the same address. When using more than one socket, insert each into separate mains wall outlets, maintaining a physical separation of at least 2 meters so they do not interfere with each other. The sockets must not be put into a single extension lead.

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.

Comparing Wireless Standards 802.11ad & 802.11ah

Wireless LAN standards were first set up for serving the needs of laptops and PCs in homes and offices. These were IEEE 802.11a and b, and these later served to allow connectivity in different places such as in shopping malls, Internet cafes, hotels and airports. The main functionality of the standards was providing a wireless link to a wired broadband connection for email and Web browsing.

Initially, speed of the broadband being a limited factor, a relatively slow wireless connection was enough. Therefore, 802.11a offered up to 54Mb/s at 5GHz and 802.11b up to 11Mb/s at 2.4GHz, with both frequencies being in the unlicensed spectrum bands. To reduce interference from other equipment, both standards were heavily encoded using forms of spread-spectrum transmission. In 2003, a new standard 802.11g used the 2.4GHz band maintaining the maximum data rate of 54MB/s.

However, by this time, people started realizing the need for higher throughput, especially with increased data sharing amongst connected devices in the home or small office. By 2009, a new standard, 802.11n came up, which improved the single channel data rate to over 100Mb/s. The new standard also introduced spatial streaming or MIMO, multiple inputs, multiple outputs. The new modems had up to four separate transmit and receive antennas, carrying independent data that was aggregated in the modulation/demodulation process.

However, new WLAN usage models were continually raising the demand on throughput, such as projection to TV or projectors, streaming from camcorders to displays, video streaming around the house, airplane docking, public safety mesh and more. Catering to these VHT or very high throughput demands made it necessary to generate two new standards 802.11ac (an extension of 802.11n) and 802.11ad.

Standard 802.11ac runs in the 5GHz band, providing a minimum of 500Mb/s on a single link and 1Gb/s overall throughput. On the other hand, 802.11ad provides up to 6.7Gb/s using a spectrum of about 2GHz at 60GHz, but at short range. Operation at high frequencies limits the transmission range and obstacle penetrating capacity of the signals.

With the proliferation of local sensor networks working on low power, billions of IoT or Internet of Things and M2M or machine-to-machine device connections, a new standard is now deemed necessary. This new standard is the 802.11ah, working in the license-exempt 1GHz band and its final version is expected in 2016.

Standard 802.11ah is a down-clocked version of the 802.11ac standard. While adding some enhancements in the MAC and PHY layers, the new standard offers advantages such as power savings, multiple station support, better coverage and mobile reception.

For the standard 802.11ah, three main use-case categories are under consideration. These are Wi-Fi extended range networks, backhaul networks for sensors and meter data and sensor networks. The standard 802.11ah extends the transmission range with 1 and 2MHz mandatory modes, allows ultra-low power consumption, thereby offering multi-year battery life for large scale sensor networks and is optimized for long sleep times while handling small packet sizes.

Therefore, with 802.11ah, you can have several devices such as light sensors, temperature sensors and smart meters set up throughout the home, enabling your home devices and appliances to be considered smart.

Adding Memory to the Raspberry Pi

Although the memory onboard the Single Board Computer Raspberry Pi or RBPi is sufficient for most applications, some may feel the necessity of expanding the storage capacity. The options provided on the RBPi are limited, as the USB ports often engage a keyboard, a mouse or a game controller and the SD card slot holds only a single device.

The most obvious option for expanding the storage capacity on the RBPi is through the USB ports. However, tying up ports with a USB hard disk drive or flash drive can run into difficulty if you need the port for plugging in another USB device. One way of getting around this problem is by using powered USB hubs. It is important to realize the RBPi cannot supply enough power for driving the hub.

Using a powered USB hub makes it easy to add USB devices to your RBPi, including additional storage. However, you must consider a few things when expanding storage on your RBPi. In reality, there are only two common USB storage options available – flash drive and hard disk drive. Nevertheless, you may also consider a card-expanding trick for the Raspbian operating system for your RBPi. These are the three primary options available for expanding storage on your SBC. Apart from this, you may also consider using secondary storage devices such as networked drives, USB DVD-r drives and NAS drives.

The SD card in the RBPi acts as the main storage option – use an SDHC card for best results. It is a boot device acting as the general storage and from which the operating system also runs. You may think of the SD card as a replacement for the HDD of a regular desktop computer, more like an SSD or Solid State Drive, as it has no moving parts and uses very low energy.

By default, Raspbian, the standard Operating System of the RBPi, is designed to run from a 2 GB SD card. Therefore, when you flash the Raspbian image, the SD card will have a partition of 2 GB, with the balance of the card memory remaining unused.

To get around this, you must use the expand file system feature included in the raspi-config screen in Raspbian. This enables expanding the size of the partition to the maximum capacity of the SD card.

When you insert your flash drive into a USB port of the RBPi, you may be surprised it does not have the same effect as it does in a regular Ubuntu or Windows computer. It is not enough to insert the flash drive, Raspbian expects you to mount the device manually before you can use it as an additional USB storage device. However, before you can mount it, you must know the exact device name that Raspbian has assigned to the drive.

For this, the command necessary is: sudo ls /dev/sd*. The command “sudo” gives you temporary administrative status, “ls” allows listing the devices and “/dev/sd*” lists the devices seen by Raspbian. With this command, you will know the number Raspbian has assigned for your drive.

Now, you can mount the USB flash drive and use it as an additional storage device with the command: sudo mount -t vfat /dev/[USB DEVICE NUMBER] /mnt/usb.