Monthly Archives: January 2015

HMI: How to Communicate With Machines

Accelerating quality, quantity, economic efficiencies and environmental protection are leading to an increasingly connected process flow and factory floor. In combination with decreased personnel, that has led to processing of increased amounts of information by fewer and less application-specific operators in the control center. It requires a well-designed HMI or Human Machine Interface system to decrease the gap between the production process and the operator via an intuitive visualization system, layers of detail that allow a bird’s eye view down to the minute details, and includes training material and documentation that the operator has on his fingertips.

A well-designed HMI system provides numerous benefits. Chief among them are increased safety, quantity, quality and economic efficiency. Apart from minimizing the risk of disruption in the production process, HMI systems also reduce the over downtime while allowing fewer operators to manage more information with less field-specific knowledge.

HMI provides a means of monitoring, controlling, managing and/or visualizing device processes. For example, an operator panel may allow the operator of an industrial machine to interact with the machine in a visual, graphical way. The operator can easily control the machine by using the touch screen or external buttons, as all readouts and controls readouts are graphically displayed on the screen.

HMIs can be located on the machine, in the form of simple segmented displays or LCD panels of high-resolution. They can be located in portable handheld devices that are battery operated or in centralized control rooms. Machines and process controls can use them to connect the operator with Programmable Logic Control application systems to control sensors, actuators and machines on the factory floor.

For communicating with industrial machines, the usability of the HMI system depends on the processing power of the system, its ability to render reality-like complex screens, quick responses to user inputs and the flexibility for handling several levels of operator interactions. Usually, effective communication requires the HMI to have dynamically changing graphics. This in turn, requires the system to be a high-performance type that supports various resolutions and displays of high refresh rates. For efficient communication between the operator, numerous machines and control systems, it is imperative that multiple connectivity and protocols must be supported.

Industrial automation thrives on real-time communication. Using industrial micro-controllers along with PRU-ICSS or programmable industrial communication subsystems makes it possible to support various popular, certified serial protocols, including those that are Ethernet-based. The PRU-ICSS allows HMI manufacturers easily support industrial communication protocols of multiple types on a single hardware platform. The most important advantage of this platform is that it does not require the support of external ASICs and FPGAs. This offers huge scaling in performance and the integration offers opportunities of software and design reuse.

Portable HMI solutions use several wireless connectivity solutions such as WLAN, Sub-1GHz, ZigBee and BlueTooth. This broad portfolio offers the maximum flexibility when designing for wireless. For example, the WiLink 8 solution provides high-performance BlueTooth and Wi-Fi in one module. The Sub-1GHz performance line is very popular and the most reliable in its range.

Let Raspberry Pi Read You an Audio Book

People who have grandmothers (and grandfathers) are fortunate. Although most of these old people are healthy and strong despite their advancing years, not all are so lucky and may be impaired in some way, mostly because of their failing eyesight and trouble with arthritic hands. Since they have a physical handicap, they find it difficult to operate a laptop, a DVD player or a tiny MP3 player. A Raspberry Pi (RBPi) with a large play button is actually helpful if it can read back an audio book.

This can be done in two ways. The RBPi player can have a single large button to pause and play, or have no buttons at all and be operated by NFC tags. The tags are best attached to empty CD or DVD cases, on which the details of the Audio book are printed in large letters for easy reading. Simply passing a case over the player will cause the specific audio book to start playing from its last state.

The player saves its state after every two seconds. Therefore, when the listener is bored or otherwise wants to stop listening, he or she can simply disconnect the player from its mains socket. Reconnecting it allows the player to get back to playing from its last saved state.

The RBPi player with a single large button works as a play/pause button when pressed. Going back to the previous track is easy if the listener holds the button pressed for more than four seconds. Copying files into the player is also a simple affair with a thumb drive. The files are copied into the thumb drive under a special volume label. As soon as it is plugged into the RBPi USSB port, the books are copied into the SD card and starts playing when the drive is unplugged.

For the single button RBPi player, apart from the RBPi and its enclosure, you will need a blue LED, some wires, a pair of speakers and of course, the large button. Among the software that you will need are – Raspbian image (Wheezy), mpd, mps, mpd-python, pyudev and a python script.

