Category Archives: Guides

DIY Google Glass with Raspberry Pi

If you thought Google Glass was something beyond your capabilities, well you can think again. Adafruit has a Do-It-Yourself design that can turn a pair of display glasses into the coveted Google glass type of form factor. Not only does it clip to the prescription glasses you are using, it can display any type of device that puts out Composite Video such as the Raspberry Pi or RBPi does.

With 3D printed parts you can download free, one pair of these wearable video glasses will cost you only $100. The display uses simple plug-n-play technology to connect to the RBPi. The project uses the NTSC/PAL Video Glasses (1:20) and uses only one-half. The glasses are full-color LCD micro-display presenting a virtual large screen of 52” at 2m distance. With a resolution of 320×240, and a color depth of 24 bits, it has an in-built LiPoly battery rated at 800mAH, which lasts for 4-5 hours. You will also need miniature wireless USB keyboard with touchpad and of course, an RBPi.

Other parts that you will need for this project are a 3D printer to print out the parts, flat pliers, 30AWG Wire Wrap, a pack of heat shrink tubing, a screwdriver set and a composite video cable.

You start with disassembling the Video Glasses. First, remove the nose guard piece. For this, you may have to remove tiny screws – use a small screwdriver. Then, carefully pop the shaded lenses off. There will be more tiny screws behind the lens, remove them and the frame should come off easily. Now, gently pry open the enclosure and use a flat-head screwdriver to separate the two halves. Remove the PCB from its enclosure – use a pair of flat pliers. Also, remove the two video display screens from the enclosure. Holding the eye covers to the magnifying lenses, unscrew the two eyepieces. Now carefully detach one of the displays from the PCB and store away as a backup unit.

You will now have one of the video display units along with the kopin video processing circuit. The power circuit with its USB port and the two audio input jacks should also be present. With disassembly over, it is time to begin the assembly of the project.

Begin by unsoldering the four connections from the power circuit, as you will need to increase the lengths of the wires. Use about 140 mm or 5.6 inches of 30AWG wire to extend the length of the wires. You may need to tin the ends of each wire before soldering them together. Use heat shrink tubing to secure the connections. Disconnect all components before you put them into the enclosure.

3D print the eight pieces design to make the snap-fit enclosure. This will house the components extracted from the Video Glasses. The plastic eyepiece with the magnifying glass goes on top of the eye part. You can reuse the same screws to secure the eyepiece into the eye part. Positioning the eyepiece into the cap part, thread the cable connections through the opening on the side. Similarly, thread the wires through the elbow part and snap it in place. Assemble the rest of the parts following the guide here.

What are wireless power coils?

More than 120 years ago, a genius by the name of Nicholas Tesla conducted some experiments that laid down the technology of distributing electricity without wires. Today, we are using Tesla’s technology to charge our mobile phones. More than 50 million mobile phones remain alive through inductive charging. We use induction stovetops in our kitchens. The technique of wireless transfer of power is certainly proliferating.

A large part of the world population is completely dependent on smartphones and tablets. Personal encounters have given way to texting, emails and video chats. Spare times involve playing games on mobiles or watching videos. However busy people may be, there is always some time to browse the social networks and post in them. In fact, this gadget takes up most of the time we stay awake. With so much drain of energy, it is no surprise that mobile batteries do not last through the day.

Now, thanks to wireless power coils integrated into bedroom dressers or restaurant tables, people can charge their smartphones and other gadgets by simply placing them on the table. Device manufacturers adopt one of three major standards for Wireless Energy Transmission – WPC, A4WP and PMA.

The basis of Wireless Energy Transmission lies in Faraday’s Law of Induction. According to this law, a current flowing through a primary coil generates magnetic flux. If a secondary coil is present, the magnetic flux from the primary coil induces a voltage in the secondary coil. During wireless power transfer, the quality of the coils is of prime importance in determining the coupling and efficiency of the process.

The quality of a coil depends on its internal resistance and its reactance. Various factors affect both the parameters. For example, with a ferrite pot core, the coil can tightly bundle its magnetic field, reducing outward radiation while increasing the coil distance. Mounting space required is also smaller, since the coil is compact and round. Since the ratio of the area between transmitter and receiver coils affects the efficiency of energy transmission significantly, smaller receiver coils result in small transmitter coils as well.

