Monthly Archives: February 2016

Raspberry Pi and a Simple Robot

Using a pair of DC motors and connecting them to two wheels can be the basics of a simple robot. Once you add a single board computer to this basis structure, you can do almost whatever your like with your robot. However, making a robot do more than simply run around requires many mechanical appendages that may prove difficult to get unless you have access to a workshop or you are proficient with 3D printing.

To simplify things for beginners, the robot chassis from Adafruit is a versatile kit. With this simple robot kit and a single board computer such as the Raspberry Pi or RBPi, you can start your first lessons in robotics.

As the kit is for beginners just starting with their first robot, there are no sensors. A Motor HAT (Hardware Attached on Top) controls two motors connected to two wheels on a chassis. The front of the chassis has a swivel castor, which makes it stable. The RBPi mounts on the chassis and a battery supplies the necessary power for the SBC and the motors.

Once you are familiar with generating a set of instructions in Python to make the robot move the way you want it to, you can start adding sensors to the kit. For example, simply adding a camera will allow the robot to see where it is going. Adding an ultrasonic range finder will allow the robot to avoid bumping into obstacles in its path.

The Mini Rover Robot Chassis Kit from Adafruit includes almost everything one needs to build a functional robot. It has an anodized aluminum chassis, two mini DC motors, two motor wheels, a front castor wheel, and a top plate with standoffs for mounting the electronics.

It is convenient to use the latest RBPi models such as the Model 2, B+, or A+, as these have suitable mounting holes that allow easy attachment to the robot chassis. Although it is also possible to use the RBPi Zero, its small size makes it unsuitable to mount the motor HAT securely.

The Motor HAT can drive DC and stepper motors from the RBPi and is suitable for small robot projects. The brass standoffs help to hold the Motor HAT securely to the RBPi. Power comes from two sources. One 4x AA battery pack supplies the motors. Another small USB battery pack powers the RBPi. The RBPi also requires a Wi-Fi dongle to keep it connected to the computer and to control the RBPi robot.

Your RBPi must be running the latest version of the Operating System – Raspbian Jessie. If you do not have this, allow the RBPi to access the Internet and download the necessary software.

The Motor HAT library examples included provide adequate software for this project to start. For example, you can use the example scripts provided to make the robot move forward, backward or to turn in different directions. Preferably, place the robot on level ground, where there are no obstacles. As the robot has no sensors, it can hit something or easily fall off the edge of a table.

Remote Controlled Car with a Raspberry Pi

A single board computer such as the Raspberry Pi or RBPi can work wonders on a remote controlled car. Running Python on the RBPi allows it to handle three tasks a remote controlled car needs most – self-driving on a track, detection of sign and traffic lights and avoiding front collisions. The RC car has three subsystems – input units consisting of a camera and ultrasonic sensors, a processing unit and a control unit.

The processing unit on the RC car communicates with the RBPi to handle several tasks. These include receiving data from the RBPi, training, and predicting the neural network, detecting objects, measuring distances, and sending instructions to the Arduino through the USB connection.

The computer also runs a multithread TCP server program for receiving streamed image frames and ultrasonic data from the RBPi. The computer converts the image frames into gray scale and decodes them into numpy arrays.

To make object recognition and steering simple and fast, the RC car uses a neural network. The advantage is once the network is trained, it can work with only the trained parameters, making predictions very fast. The output layer of the network has four nodes corresponding to the steering control instructions – forward, reverse, left, and right. The input layer has over 38,000 nodes and uses only the lower half of the input images for training and prediction.

Although the project uses the shape-based approach for object detection, it only focuses on detecting the stop sign and traffic lights. Detection and training was both using OpenCV using both positive and negative samples. Positive samples are images that contain the desired object while negative samples are random images without the desired object.

The controller on the RC car needs four low-going signals corresponding to the forward, reverse, left, and right actions. Four pins on the Arduino provide these signals simulating button-press actions that drive the RC car.

