Author Archives: Andi

Different Types of Light Sensors

Light falling on to the surface of a light sensor generates an electrical output proportional to the strength of the incident illumination. The sensor responds to a band of radiant energy existing within a narrow range of frequencies in the electromagnetic spectrum, which we characterize as light. These frequencies range from the infrared to the visible and continue to the ultraviolet region of the spectrum.

Most light sensors are passive devices for converting the light energy of the spectrum into electrical signal. Light sensors are also known as photo sensors or photoelectric devices, since they convert photons into electrons. We can group photoelectric devices into two main categories. One generates electricity when illuminated – such as photovoltaic or photo-emissive, etc. and the other changes their electrical properties in some way – such as photo-resistors or photo-conductors, etc. Accordingly, the following classification emerges.

Photo-emissive cells

These are formed from light sensitive material such as cesium. When struck by a photon of sufficient energy, the light sensitive material releases free electrons. As high frequency light contains photons of higher energy, they have a better chance of producing more electrical energy.

Photo-conductive cells

The electrical resistance of these cells varies when subjected to light. They are made of semiconductor material and the light hitting it causes photoconductivity, which controls the current flow through the material. Cadmium Sulphide is the most common material for making photo-conductive cells, such as the light dependent resistor or LDR.

Photo-voltaic cells

These generate an EMF or electromotive force proportional to the radiant light energy falling. Although similar in effect to the photo-emissive cells, these are made up of two semiconductor materials sandwiched together. Solar cells are the most common photovoltaic cells in existence.

Photo-junction devices

These photo-devices are made of true semiconductor devices such as PN-junctions that use light for controlling the flow of electrons and holes. Specifically designed for light penetration and detection applications, their spectral responses are tuned to the wavelength of light expected to be incident on the device.

Applications of light sensors

LDR photocell: The Cadmium Sulphide photo-resistive cell is the most common example of this device. The resistance of these cells when not illuminated is of the order of 10M ohms, which reduces to the level of 100 ohms when fully lit or illuminated. As the voltage drop across a resistor increases with its resistance value, an LDR photocell can generate different voltages in a potential divider circuit based on the amount of light falling on it.

Light activated switch: This is basically a dark sensing circuit, with a light sensor in series with a potentiometer forming one arm of a simple resistance bridge network and two fixed resistors forming the other side of the bridge. By changing the potentiometer, one can balance the bridge when the light sensor is illuminated, for example by sunlight. The absence of sunlight causes the bridge to unbalance and the resulting potential difference is amplified by an operational amplifier to operate a relay or a switch.

Today, it is common to find cameras that do not operate with a film, but with charge coupled devices that convert the light falling on them to an electronic image.

MEMS Technology Helps To Measure Flow

Smart technologies are creating compact and lightweight sensing elements. Apart from being optimal, fast, and efficient solutions, these are not limited to only the data input functions as the conventional sensing technologies are. Rather, they integrate the areas of sensing and control while offering high-value information that humans or systems can subsequently process. Several unique and advanced technologies such as MEMS form the concept of sensing and control expertise. For example, flow sensors use the ButterflyMEMS technology to operate.

Flow sensors using the MEMS technology operate with major advantages. For example, they can easily measure flow speed ranging from 1 mm per second to 40 m per second. To understand this better, ButterflyMEMS technology can sense the fluttering of the wings of a butterfly and the roar of a typhoon with equal ease. A tiny MEMS flow sensor does all the work and it is the size of a 1.5 mm square chip, which is only 0.4 mm thick.

Conventionally, flow sensors have been using the method of resistance measurement. The method senses the change in electrical resistance of a filament because of a change in temperature caused by the flow of material across the filament. Balancing the resistance of the filament is a time-consuming method, which forms the major disadvantage of this method and makes it expensive.

In contrast, the MEMS flow sensor utilizes a thermopile, an element that converts thermal energy into electrical energy. This technology offers several advantages not seen earlier. For instance, MEMS technology offers cheaper operation, only a few adjustments, high sensitivity, and low power consumption.

This advanced sensor can even sense the direction of flow. The chip has two sets of thermopiles located on either side of a tiny heater element. The thermopiles measure the deviations in heat symmetry that the gas flow causes. The chip senses the direction of flow based on a positive or a negative deviation. A thin layer of insulating film covers the sensor chip and protects it from being exposed to the gas.

