Monthly Archives: August 2014

How do motion detectors work?

Whether it is really a cat or a cat burglar trying to sneak into your house at night, a motion detector is a more prudent device to have around, rather than trying your luck with a baseball bat. The trick is in knowing what type of motion detector to use at what point, since there are so many varieties of them and that could be confusing. It helps to know how some of the more common types of motion detectors work.

Typically, there are two types of motion detectors – passive type and active type. The differentiation depends on whether a detector is injecting energy into the environment for detecting a change. Active types inject energy into their immediate environment, whereas, passive types do not. Both devices are simple electronic components.

Active type motion detectors can use light, microwaves or sound for detecting movement. The most common type of active motion detector is a beam of light crossing the door with a photo sensor on the other end. As soon as a person breaks the beam of light, the photo sensor detects the change for light reaching it and either rings a bell or flashes a light.

Many places have automatic door openers. These can detect when someone passes near and opens the door in response. A device above the door sends out bursts of microwave radio energy at periodic intervals. A sensor waits for detecting reflected energy. When a person moves into the range of the microwave energy bursts, the amount of reflected energy changes or the time taken for the reflections to arrive changes and the box triggers an arrangement that opens the door.

Pyroelectric sensors or Passive Infrared detectors can sense the heat given off by a human. To make the sensor sensitive to the temperature of a human body, the sensor must be capable of sensing skin temperatures of around 93°F or 37°C. Such sensors are typically sensitive to the infrared energy wavelengths of the range 8-12micrometers, since the human body radiates wavelengths between 9 and 10 micrometers.

To prevent the sensors triggering false alarms for example, a sidewalk cooling off at night, a pyroelectric type motion detector detects only rapid changes in its field of view. That makes these sensors insensitive to a person standing still. However, the amount of infrared energy changes rapidly when a person is moving or walking by, enabling the sensor to detect it easily.

Since infrared energy is a form of light, a plastic lens can very easily bend or focus it. That is how these sensors have a wide field of view. Most detectors have one or sometimes two sensors within them looking for changes in infrared energy. However, infrared sensors installed within a room are not very capable of detecting snoopers or peeping toms trying to peek in through a window. That is because a motion detector sensitive to infrared energy is unable to detect it through glass windows.

If you have a four-legged friend in your home, you have to get sensors that are pet immune, to make sure the friend is not mistaken for an intruder.

Teaching Raspberry Pi to teach itself

For most of us, learning is a part of life. Beginning at birth, we learn how to understand emotions, walk and talk as the primary steps in learning. For machines, although learning appears to be high-tech, it is not an isolated incident. We see incidents of machine learning around us almost every day without knowing. For example, machine-learning algorithms accomplish automatic tagging of Facebook photos and spam filtering of emails. Most of machine learning is a step in the direction of achieving artificial intelligence. Recently, a lot of interest has been generated by a new area of machine learning known as deep learning.