Manufacturers reduce the internal resistance of their coils by using materials of very high purity. However, wireless energy transfer calls for the use of very high frequencies, for example, in the MHz range. At such high frequencies, the nature of current flow through the wire changes dramatically. High frequency current flows mostly along the outer periphery of the wire, with very little current flowing through the central core. As a result, the resistance of the wire increases tremendously as the frequency of the current passing through it goes up. This is called Skin Effect.

To reduce the resistance of a single wire carrying high frequency current because of Skin Effect, manufacturers replace it with a bundle of thinner wires insulated from each other. This type of wire is called Litz wire. Since the wires are thin and insulated from each other, the high frequency current is forced to travel equally through all of them. The overall resistance is therefore much lower.

What is LED EOS failure?

LEDs, being semiconductor components, are susceptible to failure if overstressed electrically. This is true regardless of the manufacturer and electrical overstress or EOS is the leading cause of failure of LEDs. In fact, LED components are subject to transient conditions that can cause EOS and subsequently result in a catastrophic failure.

Like all semiconductor components, LEDs too have their maximum specifications of voltage, current and power. An exposure beyond the maximum current or voltage levels can lead to EOS. Typically, a current or voltage transient, accompanying the EOS event, may cause generation of localized heat – leading to EOS failure. As with any semiconductor device, an LED also has only a limited ability to survive overstress, and this is its maximum withstanding power.

EOS must not be confused with electrostatic discharge or ESD. Electrostatic discharge is the result of a rapid transfer of static electric charge between a non-operating part and an object at a different electrical potential. ESD events typically range from pico- to nano-seconds, whereas EOS events are much slower, ranging from milli-seconds to seconds. Moreover, EOS can be only a single event, an ongoing periodic event or even a non-periodic event. Common causes of EOS are:

• A driver producing current spikes
• A driver constantly driving an LED over its maximum rated current
• A lightning strike or similar power surge from the AC mains power input
• A user hot-plugging an LED into an energized circuit

Depending on the duration and amplitude of the overstress conditions, LED failures due to EOS can vary from subtle to severe damage. For example, an LED with subtle damage may not emit light at low currents, but does so at higher current levels. On the other hand, a severely damaged LED may not emit light at all. Both may exhibit current leakage, an open circuit or a resistive short. The amount of time that it takes for an LED to be damaged by EOS, depends on the conditions of the EOS, operating conditions and the LED junction temperature.

LEDs may be classified into three types – mid-power, high-power and COB. Test laboratories typically use square-wave pulses of forward current for simulating EOS conditions in LEDs. This allows variation of all test parameters such as voltage, current, power and time. For example, pulse power levels of up to 1700W may be applied to LEDs in forward-bias mode, while the time duration may range from 0.1 to 70 milliseconds.

Most mid-power LEDs are typically enclosed in a plastic package and contain either one or multiple chips. The multiple chips may be internally connected in parallel or in series. The EOS robustness of the device depends on the internal structure. As a thumb rule, LEDs with higher light output tend to be more robust to EOS.

The EOS robustness of high-power single-chip LEDs depends on their architecture. LED device structure, such as the packaging contacts, current spreading techniques and attachment of the die, are major contributors to determining temperature rise and power dissipation and hence EOS robustness.

COB or chip-on-board LEDs are similar to high-power single-chip LEDs, with one major difference. There are bond wires connecting the top-side contacts to the chips and metal traces for current spreading, resulting in lower withstanding power as compared to other high-power LEDs.

Raspberry Pi Temperature Monitor and Alarm Project

Although five-day weeks are a boon to white- and blue-collar workers, some businesses need to be extra careful during the two days of the weekend. For example, commercial monitoring systems generally protect warehouses with large freezers and cooler rooms. However, between Friday evening and Monday morning when the food shelf remains closed, a unit may blow a fuse. Usually, this goes unmonitored with the result that food is found ruined by Monday. The inexpensive, tiny credit card sized single board computer, the Raspberry Pi or RBPi was found to be a suitable base for a temperature monitor and alarm for a walk-in display-case cooler and freezer.