When the RBPi player is first powered up, it boots, starts the python script and waits with the audio book in pause. Since at a time only one audio book is stored, pressing the button starts the player. If the button is held pressed by more than four seconds, the player goes back one track. The player always remembers its last playing position.

As soon as a USB thumb drive is plugged in, the player stops playing, mounts the thumb drive, deletes the old audio book, copies the new one from the special name/label on the thumb drive and rebuilds the playlist. A flashing blue LED signals the end of file copy. Once the thumb drive is removed, the new audio book starts in pause mode, proceeding to play when the play/pause button is pressed briefly once.

Use of mpd allows the RBPi player to support wave, Musepack, MOD, MP4/AAC, MP3, MP2, OggFLAC, FLAC and Ogg Vorbis file formats.

Using a Raspberry Pi to Hack an Apple Time Capsule

You may have an old Apple Time Capsule lying around, which you may not be using because it has a failing hard drive. These were expensive at the time Apple first introduced them and for many people, a failed power supply or hard drive might have forced them to stop using the device. If you are not familiar with the Time Capsule, it is a backup arrangement for everything on your Mac. Apple coined the name Time Capsule for the hardware and Time Machine for the software. Windows users will not have seen anything like it, and you can read about Time Capsule on Apple’s official link.

You can bring your dead Time Capsule back to life using the low-cost credit card sized single board computer Raspberry Pi (RBPi). Even if you do not have a Time Capsule to modify, you can simply add a Solid State Drive to your RBPi, house the two in a suitable box and make a Pi Capsule for using on your Mac with the Time Machine software. For information, Linux users may backup to the Pi Capsule using any one of the 21 backup software programs listed here.

Backing up over the wireless may be slow, depending on the Wi-Fi speed. However, you can get much faster speeds using the Pi Capsule over wired Ethernet. Of course, the first time you start a backup, the process will take a long time, so try not to interrupt it. Future backups will be faster because they will be only incremental.

You will need a power supply suitable to power up both your RBPi and the Time Capsule (in case the power supply in the Time Capsule has given up the ghost). Connect the SSD hard drive using a SATA to mini-USB cable via a powered USB hub. It is essential to connect only the wireless mouse and the powered USB hub to the RBPi. Anything else you want to connect to the RBPi, such as the keyboard, SSD, wireless card, etc., goes through the powered USB hub.

For the RBPi, you will need an 8GB SD card with the latest “Wheezy” Linux operating system on it. For instructions on how to load Linux on the SD card, see instructions here. Connect a display through the HDMI. When booted the first time, you will be taken to “Raspi-config” automatically, allowing proper setting for the keyboard connected to the RBPi. Now connect the Hard Drive or the SSD to the RBPi using a SATA to mini-USB cable via the USB hub. For getting the RBPi working with the Time Machine on a Mac, follow the guide here.

Pi Capsule has some extended features over the Apple Time Capsule. For one, it can plug into your TV or any other display. Apart from using it only as backup device, the Pi Capsule is actually a full-fledged computer, which you can simultaneously use for web surfing or emailing. If you are not using an Apple Time Capsule and if you have the ability to make cases, build one to house both the hard drive and the RBPi, taking care to leave openings for the RBPi connectors.

What Are NFC Tags And How Do You Use Them?

NFC stands for Near Field Communication. These are small tags, which can be programmed to talk to your phone. As you swipe your phone over an NFC tag, it triggers preset commands you have programmed into it. NFC tags are quite cheap, for example, you can pick up 10 of them on Amazon for about $13.

Here are some examples of using NFC tags –

• Tag No.1: On key chain. A simple trigger to take you to a specific website
• Tag No.2: On the kitchen counter. It triggers several commands – turn Wi-Fi on, turn Bluetooth off, turn Sync on, turn Brightness up and turn Volume up
• Tag No.3: Besides the bed. Turns volume to silent, turns brightness down
• Tag No.4: In the car. While entering the car, turns Wi-Fi off, turns Bluetooth on, opens Audible App, turns Synch off
• Tag No.5: In the car. While leaving the car, turns Bluetooth off, turns Sync on