So far, only big data centers had confined this knowledge of deep learning, as deep learning technology depends largely on huge data sets. Only the big data-mining firms such as Microsoft, Facebook and Google had access to such large amounts of data. Now, a new startup Jetpac is planning to let everyone access this technology. Any person with a computing device can use their app to access deep learning technology, as the video on their website shows (https://www.jetpac.com/deepbelief). However, you may find that this technology is not so perfect. Just as the human brain, machines too suffer from optical illusions – confusing sidewalks with crossword puzzles, flutes with spiral bound notebooks and trash bags as black swans – see it below.

Pete Warden has done a great job of porting deep learning technology to the immensely popular, credit card sized, inexpensive single board computer, the Raspberry Pi or RBPi. The factor that has helped this process is that RBPi has a GPU with roughly 20GFLOPS of computing power, according to the documentation released recently by Broadcom, the manufacturers. That enabled Pete to port his SDK of Deep Belief Image Recognition to the RBPi.

If you would like your RBPi to be able to recognize things it sees around itself, follow the instructions here. However, for running the algorithm on the RBPi, you must allocate at least 128MB of RAM to the GPU and reboot the RBPi so that the GPU can claim the memory freed-up in the process. When you first run the program deepbelief on your RBPi, it will spew out a long list of different types of objects.

Thanks to the documentation about the RBPi GPU made public by Broadcom, Pete was able to write custom assembler programs for the 12 parallel ‘QPU’ processors that lurk within the embedded GPU. Additionally, the GPU makes heavy use of mathematics, which allows the algorithm process a frame in around three seconds. The technical specs of the graphics processor were released only a few months back, which has led to a surge of community effort to turn that into useable sets of examples and compilers.

Pete had to patch one of the existing assemblers heavily so that it could support more instructions. He had to create a set of helper macros so that programming the DMA controller was easier. Once these algorithms were tuned to the GPU’s internal method of working, Pete released them as open source.

Are drones invading your privacy?

Unmanned drones have proved to be a stealthy asset in the war on terror, making strikes on targets and collecting data on enemy movements. However, these small, nimble and nearly silent fliers can also be used to keep tabs on law-abiding citizens from nearby skies. This domestic use of drones is raising concerns about privacy violations including potentially violating the Fourth Amendment. Now APlus Mobile is planning to build a Linux-based Personal Drone Detection System. These will detect any nearby drone using a method known as Mesh Grid Triangulation.

The R&D division of APlus Mobile, the DDC or Domestic Drones Countermeasures, is planning to launch a device that will detect and track a drone aircraft that approaches within 50 feet. DDC has launched a Kickstarter project for building the Linux-based Personal Drone Detection System. They plan to make it available in November 2014, at $499 for the alpha test model, and in April 2015, at $699 for the beta test model.

DDC has a drone detection algorithm for which a patent is pending. The Personal Drone Detection System relies on this algorithm to work its magic. APlus Mobile will be using a MotherBone PiOne board-level Linux subsystem motherboard for building the device. The motherboard is an open spec PiOne type, which means it can fit either a BeagleBone Black or a Raspberry Pi single board computer.

The MotherBone PiOne is actually a part of the Primary Command and Control Module unit. This unit works in conjunction with two nodes of detecting sensors and establishes a mesh grid network. In turn, the network can triangulate the location of mobile transmitters. If you deploy more control modules and nodes, the network can cover a wider area.

The wireless mesh network and target triangulation work together. You can set up the nodes as far as 200 feet apart. Although the mesh network uses Wi-Fi to communicate, it is kept isolated from the user unlike the control module, which communicates with the user over Wi-Fi.

To detect the wirelessly enabled, mobile devices or drones, the sensor nodes use a frequency that ranges between 1 MHz and 6.8GHz. While detecting all known telemetry transmission frequencies, the system tries to determine if the mobile transmitter is actually a drone. All drones must transmit some telemetry data that allows it to navigate. Therefore, even if the drone is only storing recorded media and not transmitting it, it can be detected.

The biggest challenge for the drone detection algorithm will be in distinguishing between a jogger passing by with a cell phone and an actual drone. According to Aplus, the software does reduce false triggering. The system is designed to detect and trigger an alarm only if a drone is loitering nearby. Therefore, a jogger would have to stop for a while in front of the house for the device possibly to trigger a false alarm.

Once the device detects a drone hovering nearby, it sounds an alarm and simultaneously, sends a message on your mobile device. That should make you draw your infrared-resistant blinds and call for the police, unless the drone belongs to the police.

A Car Computer with the Raspberry Pi

There are many reasons one would want to make a car computer. Although one of the reasons might be the savings on the expenses of buying a branded one, the most plausible reason would be the thrill of making your own. What could be more exhilarating than to use the most inexpensive, credit card sized, single board computer, the Raspberry Pi or RBPi and turning it into a sophisticated car computer, ready to compete with the most expensive ones in the market.

That is exactly what Derek Knaggs did. He wanted a car computer and searched for one on the Internet – only to be put off by the large costs involved. As an RBPi enthusiast, he reasoned that his tiny RBPi had all the ingredients required to build one – flexible video and audio outputs HDMI and Composite RCA for video, HDMI and 3.5 mm audio jack for audio). Additionally, it has the complete flexibility of switching to any operating system simply by changing the SD card.

Derek made a list of the items he would need for his car computer – RBPi model B, a car DVD player, TFT monitors (7-inch models used, one for the front and one/two for the back seats), composite video cables, audio cables suitable for 3.5mm jacks), Wireless N USB dongle, Wireless mini keyboard and a micro-USB car charger.