The project objectives are very simple. A low cost temperature monitoring system is required that can send free text messages when the temperature within the freezer or fridge goes outside the acceptable range.

For this, the RBPi has to monitor the temperatures within the fridge unit and the freezer. For the fridge unit, the valid temperature given is 33F, while it is -10F for the freezer unit. However, since stocking personnel and customers open the doors frequently during the business hours, temperatures in the fridge rises to 60F. Therefore, a wider temperature range is to be allowed during business hours as compared with the temperature range during off hours.

To draw the attention of maintenance personnel, the RBPi has to provide an audible temperature range alarm, which makes a noise when the temperature goes beyond the range. Additionally, a switch button is necessary, as a snooze, to silence the noise when the problem is receiving attention. As personnel are expected to be away on weekends, the RBPi is required to send a text message to someone who would be able to either fix the problem or move the food to a safer location. To make the temperature visible to the staff, an LCD temperature display is used. The RBPi is required to project the current temperature on a wall mountable LCD mounted outside the fridge/freezer unit.

Parts needed for the project include the RBPi Model B, although Model A can also be used. However, since Model A has only one USB port, an additional USB hub will be necessary. For the operating system, you will need the 8GB SD card with the NOOBS installer image. The Adafruit RGB 16×2 LCD kit with Keypad is the most suitable, since it has five momentary push-button switches useful for navigation. For connecting to the internet, you may use the Wi-Pi Wireless Adapter. In case you are planning for an XBMC solution, you will also need an Ethernet cable, an HDMI cable and wireless keyboard/mousepad.

For the audible alarm, you will need 2×3.5mm stereo headphone plugs, a portable speaker and audio cable. To house the RBPi, a suitable case will also have to be used.

You can use 2x DS18B20 Digital temperature sensors for monitoring the two temperatures. Although the stand-alone IC components are just as good, prepackaged waterproof units are available; these will suit the project better. When you are ready with the parts, follow the instructions in this tutorial to set up the project and to calibrate it.

PicoBorg Helps To Build a DoodleBorg

Imagine a small tank driven by a Raspberry Pi or RBPi. This is the DoodleBorg, a two-horsepower goliath and is the most powerful robot controlled by the RBPi. Powered by starter motors originally from a motorcycle, the DoodleBorg uses six PicoBorg motor boards made by PiBorg.

The DoodleBorg uses a tiny, credit card sized single board computer, the RBPi, as its brain. It has six reverse motor controller boards or PicoBorgs controlling its six wheels. Each of the boards is capable of handling 10A on average. Therefore, with two batteries in series, the average power output is 6x10x24=1440Watts or roughly 2HP. Peak power outputs are higher, about 2.1KW or three horsepower. Usually, the RBPi is prominently visible in the robot it is powering. However, in this case, you will hardly recognize it in the massive size of the project. Commands to the DoodleBorg are sent via a PS3 controller.

The PicoBorg reverse motor controller cards were specifically chosen for this project. These are advanced dual motor control boards for use with an RBPi. PicoBorgs can control big or small motors, with forward or reverse speed control. Each board, with its own emergency power off, is sized to mount on your RBPi for PID control and feedback via the GPIO pins. If you need to control more motors, simply plug in more boards and control up to 200 motors.

The dual motor controllers can handle input voltages between 6 and 25VDC and control up to 5A per channel, that is, 10A when combined. The emergency power off switch works in both bidirectional and speed control modes. PicoBorg boards are capable of handling two DC motors or one stepper motor with 4- or 6-wire configuration. For communication, you can use the I2C or SCK/SDA pins on the GPIO together with 3V3/GND pins. Adding the PicKit2 brings additional functionality.

PicoBorg reverse motor controllers are protected against overheat, short circuits on all outputs and under-voltage lockout. Connections are very straightforward. Six screw-terminals on the board allow connecting two motors and a battery. There are two 6-pin terminals, one of which is for connecting to control signals from the GPIO of the RBPi. The other 6-pin terminal can be used for daisy chaining another PicoBorg board.