The ultrasonic sensor measures the distance of an obstacle in front of the RC car. This includes measuring proper sensing angle and other surface conditions. Other measurements from the Pi camera allow the RC car to stop at the correct distance from the object.

The monocular vision approach of the RC car makes it difficult to get accurate distance measurements. In turn, other factors also influence the distance measurement, which includes errors in the actual measurement, variations in detecting the bounding box of the object, and nonlinear relationship between distance and camera coordinates. The error increases when camera distances are great and the camera coordinates are changing rapidly.

The traffic light recognition process uses image processing for detecting red and green lights. First part of the training involves detecting the traffic light by decoding its bounding box. Next, Gaussian blur reduces the image noise to find the brightest point within the bounding box. Finally, red or green state determination within the brightest spot detects the actual state of the traffic light.

The project uses an RBPi Model B+, a Pi camera and an ultrasonic sensor, HC-SR04. The RBPi streams ultrasonic sensor and color video data via its local Wi-Fi connection. It scales the video down to QVGA resolution to achieve low latency.

Scientists Develop Power Paper for Storing Charge

Swedish researchers at the Laboratory of Organic Electronics of Linkoping University have prepared a special kind of paper that can store electrical charge. The paper constructed from Nano cellulose and a variety of conductive polymer can stock up as much charge as stored by super capacitors available currently.

Improving upon thin film capacitors

Xavier Crispin who is the professor of organic electronics explains that the paper capacitors are superior to the very thin film capacitors, which have been around for some time. Being few tenths of a millimeter in thickness, they can be considered to have a three dimensional structure compared to the film capacitors. The paper can be produced in varying thicknesses.

Details of the fabrication of the paper capacitor have been published in Advanced Science. Apart from Crispin, who is the principal author of the scientific paper, several other scientists from the Technical University of Denmark, University of Kentucky, KTH Royal Institute of Technology and Innventia have also contributed to the article, based on their research.

A 15cm wide sheet can store about 1Farad of electricity, which is roughly the same capacity as that of the super capacitors. The paper can be charged up to hundreds of time and each charging cycle takes up only a few seconds.
The researchers feel that these paper capacitors could provide diverse storage capacities for stocking up energy from renewable energy sources for different weather conditions including sunny, cloudy, calm, and windy.

Robust structural foundation

The basic material of the paper is Nano cellulose. This consists of fibers of cellulose broken down into strands as narrow as 20 nm by passing water at very high pressure through it. The Nano cellulose fibers are made into a suspension with water. This is treated with an electrically charged emulsion of a PEDOT:PSS polymer in water. The polymer coats the fibers to give it a plastic feel.

The space in between the tangled fibers is filled with the water-based electrolyte. The conductivity for electrons and ions in the electrolyte is a record high. This makes for the especially high energy storage capacity. The scientists expect that the capacity can be increased further by adjusting the fabrication process.

Advantages over conventional storage units

Since it is derived from easily accessible raw materials like renewable cellulose and polymer, the researchers expect that power paper will gain popularity as a storage device. It is light and wieldy. Furthermore, it is environmentally friendly, as the manufacture process does not require heavy metals and other harmful chemicals. A particularly convenient feature is that it is waterproof.

The technique for making the power paper is almost the same as used for making regular paper from wood pulp. The difference lies in the addition of polymer coating on the Nano cellulose strands. Professor Magnus Berggren of Linkoping University reveals that the real challenge is developing the paper on an industrial scale. He hopes that the grant of SEK 34 million awarded by the Swedish Foundation of Strategic Research will help them in their endeavor to develop a machine for their production. The Knut and Alice Wallenberg Foundation are supporting the research, as well.

Virus for Converting Mechanical Energy to Electrical

The most common device that converts mechanical energy to electrical is the electrical generator – it is actually a motor run in reverse. Other ways of converting motion into electrical energy is also available, for example by using piezoelectric devices. Now, scientists have developed a new means of converting energy – using a harmless but specially engineered virus.