Derek’s car already had a radio installed and he connected the audio output of the RBPi to the auxiliary port of the radio. That allowed the audio to be played via the car speakers, so he had stereo audio playing loud and clear. He placed the RBPi in the center console, so that he could route all the cables under the console, giving the whole arrangement a neat and clean look, without any cables hanging around.

For playing video on the RBPi, Derek used XBMC, which comes with the Raspbmc operating system. Inputs to the RBPi were controlled by the wireless keyboard, which also has a built-in mouse touchpad. The keyboard has an on-off switch, useful for saving its batteries. The Wi-Fi dongle gave Derek the freedom to connect to any wireless network. Of course, another option is to connect it to the mobile phone, provided it has the option to set up a portable Wi-Fi hotspot.

One of the TFT monitors connects to the RBPi, and although Derek chose to position it on the central console, you might want it behind on the headrest of one of the front seats. Since Derek already had a car DVD player fitted in, there was another TFT monitor available. If the TFT monitors have HDMI inputs, you may want to connect them via HDMI cables. TFT monitors typically come with RCA composite video inputs, so that should not be a problem, as RBPi has composite video outputs along with HDMI. However, as soon as you use one of the video outputs on the RBPi, the other switches off, so it is not possible to use two monitors at a time from the two types of video outputs on the RBPi.

Raspberry Pi Digitizes and reads books

You can make your own book reader that will read books aloud after it has digitized them. The ingredients you will need are the tiny single board computer Raspberry Pi or RBPi, a BrickPi and some Lego motors and blocks. The finished book reader will flip through one page of a book at a time, take its picture and turn the picture into a text document, before moving onto the next page.

The book reader works by preparing a page to turn with the help of a rotating Lego motor. Gravity does its bit by providing just enough friction on the page of the book to allow it to inch forward. Finally, a Lego arm beam swings over and forces the page to turn over.

Once on a new page, the camera of the RBPi snaps an image of the page and saves it in the form of a JPEG file format. The RBPi then uses an open source Optical Character Recognition (OCR) software program to transform the page into text format and saves it. The RBPi then uses free text-to-speech software to read the page aloud over the speakers connected. The BrickPi operates the Lego modules that turn to the next page of the book.

For this project, you will need an RBPi (Model B), an RBPi camera, the BrickPi, the BrickPi Power Pack, Raspbian Wheezy on an SD Card, a Wi-Fi dongle and a Lego Mindstorms kit. The Lego kit could be either an EV3 or a NXT system.

As you have to use the camera to capture the image of the page, you will need good lighting. Arranging for the RBPi and the BrickPi to be placed above the book allows the camera to be positioned squarely above the book. Arrange lights over the sides at angles to fall and illuminate the page from two sides.

You may have to calibrate the page turning mechanism until it runs perfectly. This is done by adjusting the values of the variables in the arm_test.py. The motor connects to the Port A of the BrickPi and for calibration, the values of speed_arm, speed_roller, t1 and t2 may have to be changed and tested until the page turns flawlessly.

The camera is placed in position and held there with two Lego Technic beams. Once the camera is fitted in place, you may have to change its focus, as the camera focus is typically at infinity. Although the camera may give acceptable results without adjusting, focusing on the page gives improved results for OCR recognition. To change the focus read here and here for guidance.

Once the camera is adjusted, take a few images and check for clarity over the whole page. If the image does not look proper, adjust the focus and angle again. If the image looks good, it is time to test whether the OCR can convert it. Setup the Tesseract OCR engine, and use it to convert an image with “tesseract image.jpg o”. The output will be o.txt and this should now be readable with the text-to-speech engine eSpeak. This software allows choice of the reader’s gender and the accent. Once you connect a pair of headphones or speakers to the RBPi, you should be ready to go. For more details on this project, refer here.

High Fidelity Audio from the Raspberry Pi

Although the Raspberry Pi or RBPi has many exceptional qualities such as a small form factor, low price, low power consumption and credit card size, the single board computer is not endowed with a high fidelity onboard sound output. Therefore, to get high-fidelity sound, you must add a sound card to the RBPi. For all RBPi users who love music, HiFiBerry produces sound cards designed for optimal sound quality output.