In the absence of flow, temperature distribution remains uniform around the heater and there is no differential voltage between the two thermopiles. With even the smallest flow, the heat symmetry collapses, as the thermopile on the side of the heater facing the flow shows a lower temperature, while the thermopile on the other side is warmer. This temperature difference causes a differential voltage to appear between the two thermopiles. This voltage is proportional to the mass flow rate.

The superb characteristic of the sensing chip comes from an unusual shape created by a unique etching technology. Compared to the conventional silicon etching, this unique etching technology creates a larger sensing area in the same volume. This results in a cavity design enabling heating with greater efficiency while keeping the power consumption low. Additionally, the cross-point of temperature characteristic can be factory adjusted, which results in high output stability even when the ambient temperature fluctuates.

Within the actual sensor, a set of screens in the sensor inlet produces a uniform, laminar flow through the sensor offering optimal mass flow readings. An orifice in the outlet side of the sensor buffers against pulsing flows.

Which Raspberry Pi Should I Use?

Which Raspberry Pi or RBPi you will use is getting more and more difficult to answer as the family keeps growing. It was simple and straightforward when the RBPi first launched – there was only one model. Since then, with four major models to choose from, things are more complicated. However, this versatile beast comes in different specifications and you should select the one most fitting your requirements. Among the models available, here is a summary to help you decide:

RBPi Zero

This is the latest addition to the family. Although it is ultra-cheap, the RBPi Zero is definitely a fully functional single board computer. Compared to the first model of family, the processor used in the RBPi Zero is more than 40% faster. However, purchasing this variant compels you to make major compromises.

To start with, you will need adapters to use the mini HDMI and micro USB ports on the device. As there is no on-board Ethernet port, you need to use the single USB port. Although you can expand its functionality by adding a powered USB hub, the additions begin to detract from the major selling point of the Zero – its tiny footprint.

If the application does not require a fair amount of connectivity, is low-powered and for single-use, you may consider using the RBPi Zero.

RBPi Model A+

Although a full-sized version, this model also lacks the Ethernet port and has only one USB port. Moreover, it has only 256GB RAM that goes with the 700MHz processor. The price and lack of power makes it difficult to recommend the RBPi Model A+ for any application other than for specific ones.

RBPi Model B+

If performance is not a criteria and price is the only consideration, then the RBPi Model B is hard to beat. The model offers good connectivity as it has on-board Ethernet, four USB ports and a full sized HDMI connector. That makes the RBPi Model B+ more versatile than either the Model A+ or the RBPi Zero.

You can use it for any project that requires good connectivity, less than top-notch performance, and low power.

RBPi Model 2

This is the top-of-the-line model in the family and a surprisingly capable beast. With an updated chipset, a quad-core processor and 1GB RAM, the RBPi Model 2 makes a major difference in the large variety of Single Board Computers available in the market.

You can use the RBPi Model 2 as a media server for your network or use it for tasks of more intensive nature such as running a home surveillance system or playing games. It also allows you to explore platforms other than Linux – you can run the IoT version of Windows 10.

Even though the total power consumed by the RBPi Model 2 is below 1W, it uses significantly more power as compared to its predecessors. For example, RBPi Model 2 consumes more than 33% power drawn in by the RBPi Model B+ and five times more power than what the RBPi Zero consumes. Use the RBPi Model 2 for anything where you need good performance.

Check our other guides for information on Model 3.

Rectannas : Will They Make Solar Cells Obsolete?

Professor Baratunda Cola and colleagues at the Georgia Institute of Technology, Atlanta, claims to have improved on the solar cells available. They have reported their findings in Nature Nanotechnology. The new type of solar cell is actually a rectenna – half antenna and half rectifier that can be tuned to any frequency as a detector, while generating electricity from solar and infrared light falling on it.

The team claims they can achieve a broad-spectrum efficiency of 40 percent with their new cell, although the efficiency they have achieved so far is only one percent. Comparatively, conventional solar cells such as the silicon and multi-junction gallium arsenide types have a maximum efficiency of 20 percent. The team also claims their rectenna can achieve an upper limit of 90 percent efficiency for single wavelength conversion at only a one-tenth the cost of conventional solar cells.