The device is an electrode the size of a postage stamp. The virus coating on the electrode produces enough current to drive a liquid crystal display, simply by tapping a finger on the electrode. Scientists claim they have used the piezoelectric properties of a biological material for the first time.

Electrical charge that mechanical stress can build up in solid materials is termed piezoelectricity. This principle is commonly used to harness energy from everyday events, such as walking, doors closing or opening, or even typing on a notebook. However, many of the piezoelectric material we use today are toxic.

To encourage the widespread use of safe piezoelectric materials, scientists tried using a particular virus M13 common to laboratories all over the world. M13 not only shows piezoelectric properties, it targets bacteria and is harmless to people.

The scientists wanted to confirm the piezoelectric behavior of the M13 bacteriophage. For this, they made a film from the virus and exposed it to an electric field. Inspection through a special microscope revealed moving helical proteins. These proteins coat the rods of the virus. Their movement was the final confirmation of the piezoelectric effect shown by the virus.

By genetically engineering the virus, scientists were able to boost the charges induced in the virus still further. For this, they added an extra four negatively charged amino acid residue to one end of the helical proteins of the virus. This added benefit to the use of the modified M13.

According to the scientists, the viruses self-arrange the film, enabling it to regenerate itself. The virus reproduces by infecting bacteria, generating millions of copies of its self by overnight. Scientists are of the view that such replication and self-arrangement can prove beneficial for self-assembly of Nano-technology. They boosted the charge further by stacking several virus films into layers. A stack of 20 layers provided the strongest piezoelectric effect.

The modified M13 stacks of virus made by the scientists can develop a potential difference of over 400 millivolts and capable of generating an electric current of nearly six Nano-amperes. This is enough to drive an LCD.

Imagination is the only factor limiting the applications of an M13 virus film. For instance, your laptop casing may be painted with a layer of this film. The viruses will convert any pressure from your hands into electricity and this will constantly charge the battery. In fact, when painted on the keyboard, each time you hit a key, the generated electricity will augment the battery power.

Since you can power the M13 by any kind of motion, you could conceive of powering your house by simply walking over a virus-coated floor, or power your smartphone by jiggling it in your pocket.

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.

Controlling Gestures with the Gest Glove

With the adjustable palm strap, it is easy to fit the Gest Glove on to any hand and you simply slip on the four moldable mounts on the fingers. The Gest Glove offers the best efforts so far for improving on the human-to-computer interface presently in use all over – the keyboard and mouse combination. The Glove provides gesture controls similar to those depicted in Minority Report. The Gest is a four-finger glove-like design from Apotact Labs, allowing control of a computer and mobile devices with hand movements.

Apotact Labs describes Gest as a digital toolkit with two components – the gesture controller to slip on to your hand, and an SDK or Software Development Kit to allow building new applications for the platform. The gesture controller has four moldable finger mounts and fits any hand because of its adjustable palm strap. With 15 distinct sensors on each hand, two Gests may allow typing on any surface. Each finger has the same standard magnetometer, gyroscope and accelerometer combination found in most smartphones, contributing to its controller’s finer precision and accuracy.

The Gest has software to allow sensing small movements. That allows the software to create a personalized model based on monitoring and learning the movements of a user’s hands. The software adapts to a user over time, with the model being unique to each user. According to Apotact Labs, Gest offers highly accurate and precise gesture control.

There are other gesture controls available in the market. One of them is the Myo armband manufactured by Thalmic Labs. This device utilizes extensive gestures from muscle-controls to control a large number of devices. Another is the Leap Motion controller, which is smaller. This device uses infrared cameras and rays to create a model from your hand movements. Compared to the above, the Gest Glove from Apotact Labs offers a higher degree of accuracy using smaller movements. That will certainly appeal to designers and artists looking for more precision.