HiFiBerry has two types of boards depending on whether you are looking for an analog or a digital board. If you have an analog amplifier, use the DAC board. However, if you connect to your amplifier via an optics link, use the Digi board. The standard RBPi kernel in the Raspbian distribution supports both the boards and they use Open Source software. HiFiBerry provides all drivers for both boards as open source. These boards utilize the P5 connector on the RBPi.

The HiFiBerry DAC is available as a Standard version with RCA connectors or as a 3.5mm phone jack version for headphones. Both are fully soldered boards; however, if you prefer to do some soldering, there is a DIY kit as well. For providing the best sound quality, these boards use a dedicated 192KHz/24-bit DAC from Burr-Brown. No cables are required, as the board connects directly to the RBPi, which also supplies it with power. Optimal audio performance is assured with on-board ultra-low-noise voltage regulators. Mechanical spacing between the audio board and the RBPi requires nylon spacers.

To connect the DAC board, you will need to solder an 8-pin header on to the RBPi, on its onboard sound connector P5. Now simply plug the DAC board in and start using it. The on-board ultra-low-noise voltage regulator will filter out all the noise from the RBPi power supply and you do not require any additional power supply or cable.

If your amplifier connects with an optical signal, use the HiFiBerry Digi board, which offers a high-quality S/PDIF output. The board connects to the P1 and P5 headers of the RBPi and supports up to 192KHz/24-bit resolution via optical (Toslink) and electrical outputs. The audio data streams produced are bit-perfect outputs, unmodified in any way.

The Digi board is also available in two versions, one with an isolation transformer and the other without. Although the hardware on the board is capable of DTS/Dolby Digital output, suitable software is required to make its full use. At present, HiFiBerry is not providing this software, but they will offer support to developers who want to implement this feature. The isolation transformer will provide complete galvanic isolation between the DAC on its output and the amplifier. However, most consumer-grade SPDIF connections do not require any output transformers.

For the future, HiFiBerry is planning a high-quality highly efficient stereo class D power amplifier to be connected directly on to the RBPi. Only external loudspeakers are necessary to get full 2x25W output power when driving 4-Ohm speakers with 44.1KHz and 48KHz sampling rates. This board will require an external power supply of 12-18V, but will power the RBPi as well, so ultimately only one power supply will suffice.

Designing Intelligent Lighting Systems with Constant Current LED Drivers

Sunpower LLP of UK has launched 25W constant current LED Drivers that facilitate designing of low wattage project style lighting and intelligent LED lighting control systems. The company has added the driver christened LCM-25 to its existing LCM series of constant current LED drivers for 60W and 40W. Apart from maintaining its output at a constant current while meeting the LED needs, the driver can be set up at varying levels ranging from 350mA to over an Ampere with the help of a built-in DIP switch. The LCM-25 driver has been designed with a two-in-one dimming operation. It can be dimmed by a PWM control input or by 0-10VDC.

This new product comes with a host of features. The digital LCM-25DA has a push button dimming function and a DALI interface. The operating range is 180-277 VAC input. EN61000-3-2 Class C (> 50% load) sets the harmonic current limitation. Between the line and neutral, there is 2kV surge-immunity, which meets the needs of the heavy industry. The latest state-of-the-art circuit design ensures a maximum efficiency of 86%, while at the same time, cooling is by simple air convection when operating at ambient temperatures of -30°C to +60°C. No-load power consumption is less than 0.5W.

The main feature of the LCM-25 is its inbuilt PFC operation. The driver is protected against over-temperature and / or short-circuits. In either case, after constant current limiting or over-temperature protection, recovery is automatic after the fault is resolved. The driver is housed in a fully insulated plastic case. This class II power unit is designed conforming to IP 20 and without FG. Each unit can synchronize up to a maximum of 10 units. The ripple current is ±5.0% and the no-load voltage 59V.

The LCM series is housed in a totally insulated rectangular plastic case of low profile, which is rated for IP20. It is offered to the customer with several unique facilities. The first is that it is very easy to install as compared to current products of industry standard, which is to have the outputs at the rear and the inputs at the front. LCM series has been designed with the outputs and inputs on the same side. That ensures installation work remains simple and smooth, while making efficient use of the limited space while wiring. The LCM series is covered under a number of International safety regulation certifications such as the CSA C22.2 and UL-8750.