The theory of rectennas is not new, but was discovered more than 50 years ago. However, so far, technology was not advanced enough to fabricate them. According to Professor Baratunda Cola, with currently available technology, it is now possible to make cheap solar-to-electricity converters from carbon nanotubes with ends turned into a special tunnel diode. Cola says the concept is well suited for mass production.

Rectennas are made by growing fields of vertical carbon nanotubes. Their length roughly matches the wavelength of the energy source – for solar radiation, it is one micron. An insulating dielectric such as aluminum oxide caps the carbon nanotubes on the tethered end of the bundles. On the dielectric grows a low-work function of metal – calcium/aluminum. This arrangement makes each nanotube a rectenna with a two electron-volt potential when collecting sunlight and converting it to direct current.

According to Cola, the process uses three steps. In the first step, they grow a large array of vertical nanotube bundles. Then one end of the tubes is coated with a dielectric, while a layer of metal is deposited. One end of the nanotubes changes to a super-fast metal-insulator-metal type of tunnel diode by this process. This method is eminently suitable for mass production, and up to ten times cheaper than making crystalline silicon cells.

With its metal-insulator-metal form, the structure resembles a capacitor with a rating of a few attofarads (1aF = 10-18F). Each nanotube bundle is only 10-20 microns in diameter and consequently, the area of the capacitor plates is so small that the electrical field concentration at the end of the nanotube is very high. With the low work function of the metal, the device behaves just as a tunnel diode does in the peta-hertz (1015 Hertz) region when excited by solar energy and emits electrons in bursts of femtoseconds (10-15 seconds).

Commercialization will require several trillions of nanotube bundles growing side-by-side. Once optimized for higher efficiency, this bunch of nanotube bundles could ramp the power output well into the megawatt range. According to Cola, increasing the efficiency can be achieved by lowering the contact resistance between the antenna and diode. The team expects to improve the efficiency up to 40 percent in only a few years.

Controlling RGB LEDs via the Raspberry Pi

Digital gates are great for switching LEDs on or off. Micro-controllers are even better and so are single board computers. That is because they contain several gates to control the LEDs. To top it all, you can program single board computers such as the RBPi or Raspberry Pi to control several LEDs individually to run at different on/off cycles. Additionally, multiple color LEDs are available, such as RGB LEDs, with which you can generate any combination of the basic red, green and blue colors.

Although the GPIO pins of the RBPi can switch on an LED, the pins cannot supply beyond their limit. Therefore, when driving LEDs from the GPIO pins, a current limiting resistor is necessary in series with the LED, to prevent the IO pin from being damaged. The resistance value will depend on how much current the IO pin can source or sink, and the supply voltage of the RBPi or LED.

The RBPi has a 40-pin GPIO header among which, you can control several pins through software. The most common use of external circuits and LEDs with GPIO pins is to indicate status visually. For example, you may be controlling a remote circuit with software, and an LED nearby can indicate its status. The LED lights up to indicate the remote circuit is powered.

It is a good thing that human eyes have something called the persistence of vision. When we see something, its image persists in our eyes for a brief time. Therefore, we can see flashing lights only when they are flashing relatively slowly. Beyond a certain speed, our eyes cannot make out the individual flashes and the flashing light looks as if it is steadily lit. Using a technique called PWM or Pulse-Width Modulation, and controlling the on time of a GPIO pin through software, we can make an RBPi drive an LED such that it looks as if the LED is breathing. Doing the same with an RGB LED, the RBPi can cycle the lights to produce any color in the rainbow.

You can build a simple RGB LED board with a single bright RGB LED, three current limiting resisters and a four-pin connector on a prototype PCB. RGB LEDs have four pins and come in two configurations, common cathode and common anode. In the common cathode configuration, the package combines the cathodes of all the three LEDs into a single pin with the anodes individually available. For the common anode configuration, all the three anodes are combined into one pin, while the cathodes are individually accessible.

To drive an RGB LED you will need to connect its individual anodes or cathodes to three GPIO pins through current limiting resistors. If you use a common anode RGB LED, you will have to connect its common anode to a supply voltage. For a common cathode RGB LED, you will need to ground its common cathode. Now, you can switch on an individual LED of the combination by switching on the corresponding IO pin. See this tutorial for writing simple Python scripts for controlling the LEDs via the RBPi.