For example, you can use the Gest Glove right out of the box, as it will come built-in with a five standard gesture library for use with the Adobe Photoshop. A twitch of a finger allows switching between apps. The mouse cursor moves along when you point your finger at the screen and move it. You can adjust the Photoshop sliders with a simple twist of your palm. If you have 3D objects on the screen, just grab them and rotate them in your hand – they will rotate on the screen as well.

Designers who do not want to use the skeletal models and motion-processed data custom-built into Gest, can access its raw sensor data. With the Java and Python APIs provided, designers can use the raw sensor data to create their own models. Future generations of the Gest may make use of a typing proof-of-concept being worked on at the Apotact Labs. This is likely to use a neural net to handle word prediction. The concept will use tow Gest Gloves, one on each hand, allowing the user to turn any surface into a keyboard. However, this is still in the experimental stages.

The Raspberry Pi Goes to Zero

If you thought the legendary Raspberry Pi or RBPi was the smallest single board computers could get, well, you need to think again. Not only has the famous SBC shrunk in size, it has become a lot cheaper as well. The charitable Raspberry Pi foundation that launched the best selling computer in the UK is now offering their next model, the RBPI-Zero and in the US, it costs just $5.

RBPi-Zero comes with a 512MB RAM and a core that boasts of being 40-percent faster than what the RBPI-1 came with. The miniaturized SBC sports a Mini-HDMI port and two Micro USB ports, one of them for power. While comparing the RBPI-Zero with the first RBPI, the Raspberry Pi Foundation says the RBPI-Zero is equally revolutionary. They explained it would be manufactured in Wales, run the full Raspbian, while including other applications such as Minecraft and Scratch.

Similar to the requirements for the RBPi, the RBPi-Zero requires the user to attach their own power supply, keyboard, mouse or any other input device and the display screen. The cost of the new board is low because several components from the RBPi board are no longer present or have been simplified for the RBPi-Zero. According to Uben Upton, the founder of Raspberry Pi, all components on the new board justify their existence.

However, cutting features was not the sole process of getting the RBPI-Zero down to the bare-bones pricing of $5. The major contribution comes from the grand success of its predecessor, the RBPi, being the most successful computer in the UK for decades. The massive sales have enabled the Foundation to cut costs to unimaginable levels. The sheer numbers in sales have given them the economies of scale.

One of the processes in reducing the cost of the RBPi-Zero was keeping all components on one side of the board instead of two – it simplified manufacturing by removing half the assembly costs. According to Upton, they have moved the physical product around and the cost of metal connections has made an impact.

By redesigning the RBPi-Zero, the engineering solution to the necessities of space and cost has resulted in an extraordinarily aesthetic board. The precision and beauty of Zero comes out in its compactness and its symmetry. Just like its predecessor, nothing is hidden and all its inner workings are exposed to anyone with an interest. As Upton says, it is nice when things look attractive because they are functional.

The small form factor of the RBPi-Zero makes it simple for the board to be used in many more projects, whether it is robotics or Internet-connected devices. The easy to use board massively increases creative possibilities. You can use the RBPI-Zero in places where the RBPi would be difficult to fit. Presently, the Zero, a full-featured computer, will provide raw power somewhere between the first generation of the RBPi and its second generation.

The launch plans for the Zero are massive, with tens of thousands ready to ship. Raspberry Pi magazines such as the Magpi will feature a freebie RBPi-Zero with its 10,000 issues. Upton is expecting five such launch partners.

The 64-bit x86 SOC from AMD

Advanced Micro Devices or AMD is offering a new Embedded, R-Series SOC processor. Targeted at a range of application markets, the System-On-Chip processor will handle industrial control and communication networking along with digital signage, high-end gaming and media storage. The new AMD device follows the Platform System Architecture, Specification 1.0, of the HSA Foundation. The Heterogeneous System Architecture offers greater efficiency in parallel processing.