Another connector on the board allows you to easily add a normally closed switch to act as an emergency switch. In case of any fault, simple open the switch and the motor will be cut off. The software on the PIC micro-controller on board will recognize the emergency switch operation and prevent further operation of the motors until enabled by a software command.

Another feature of the PicoBorg is its ability to run DC motors with taco feedback. The software accepts taco input signals that indicate either the number of rotations or the distance traveled by the wheels. Acceptable feedback signals are – quadrature signal (A or B) from an encoder, taco signal from a computer fan motor, index mark feedback such as one per revolution pulse. The motor connection remains the same as that for a standard DC motor setup.

What is a diskless computing system?

Today’s data centers and Hybrid Compute Clusters or HPC work with thousands of computers. With every computer having its own operating system, even a team of highly skilled administrators would find it hard to keep up with the demands required for maintaining each system. Typically, admins strain to keep the myriad types of computers they have, all functioning, as they should. Sysadmins must duplicate their efforts over and over, as they install new systems with new system software and handle configuration problems individually as they arise on each of the various systems. However, things need not always be so complicated and difficult.

There can be an alternative scenario, where all that the admins must do is reboot a machine for it to enter into a pre-configured operational environment. Such operational environments or images, as they are called, can exist in multiple numbers with each image acting as an individual container for the system software, configuration and behavior of the group of nodes the image was designed to run on.

For example, a specific image managing the operational requirements of a large multi-user cluster, would contain the necessary software, its configuration, including the behavior of compute nodes, admin nodes, login nodes, IO nodes and anything else needed. A second image might be based on the latest Linux distribution that is currently under test for a future deployment. Images could be configured to handle web servers, database programs, application servers, user desktops or render farms.

With one root image controlling the behavior of all machines, the complexity of the overall system and the overhead of system administration are scaled down drastically. It also leads to a stable environment as administrators can focus on hardening only one system instead of spreading their attention thin across the various setups.

In such a cluster, individual computers are typically devoid of hard disks, although with-disk computers are also supported. Diskless computers can be any subset of nodes and may be booted into any image as required. When an image is changed, all the nodes see it simultaneously. Only a reboot is what it takes to interchange a system image. Moreover, an image may be cloned with only a simple copy. Any number of functionally different machines may use the same image, with a simple synchronization propagating a working modification made to one system to all other systems. Since the image remains the same no matter which machine is using it, the behavior of each configured node remains the same.

Local networks may have many nodes with the image being cloned for each of them, with each clone being capable of serving the image to as many diskless clients as the network or the machine is capable of handling. The nodes operate normally using the configuration designed, which determine their role at boot time. The functional role of any node can be changed on the fly, once the node has booted.

An open-source software package, oneSIS, offers such a method for building and maintaining compute systems of any size. The lightweight, easy to configure and flexible package reduces the cost of cluster administration drastically.

What is the difference between Linux and Android

Those of you who use the Linux OS on their desktops know that it is vastly different from the Android OS typically used on the mobile phone or tablet. One of the glaring differences one notices in the two OSs is that Android is geared heavily towards the touch operation, whereas Linux is limited to operations with a keyboard and mouse. However, both operating systems have a common origin and share the same kernel.

Linux can be best defined as an operating system suitable for running on a fixed or limited function device – for example, embedded Linux on a smart refrigerator or toaster. This allows the device to take full advantage of the massive processing power of Linux and utilize the peripherals to the utmost. When used on a fixed function device, embedded Linux has unparalleled operating efficiency and performance, uses minimum memory footprint and power, while providing the user with the utmost ease in using the device for its intended purpose.

Smartphones and tablets, although embedded devices, are definitely not fixed-function (different models with myriad functionality). The sheer volume of these devices tends to skew the traditional definition of embedded Linux. With increase in the capabilities of the hardware, the definition of embedded Linux also undergoes a change, especially where limitations in storage and processor capabilities are concerned.

On the other hand, Android, although a desktop-like Linux mobile OS and platform, allows users (manufacturers) to define their own usage patterns. It also allows vendors to update and upgrade the platform dynamically. However, some applications blur the distinction between Android and embedded Linux.