How To Compensate Cable Voltage Droops?

Not only ordinary wires, but also USB cables can cause voltages to droop. This is evident if you have used an extra long USB cable and found that the device you were charging, such as your phone or tablet, was taking an extra long time to charge. The reason is the excessive voltage drop across the long USB or Universal Serial Bus cable.

Most chargers come with overcurrent protection. That means when the charging current exceeds a certain limit, the charger reduces its output voltage to prevent the charger from burning up. Moreover, when the charging current is high, the cable resistance causes the voltage at the device end to droop, increasing the charging time considerably. Since resistance increases with cable length, the voltage drop is also more with a longer cable. Hence, cable voltage droop has a negative impact on the operation of the system.

Proper charging and time taken is a critical design parameter for a device under load. With system load located at a distance from the output of the power supply, the absence of remote sensing may cause the voltage seen by the load to be significantly lower than desired. Contribution to the voltage droop is from thin circuit board traces, connector interface and cabling resistance. The situation gets worse when load currents are higher, decreasing the operational voltage at the load and causing possible erratic circuit operation.

A typical USB cable uses four wires of 24AWG each about a meter long and has a contact resistance of about 30 milliohms per contact. As a USB cable used for power transfer uses four connections (two on each cable end), the total contact resistance is 120 milliohms. The two one-meter wires of 24AWG have a total resistance of 166 milliohms. That makes the overall resistance of the USB cable to be 286 milliohms.

Typical converters are designed to supply a maximum output current of 2.1A. That means the voltage drop across the cable would be 0.6V when it is supplying maximum current. The voltage expected at the end of the cable would drop to 4.4V for a 5V set-voltage converter. This is much lower than the maximum lower-limit of most loads working at 5V and this may lead to potential issues with high-current loads.

Designers overcome this voltage drop by increasing the output voltage at the source. Instead of the fixed 5V, the converter would generate 5.6V, which after the 0.6V drop would present the necessary 5V to the load. They do this by monitoring the load current by adding a sense resistor in the path of the output current. A differential operational amplifier amplifies the voltage across the sense resistor and this voltage causes the output voltage to increase with increasing load.

As the load current increases, so does the output voltage of the converter. However, at the end of the cable, the compensated voltage is nearly a constant figure, representing a well-regulated voltage.

Compensating the output prevents the voltage at the load from drooping. This avoids potential system issues such as power cycling, latch-up conditions or decreased system performances.

Android vs. Linux – Which OS is better?

Is Android A Better OS Than Linux?

Android has established itself as an important operating system for mobile devices. Google developed Android as an open source OS based on the Linux kernel. Google selected the Linux kernel because of its proven driver model, existing drivers, process and memory management, networking support and several other core operating system services. However, the Google team had to make several changes to make Android capable of operating mobile devices successfully. Differences with standard Linux are highlighted here.

The target architecture

Although the Linux kernel supports several architectures, right now, Android supports only two: ARM and x86. The ARM platform is more prevalent on mobile phones while the Android-x86 targets mainly the Mobile Internet Devices or MIDs used for general-purpose desktop/laptop/server computing systems. This being the fundamental difference between the two Operating Systems, it provides a strong insight into further divergence between the two.

Modifications in the kernel

Android does not use the standard Linux kernel straightaway, but uses it with some enhancements. These include alarm driver, shared memory driver, inter-process communication interface, power management, low memory killer, kernel debugger and logger. Google has contributed all the kernel enhancements back to the open source community under GPL.

Bionic C library

The GNU C library used by most Linux distributions makes use of the Native POSIX Thread Library or NPTL, which offers high performance, especially in server applications. However, disk space footprint and memory requirements of NPTL are far too large for resource-limited systems such as mobile devices.

This led Google to create a new C library called Bionic. It has fast execution paths, avoids edge cases and remains a simple implementation. As mobile devices are single user systems, for security reasons Google has removed the settings for groups and passwords, keeping only a unique user id and group id. Bionic operates with the limited CPU and memory resources available on Android platforms.

The Dalvik Virtual Machine