Sunpower Technology LLP is the UK wing of the Taiwanese manufacturer, taking care of all its power supply needs. The company conforms to BS-EN-ISO 9001:2008 and its factories are certified under ISO certifications 14001 and 9001. Sunpower has been striving for improvements on a continuous basis with the aim of providing customer satisfaction. Even customers buying low volumes are provided technical support and affordable price. The latest LED driver, the LCM-25 has enabled designing low wattage intelligent LED lighting systems. With a global reach, the product is sure to capture a significant share of the market.

ISO 7000 compliant Fully Illuminated Push Button Switches

The Vista-based company APEM, Inc., from California, has developed a new series of fully illuminated push button switches that meet the ISO 7000 standards in all respects. These are the FP30 series pushbuttons. These are being offered to users in both threaded bush mounting form and snap-in type. Even though the size is rather large, they are very light. For snap in types, the panel thickness ranges from 1.5mm to 2.5mm and the threaded type support 1mm to 9mm panels. The unique feature of the FP30 series push buttons is that they are illuminated. They are offered in smooth, glossy finish. The users have the choice of many bezel colors and with differently colored actuators.

The FP 30 series push buttons have the option of being pad printed or even laser etched with more than 100 symbols. The ISO 7000 standards allow the use of graphical symbols on the equipment and FP 30 series complies with this. They are available in seven LED colors meeting the user’s needs and offered in 48V, 24V and 12V ranges. Choice of momentary or latching is available for both threaded bush type and snap-in type along with the option of single pole or double. The push button can be used for 400,000 mechanical operations or 1 million electrical operations when operated at 200mA at 12VDC.

Although the new FP 30 series push buttons are illuminated, non-illuminated push buttons in the FP30 series are also available. The standard packing has 20 pieces. The color options vary marginally for bezel, LED and actuator. For example, you can select a bright chrome bezel with an orange option for the actuator. The case material used is nylon grade PA46, while for the actuator it is PA12 with gloss finish. The bezel is gloss finish ABS, while the bushings and the contacts may be in code 2 silver for 4A 12VDC, code 4 silver or gold plated for 200mA 12VDC. The operating temperature is between -40ºF and +167ºF or -40ºC and +75ºC. Lug terminals are open to soldering.

The new FP 30 series push buttons have a very wide range of applications. They have been designed to make an impact in various industries such as security, industrial automation, defense, medical, instrumentation, apart from being considered ideal for dashboards in the automotive, passenger and commercial vehicle segments. Customer specific requirement of symbols and marking color is also considered on receipt of a specific request and attended to expeditiously.

The company APEM started its operation in the year 1952, manufacturing industrial switches. Over the years, it has grown multifold in a very rapid manner to reach out globally and is now one among the leading manufacturers of man machine interfaces. With a presence in 11 countries and with global distribution network and agents, the company has 67% of its total turnover as exports. APEM designs for professional switches and manufactures them to cater to diversified markets including, medical, industrial automation, defense, communications, instrumentation and transport. The latest launch of the FP30 series of push buttons complying with ISO 7000 standards is another milestone for the company and is expected to make a significant impact in the market.

ByteLight LEDS provide location based service

Not so very long ago, the friendly neighborhood supermarket had a security guard who would greet you in recognition and the store assistants could guide you since they knew what you usually bought. However, the introduction of huge shopping malls with their multiple floors has done away with anyone able to recognize even frequent customers, making the whole affair of shopping completely impersonal.

However, things are about to change. GE Lighting and ByteLight are harnessing the next generation of LED lighting fixtures to communicate with the smart devices of shoppers while they are in-store. Very soon, shoppers will be greeted with personal messages starting from the parking lot. As shoppers move about within the store, they will receive an easy-to-follow map on their devices to help them optimize their shopping time. The store will offer repeat customers a personalized shopping list along with information on promotions and coupons based on their shopping history, current position and direction on the aisle.

Customers will be able to see reviews, play product information videos and connect with virtual associates on-demand to make their brand choice easier. ByteLight has developed this technology by combining VLC or Visible Light Communication, BLE or Bluetooth Low Energy and inertial sensors. They can determine not only the precise location of the shopper on the aisle, but even the direction the person is facing.