One of the examples of this type of application can be seen in the television set-top box. This used to be a fixed function device running on embedded Linux. With the increase in functionality and dynamism of the TV, the set-top box now has app downloads and software upgrades similar to Android devices. Moreover, Android is undergoing changes similar to what embedded Linux is facing. It is growing beyond being just a tablet operating system or a mobile communication system.

What many people do not know is Android and Linux both use the same kernel. However, Android focuses on the vertical integration of its user space components with the Linux kernel itself. In most respects, Android can be seen as another flavor of embedded Linux – just as each embedded Linux is tailored to the architecture of the CPU, peripherals, SoC support and purpose of the device it is expected to run on.

The specialty of Android lies in its ability to be customized and optimized, yet maintaining common components and standardized APIs. This allows the environment of application development to be more consistent. Of course, that also means the Android core images have a very large footprint to maintain this consistency or standardization. Additionally, this increases the surface for vulnerability profiles.

With Android, you have a large amount of functionality. Of late, some of the leading developments for supporting new graphic accelerators and SoCs appear first in Android environment. They are then pushed upstream to the other projects involving the Linux kernel.

What are Class D Amplifiers

The class AB type of audio amplifiers has been around for a long time, and most high quality ones are still typically class AB. Two things plague this excellently performing device – a quiescent bias current to keep the output semiconductors in their active region of operation and an operating efficiency that refuses to rise above 75%. In reality, this type of audio amplifiers operates with a compromise between frequency response, power output, low distortion and efficiency. Although special efforts and additional circuitry can improve the performance and efficiency of class AB amplifiers, it also makes the resulting audio amplifier prohibitively expensive.

To rid the audio amplifiers of their dependence on quiescent currents for biasing, the output semiconductors in a class D amplifier are switched on and off at a high rate. That allows the signal to appear at the output as chopped with respect to time. An averaging circuit transforms this chopped output back into analog form for feeding to the speakers. The result is an amplifier that has zero quiescent current requirement and efficiencies above 90%.

Class D amplifiers are also called digital amplifiers, of which there are two types. The first type is entirely digital while the second is a switching amplifier with analog control. Although both use switching power stages and exhibit high power efficiencies, the fully digital version has no feedback. The analog signal input is converted into digital using Analog to Digital converters and fed to the PWM switching output stage. However, achieving low distortion and good performance in all-digital class D amplifiers demands an extremely complex and expensive design.

In contrast, class D amplifiers with switching outputs but with analog controls are simpler to design and achieve very good performance with surprisingly simple circuitry. They can easily achieve extremely low output impedance over and beyond the audio range with equally low frequency-independent distortion levels.

Listening tests bear out the good performance shown in measurements. At low frequencies, because of low filter impedance, the bass is commanding and dynamic. Low THD and level response at 20 KHz produce transparent and neutral sound that real audiophiles admire.

With the music industry moving towards mobile gadgets as their main sound producing devices, interest in class D amplifiers is gaining momentum. With conservation of battery power at top priority, designers find the high efficiency of a class D amplifier very attractive. Fully integrated class D amplifiers that require the bare minimum components are now the norm in tablets and computers.

For example, the CX20952 is a high-definition audio codec from Conexant. It offers high-quality audio, low power consumption, two capacitor-free headphone amplifiers and a fully integrated class D amplifier. The intelligent single chip device keeps a check on the amount of power it delivers to the speakers, ensures maximum sound pressure levels and an optimal performance without allowing damage to system components.

With two headphone/line outputs, the CX20952 accepts a universal jack, while automatically detecting and configuring itself to different type of headsets. The single 3.5mm audio jack accepts various peripheral devices such as line-in, microphones, powered speakers, headsets and headphones.

How do rotary encoders work?

When tracking the turning of shafts, it is usually necessary to generate digital position and motion information. The most popular way of doing this is by using rotary encoders. They may be incremental or absolute, optical or magnetic, but they are used extensively in industrial and commercial designs in myriad applications. You will find rotary encoders being used on motors paired with automated machinery and drivers for nearly everything from robotics, position control and conveyor speed monitoring on automated industrial machines, elevators and consumer electronics.