Android uses a virtual machine to run applications. Most top cell manufacturers such as Samsung, Motorola and Nokia use J2ME, a mobile optimized version of the Java virtual machine. In contrast, Android uses the Dalvik Virtual Machine, which is a standard Java platform. The dex files used by Dalvik are more compact and optimized to perform well on mobile devices with slow CPUs, limited memory, no swap space and limited battery power.

File system

Most desktop/laptop/server applications use magnetic hard disks, which the standard Linux systems manage with the latest Ext journaling file system. However, magnetic drives are physically too large, too fragile and consume too much power. To provide a robust file system, embedded systems use solid-state memory devices such as NOR for code execution and NAND for storage. Block erasure and memory are important features of solid-state memory, which the Ext file system does not handle. Therefore, Android uses an optimized Linux flash file system called YAFFS and this deals with lifetime limitations, bad block management and error correction for maintaining data integrity in NAND flash systems.

Power management

Standard Linux systems manage power though APM or ACPI. Android does not use either, relying more on its own PowerManager module, which is a Linux power extension. The module has low-level drivers for controlling the peripheral supported such as screen display and backlight, keyboard backlight and button backlight.

The Raspberry Pi Sense HAT

If you are targeting the Astro Pi mission, it makes sense to get the Sense HAT as an add-on board for your tiny single board computer, the Raspberry Pi or the RBPi. With a fantastic RGB LED matrix, not only is the board beautiful to look at, but it also comes with a plethora of sensors on-board. That makes it useful for the applications in the International Space Station where it is headed to in December 2015.

The Sense HAT looks like an ordinary board with an 8×8 RGB LED matrix on it. You can use it to display graphical information in color. For example, using the display you can indicate geomagnetic North. Apart from the matrix, the Sense HAT also has a five-button joystick, which allows the user to interact with the programs the RBPi is running. That includes playing games such as Tetris, Snake or Pong on the RBPi.

The Sense HAT includes several sensors such as a gyroscope, accelerometer and magnetometer. It also has sensors to read ambient temperature, barometric pressure and humidity. A Python software library that comes with the board provides the user with an easy access to everything on the Sense HAT.

Using the software library, you can conduct a huge range of projects for the Sense HAT and RBPi combination. For instance, if you are traveling with the combination, it can measure and show your speed. At the same time, it can tell you the direction it is facing, how humid is the atmosphere nearby and even the temperature of your surroundings.

The Sense HAT kit comes with the fully assembled Sense HAT board, four mounting posts and eight screws so you can mount the HAT on your RBPi securely. Mounting the board on the RBPi is simple. First, fit the four mounting posts with four screws on the board. Now, align the 40-pin connector on the HAT to fit on to the GPIO connector of the RBPi and push in firmly. The four posts will align with the mounting holes of the RBPi. Secure those with the remaining four screws and you are done.

To install the software, visit the AstroPi and the Swag websites. Here, you can find out of the world projects, a host of ideas and instructions related to the RBPi and the Sense HAT, fit for the applications on the ISS or the International Space Station.

Technical specifications of the Sense HAT are impressive, considering the inexpensive setup. The Gyroscope measures angular rate at +/- 245/500/2000 dps. The Accelerometer measures linear acceleration at +/- 2/4/8/16 g. Temperature accuracy measured in the 0-65°C range is +/- 2°C. The Relative Humidity sensor has an accuracy of +/- 4.5% within the 20-80%RH range, with a temperature accuracy of +/- 0.5°C in the 15-40°C range.

You must take care while measuring temperature with the Sense HAT. When the LEDs are lit for some time, they, together with the board, tend to get warm. That heats up the air nearby and the measurement may not reflect the ambient temperature accurately.

Differential Pressure with a Tiny Sensor

Process control requires system operators to monitor and control the condition and movement of liquids and gases. Several instruments are available for this, allowing measurement and monitoring of variables, and these fall under the categories of pressure, temperature, level, and flow. Among the pressure-gage category, differential-pressure gages receive the widest recognition for being the largest specialty type – useful in filtration, flow, and level measurements.

While standard pressure gages measure pressure at a single point in a system, differential pressure gages measure pressures at two points and display the difference on a single dial. This makes it easy for the operator to know at a glance, which of the two points is at a higher pressure, and by how much. Use of differential pressure gages greatly reduces operator error, protecting expensive equipment. They reduce operator training and maintenance time, thereby improving process efficiency.