The patented ByteLight LED indoor location technology offers several advantages to both shoppers and retailers. It brings the retailer faster ROI as existing lighting infrastructure can be used and no additional equipment is necessary. It has an accuracy of three feet in determining the location and direction of the shopper anywhere there is light. It can connect to any shopper who has a mobile device equipped with Bluetooth and/or camera. ByteLight, being powered by the light fixture, does not require batteries and hence, is maintenance free.

According to Dan Ryan, the CEO and Co-founder of ByteLight, the value proposition for digital LED lighting is shifting from providing illumination to offering innovative services and applications. They are reinventing LED lighting to provide a platform for indoor-location services. Not only will this revolutionize the in-store shopping experience, LEDs will play a strategic role in the experience of customers in connected retail.

GE is providing the lighting fixtures that ByteLight will be using for their location-based services. It amply demonstrates how simple LEDs can be used beyond their traditional ROI of maintenance and energy savings to change the fundamental way of how people shop by combining information with location.

Shoppers will be using an opt-in application on their smartphones or tablets. The app will be powered by ByteLight and together with the indoor location technology embedded within the GE LED fixtures, will deliver to the shopper high value applications based on their current location and the items they are presently watching.

This comprehensive approach will help retailers reach out to an even broader number of shoppers across the largest area – starting from the parking lot and continuing anywhere within the store where there is LED light. That means, retailers will have continuous ROI on their GE lighting and at the same time, this will provide a strategic platform for the futuristic connected retail store.

Measuring Force with Force Sensors

FlexiForce FSR Sensor can help you to measure the force between almost any two surfaces. The sensors are highly flexible, have a paper-thin construction and robustness to stand up to most environments. Tekscan, the manufacturers, can create custom-designed force sensors because of the high durability and unique construction of the basic FSR sensor element. These meet the specific needs of several OEM customers. Off-the-shelf standard sensor products are also available for low-quantity requirements such as prototyping.

With FlexiForce FSR sensors, you can detect and measure any relative change in the applied load or force, the rate of change in force, detect touch and/or contact and identify force thresholds to trigger appropriate actions. Using a FlexiForce OEM force sensor offers several advantages over a competing product, such as superior linearity and accuracy of +/-3% over a wider range of forces. Tekscan provides expert technical guidance in custom solutions and they test all custom sensors to ensure they meet the agreed-upon specifications. Typically, the sensor output is not a function of the loading area and high temperature versions are available as well, going up to 400°F.

The FlexiForce FSR sensor functions as a force-sensing resistor within an electrical circuit. When there is no load or the force is very low, the resistance of the sensor is very high. The resistance decreases as force is applied to the sensor. If you connect a multi-meter to the outer two pins of the sensor, you can read a resistance, which will change when you apply a force to the sensing area. The sensor allows measurement of force against either resistance or conductance. Since the conductance curve for the sensor is linear, calibration is simple.

Integrating a FlexiForce FSR sensor within an application is very easy. One way is to use it in a force-to-voltage circuit. It will be necessary to calibrate the sensor for converting its output into the appropriate engineering unit. Based on the setup, you can easily adjust the arrangement to increase or decrease the sensitivity of the force sensor.

Typical performance specifications of the sensor are very impressive. The error in linearity is less than +/-3%, when the line is drawn from zero to 50% loading. When applying 80% of full force, a conditioned sensor can be expected to be repeatable with a spread of less than +/-2.5% of full scale and a hysteresis of less than 4.5% of full scale. With a constant load of 90% of the sensor rating, the total drift does not go beyond 5% per logarithmic time. If you are measuring impact load, the time required for the sensor to respond to an input force is less than five uS. The sensors work reliably between 15 and 140°F or -9 and +60°C, which are standard. For High-Temp versions, the operating range is 15 to 400°F or -9 to +204°C. The force reading change per degree of temperature is +/-0.2% for every °F or 0.36% for every °C.

FlexiForce FSR sensors have a variety of applications. They are used in bed monitoring, color balancer quality control, fitness training, golf grip measurements, improving robot balance and grip, detection of infusion pump occlusion and several other manufacturing and monitoring purposes.