Incremental encoders, mostly used for industrial applications, output the shaft’s relative position compared to a reference. In contrast, absolute encoders provide a different binary output for each position that defines a shaft’s position absolutely. Where incremental encoders define resolution as counts per turn, absolute single turn encoders define it as positions per turn, and express it as a multi-bit word. There are multi-turn encoders that track over multiple 360-degree turns and they specify resolution as positions per input-shaft turn along with the number of internal gear ratio turns.

Rotary optical encoders are the most widespread designs used. They typically consist of an LED light source, light detector, a code disk and a signal processor. Although the precision of the mechanical pattern on the code disk defines the measurement precision, there are other factors as well. For example, a quadrature encoder has several opaque regions that produce four distinct reference points. Two of these points correspond to the leading and trailing edges of the region itself. Another two additional points correspond to the leading and trailing edges of a second detector. Apart from providing higher resolution – four times of the code disc – it also indicates direction of turn depending on which detector responds first.

Incremental encoders are named after their outputs, which consist of two square waves, each corresponding to one increment of rotation. A convex lens focuses the light rays from the LED into a parallel beam. This passes through grid diaphragm, whose sole purpose is to produce a second beam of light 90-degrees out of phase to the original. Light from both channel A & B pass through a rotating disc onto the photodiode or photovoltaic array. The rotating disc creates a light & dark pattern as the clear and opaque segments interrupt the beam.

The absolute encoder has a nearly similar structure, except for multiple detectors and multiple unique tracks on the rotating disc. This produces a Gray Code output, which is a binary numeral system where the successive values differ by one bit. One advantage is this information is available even if the encoder has been temporarily shut down.

Although several methods are used to boost the resolution of direct-read encoders, the electric interpolation method is the most widely used. A voltage divider circuit subdivides the raw analog signal into the number of interpolation steps desired. The interpolation is actually a function integrated into the encoder logic and is transparent to the designer. This method allows for boosting the direct-read encoder resolution by about twenty times.

The compute module for Raspberry Pi

If you thought that the tiny single board computer, the Raspberry Pi (RBPi), could get no smaller, well, you really need to think again. There is now a Compute Module, which is much smaller. It contains the processor of the RBPi and 4GB of memory. The size of this board is roughly equal to a DDR2 laptop memory stick. However, the Compute Module is not exactly a miniaturization of the RBPi.

The advantage in fitting the system onto a small connector-less standard circuit board allows users to attach their own choice of interfaces. They need not be tied down to the built-in ports and devices that are available on the conventional RBPi board. The Compute Module is used along with a Starter IO board, which contains the rest of the devices.

The combination of the Compute Module and the Starter IO board is aimed at business and industrial users. The idea is to free the core technology of the RBPi to become an integral part of several new and exciting products and devices. The software of the RBPi is now full-featured and stable. A heroic community of volunteers is always hard at work constantly improving and improvising on the software. The manufacturers feel that this is the right time to free the hardware of the RBPi and make it more open.

Looking at the different types of users putting the RBPi to good use, it is really amazing to witness the huge number of products the community is developing around the tiny credit card sized SBC. The creativeness, ingenuity and inventiveness of the users are simply stunning. People are using the RBPi as not only a standalone module, but also embedding the tiny SBC into commercial products and systems. The dual combination of the Compute Module and the Starter IO board will make it even more versatile for these users.

The Compute Module contains the guts of the RBPi – the BCM2835 controller along with 512MBs of RAM. It also has a 4GB eMMC Flash memory, as a replacement of the SD card on the RBPi. Although all this is integrated onto a DDR2 SODIMM standard connector of the size 67.6x30mm and looks very much like a laptop memory card, it is not pin compatible to the memory card. Therefore, do not make the mistake of plugging in the Compute Module into a standard memory slot; it will only end in disaster.

The flash memory on the module is connected directly to the processor, but the remaining interfaces of the processor are freely available on the pins of the connector. That means you now have the full flexibility of the BCM2835 SoC. Compared to the original RBPi, many more number of GPIOs and interfaces available to the user on the Compute Module. That makes interfacing the Compute Module into a customized system should now be relatively simpler.

Although the Compute Module is aimed primarily at users who will be designing their own PCB, others not willing to go that far may use the Starter IO board. Snap the Compute Module into its connector on the Starter IO board and you are good to go.