For instance, differential pressure gages are popularly applied in filtration. In this process, a filter separates unwanted contaminants or particles from a gas or liquid system. However, with the progress of the process, the filter becomes increasingly clogged, leading to a drop in efficiency and pressure at the outlet.

It would seem enough to use a single standard pressure gage at the outlet to monitor the health of the filter and assess the time for its inspection and replacement. However, the situation is complicated, as most processes do not maintain a steady working pressure. Several factors are responsible for this, such as compressor or pump on-off cycles or valve open-close cycles, causing wide pressure fluctuations in most processes. For many systems, operators expect such fluctuations of pressure as normal, within limits.

Using two standard pressure gages, one at the input and the other at the output, introduces two additional problems for the operator. First, this compounds the accuracy errors resulting from the two gages as against error from one gage. Second, the operator needs training in reading the two gages, then subtracting the readings, and finally, interpreting the result. History shows many operators do not truly understand the importance of the calculation.

Installing one differential pressure gage using the same taps at the filter inlet and outlet solves all the problems listed above. The accuracy goes up as the rate of error drops. Additionally, the operator does not have to rely on mathematics to understand and interpret the reading – most differential pressure gage dials feature a red arc to indicate the clogging of the filter.

The SDP3x differential pressure sensor from Sensirion is a tiny device. Its dimensions are only 5x8x5 mm, making it one of the smallest of its kind, but with countless new possibilities of applications. It is well suited for use in portable medical devices as well as in consumer electronics.

Users can choose between an analog signal output and a digital one from two versions of the fully calibrated and temperature-compensated differential pressure sensor. The digital sensor, the SDP31, comes with an I2C interface, while the analog sensor, the SDP36, offers an analog output signal. The sensors have a sampling rate of 2 KHz with a resolution of 16-bits, and a measurement range of +/-500 Pa with a span accuracy of 3% of the reading.

Create a Baby Monitor with the Raspberry Pi

The arrival of a baby nearly always alters the entire timetable for all the members of the family, whether willingly or otherwise. For the parents, if they are first timers, the joy of seeing the tiny human is never-ending – they want to see the baby even if they are away from home. That is where a baby monitor comes in and what better to use for the project other than the versatile single board computer, the Raspberry Pi or RBPi.

As a simple, cheap, and low power computer, the RBPi works as a perfect fit for a baby monitor that has a motion detector and a simple web browser interface. That allows you to see the little one on your phone or laptop any time you want.

You will need the entire RBPi kit for this project. The kit will have the RBPi, its SD Card, the USB charger, and the micro USB cable. Additionally, you will need a USB webcam, an Ethernet cable, and a Wi-Fi dongle or an Ethernet power line adapter. Although not part of the project, you will also need a laptop or a desktop to prepare the SD Card for the RBPi. To interact with the RBPi, you will also need a keyboard, mouse, and a monitor.

From the official site of the Raspberry Pi, download the latest Raspbian image on your laptop. Now transfer the image to your SD card, making sure you have backed up anything important on the SD card beforehand. Writing an image wipes off whatever you have on your SD card, so be careful. If this is complicated for you, pre-pared SD cards are also available. Insert the SD card into the slot on your RBPi, plug in the keyboard, mouse, monitor, and the Ethernet adapter and power up the RBPi.

If you do not have a keyboard, mouse, and monitor for your RBPi, you can still connect to it using your laptop. If you are using Linux or Mac on your laptop, connect using SSH. For Windows, you can use Putty. Once you have powered on the RBPi, there will be only a few LEDs blinking, but nothing else. That is why it makes such a good baby monitor – it is silent.

To connect to the RBPi, you will need to know its IP address. As the RBPi is connected to the Ethernet adapter, your router will be the best place to look – search in the connected devices, and make a note of the IP address. Now, to connect via SSH, issue the command from your laptop: ssh pi@xxx.xxx.x.x, where the xx denote the IP address you noted down from the router. When prompted for a password, enter raspberry, as this is the default.

Update and upgrade your OS to ensure you have all the updates and security patches. Now, install motion, as this is the package to allow you to monitor the baby with the webcam. Configure motion to operate in daemon mode with a low frame rate, and start it working with the command: sudo service motion start. Now browse to the webcam from your laptop with: http://xxx.xxx.x.x:8081.