In the new Embedded R-Series SOC, AMD as combined its next-generation x86 Cores called Excavator, with its third-generation GCN or Graphics Core Next architecture. According to Colin Cureton, Senior manager for embedded products in AMD, this combination offers a substantial boost in performance as compared to their previous generation.

This is evident from the presentation made by Cureton. Benchmark scores show nearly 25% increase in the performance of the CPU with about 23% increase in the graphics performance as compared to present devices. Not only this, the chip also incorporates the Southbridge chip. As this is an external chip for current devices, the new chip offers developers a footprint reduction of 30% on the board.

As the R-Series SOCs have advanced power management built into them, the feature allows a performance boost without requiring any increase of power input. Cureton explains that the BIOS and the Operating System control the thermal envelope within which the device can operate safely.

Developers can use the cTDP or configurable Thermal Design Power to specify a tradeoff between the power consumed by the chip and its performance. They can adjust the TDP anywhere between 12-35W in increments of 1W. According to Cureton, even when running at 15W, the power level of operation of previous generation chips, the R-series has greater graphics performance.

Although the device offers raw performance specifically for embedded applications, there are other features as well. Within the chip, a dedicated secure processor performs an HVB or Hardware Validated Boot. That creates a trusted boot environment for the SOC before it can start up its x86 cores. The chip can handle upcoming changes in memory technology with ECC – presently supporting either DDR3 or the DDR4 types of memory. Other industry interfaces supported include USB3.0, POIe Gen.3, SPI, SATA3 among others. As industrial embedded designs require long product lifecycles, AMD assures a 10-year supply for their R-Series SOCs with plans of extended-temperature versions.

Apart from industrial, the R-Series SOC targets other application spaces also. The chip can support two or three displays simultaneously, while providing 4K graphics and video decoding as demanded by high-end gaming machines such as those in a casino. The device can also replace FPGA and DSP combinations presently used for medical imaging and image transformations. This is possible because of the HSA architecture, which eases the task of software-defined beam forming. As its GPU allows processing of several algorithms, the x86 architecture of the R-Series is gaining in dominance in the control plane for communications as well.

The HSA architecture that the R-Series has adopted gives it the ability to use the GPU as an auxiliary compute engine for non-graphics applications also. Rather than being only a slave to the CPU, the HSA turns the GPU into another computing node, increasing the efficiency.

Non-Volatile Memory from Carbon

So far, many problems have inhibited development of carbon based memory devices. Not any more, as IBM and the EMPA have solved those problems and come up with the possible use of oxygenated amorphous carbon for non-volatile memory applications. The new non-volatile memory is based on a Redox reaction that takes place in thin films of oxygenated amorphous carbon known as a-COx. The film is a process of PVD or Physical Vapor Deposition.

EMPA, the Swiss Electron Microscopy Center and IBM, Zurich, have published the details of their research. The latest release about their work discusses the results of device measurements. IBM is now a holder of a patent in this area.

Earlier research in this field has shown carbon and carbon nanotubes to possess some potential for NV memory application. However, development in the direction of products did not proceed because of lack of reproducibility, processing difficulties and limited write/erase endurance.

Amorphous carbon, because of its high electrical resistance, has not been receiving much attention. People have been studying the electrical properties of other allotropes of carbon. They have been focusing on carbon-based electronics as a challenge to silicon or as its follow-on.

However, the high electrical resistance of amorphous carbon is of immense importance as far as memory applications are concerned. The latest research on the use of oxygenated amorphous carbon for NV memory application has the added advantage of being able to use the conventional silicon-compatible process of thin-film deposition.

Manufacturers fabricate memory devices on a 500nm thick thermal film of silicon dioxide, which forms on a substrate of silicon wafer. A tungsten film forms the bottom electrode and it has circular pores delineating its active contact area. The pores are etched in the 35nm thick silicon dioxide film overlaying the tungsten and the pore diameters range from 100nm up to 4µm.