Therefore, you can program these tags to make your phone do a bunch of things by simply passing it over the top of a tag. You do not need to open an app and individually change each setting; simply passing your phone over a pre-programmed tag will do the trick. To set up your Android phone, go to settings > More > Check off NFC. Unfortunately, Apple does not support NFC, so you cannot use the tags with iPads and iPhones.

You will need to download the Trigger App. If you have not downloaded this, your phone will take you there the first time when trying to use and NFC tag.

Technically, NFC has the ability for two devices to send data to each other simply by bringing one near the other. Here, the word device stands for a tag and a cell phone. NFC tags, also referred to as smart tags, have chips embedded into them and these can be programmed to transfer just about any instruction or data via NFC.

MOO.com offers business cards with NFC tags embedded within them. The idea is that when you hold your NFC enabled business card to an NFC enabled cell phone, your contact details are automatically added to the phone’s contact book. Therefore, you need to carry only a single card with you, which saves time and money. Moreover, no sensitive data is exchanged and there is virtually no security risk involved.

Advertisements have QR codes on them, allowing people to scan them to go to their blogs. That requires a barcode scanning app, the light has to be just right and the entire QR code has to be captured properly. With NFC tags, you only need to pass your cell phone over the advertisement to get the required information.

The NFC Task Launcher will allow you to program your NFC tags with your mobile phone. Once you have them programmed, the tags will help you to do almost anything from going to a website to enabling/disabling the Wi-Fi, adding contact details, setting an alarm, embedding information for a location and more.

What Is A Semiconductor Compass?

Chances are that your smartphone has a compass to show you which way is North. A normal compass consists of a magnetic needle suspended on a pivot and the earth’s magnetic field aligns it towards the magnetic North Pole. Since there is no magnetic needle within the smartphone, it is a wonder how this digital compass works. Well, a modern smartphone contains a built-in electronic or semiconductor compass, also called the eCompass. Moreover, this eCompass is calibrated for the magnetic interference from the circuit board and compensated for the tilt of your smartphone.

Probably the first sensor to be incorporated into a smartphone was the accelerometer that selected between the portrait and landscape display orientation. Then came the magnetometer and this evolved into the electronic or eCompass. The electronic compass is used to align the street maps to the geographic heading of the smartphone or to overlay augmented reality. With the high-volume production and use of smartphones, sensors for accelerometer and magnetometer now cost less than $1 each.

However, just having a magnetometer sensor is not enough to provide an accurate compass heading for a smartphone. There are two reasons for this – first, the magnetic field measured with the magnetometer varies significantly with tilt, the angle at which the owner is holding the smartphone. Second, the magnetometer requires to be calibrated not only for its own offset, but also against spurious magnetic fields caused by the nearby ferromagnetic components on the circuit board.

Both the above reasons are taken care of by the accelerometer. This is usually a three-axis component operating in the +/-2-g range with at least a 10-bit resolution. Its output changes by 512 counts as the accelerometer rotates 180° from pointing upward to downward. That gives it an average sensitivity of one count for every 0.35° change in tilt. For tilt-compass purposes, this is an acceptable sensitivity figure.

The other important measurement required from an accelerometer is its 0-g offset accuracy. This is the output of the accelerometer when it is in a free fall and experiencing zero gravity. As this value is an error adding to each accelerometer channel, it adds a bias in the calculate angles of tilt.

The geomagnetic field of the earth has a magnitude of 50µT, with a horizontal component varying over the earth’s surface. It varies from a maximum of about 40µT and goes down to zero at the geomagnetic poles. Therefore, for an eCompass to operate in horizontal geomagnetic fields, for example in the arctic Canada, where the field can be as low as 10µT and an accompanying noise jitter of +/-3°, then the magnetometer required must have a maximum noise level of 0.5µT.

In a smartphone, the software uses the aerospace coordinate system, where the initial eCompass orientation has X-axis pointing North, the Y-axis pointing East and the Z-axis pointing down. The three orientation angles are defined as clockwise rotations about the x, y and z-axis. These are named roll (ø), pitch (Ɵ) and yaw (Ψ) respectively. The earth’s gravitational vector points downwards at a magnitude of 1-g or 9.81ms-2.