In the next step, manufacturers use a graphite carbon target in oxygen for physical vapor deposition of the a-COx active material into the pores, which then makes contact with the bottom electrode. A platinum top electrode metal deposition finally completes this planar sandwich construction. However, before the deposition of the COx, any native oxide is removed from the surface of the tungsten electrode by sputter cleaning. This is an important step, as it ensures non-contamination and non-compromise of the part of the Redox action involving the tungsten and Cox interface.

The next stage necessary is the forming step for bringing the memory device to its normal operating state. For this, a triangular shaped pulse of positive polarity is applied to the bottom electrode. As the applied voltage nears the forming voltage Vf of around 4-5V, a function of the thickness, there is an abrupt increase in the current flow through the cell. This switches the cell from its virgin state to an LRS or low-resistance state, which is also called its SET state. A sequence of 1µs-wide triangular pulses may also be used for forming the a-COx cells.

The device can be brought back to its HRS or high-resistance state or RESET state by applying a 10ns pulse of negative polarity to the bottom electrode. This does not require the use of the built-in current limiting resistor.

How do Wi-Fi Antennas Work?

Antennas are necessary for transmitting and receiving the radio-frequency energy that forms the basis of Wi-Fi communications. The underlying rule is you need a better antenna to improve coverage. Understanding fundamentals is essential for selecting a proper antenna for your application.

In general, antennas radiate radio waves when fed with the right kind of electrical power. Conversely, an antenna can also covert radio waves received by it into electrical power. There are different forms of antennas, some created intentionally, such as those on your wireless router, and others created naturally, such as the wires on your earbuds, which act as antennas. Antennas are usually directional, meaning they are better in transmitting and receiving radio waves in some directions than in others. However, there are omnidirectional antennas that work nearly equally in all directions.

Wi-Fi antennas are mostly dipole types, or more specifically, half-wave dipoles. They consist of two halves, each equal in length to a quarter of the wavelength they are to transmit or receive. A separate conductor from the feedline feeds each half separately. For example, for a frequency of 2.45GHz, a half-wave dipole antenna would be 61.22mm from one end to the other, while each half measuring 30.61mm. However, other parameters also affect the length of the dipole and the resulting antenna may differ considerably from theoretical calculations.

Examining a Wi-Fi antenna from a 2.4GHz wireless router reveals a hinged base connected to a plastic cover. The hinge allows antenna rotations irrespective of the mounting position of the router. Within the plastic cover, you can see the entire dipole antenna. One-half of the dipole is made of a metal cylinder through which the feeder wire passes. The other half is the wire itself that protrudes to the other side of the cylinder. With the metal cylinder and the wire insulated from each other, they form a dipole of approximately one-quarter wavelength long. Such antennas have a gain of about 2dBi and their radiation pattern is circular.

The antenna connects to the Wi-Fi radio transceiver via a wire feedline – a coaxial cable. This has an insulated inner copper conductor covered with an outer braided shield made of copper wires. A clear plastic cover encases the entire feedline. Wi-Fi devices use these feedlines, also known as coax and designated RG-178, specifically for their small size and relatively low RF losses.

Antennas are usually better in transmitting and receiving radio waves in certain directions. Their ERP or Effective Radiated Power is greater in those directions. Although the total radiated power remains the same, antenna gain refers to the increase in strength in several directions than in others. Therefore, simple horizontal dipoles show gain in two directions – parallel to the radiators on both the front and backsides.

Depending on the country that is using the Wi-Fi signals, there are five different bands of transmission – 2.4GHz, 3.6GHz, 4.9GHz, 5GHz and 5.9GHz, with correspondingly matched antenna lengths. Although the general principles apply to all bands, the most widely used transmission for Wi-Fi signals is the 2.4GHz band. Usually, this extends from 2.4GHz to 2.5GHz.