Category Archives: Customer Projects

How to Measure Large DC Currents Accurately

The market has several instruments for accurately measuring small DC currents, say up to 3A. You can also find some devices that can measure DC currents that extend beyond 50A with good accuracy. Large currents are common in photovoltaic renewable energy installations, grid energy storage, electric vehicles, to name a few. Usually, it is a common necessity for such systems to be able to predict accurately the state of charge or SOC of the associated energy storage batteries.

Usually, systems for current or charge measurements are designed to include built-in data acquisition modules such as ADCs or analog to digital converters, filters and suitable amplifiers. The arrangement is typically that of a current sensor followed by a filter/amplifier and finally an ADC. The current sensor senses the current a circuit for converting the output into a usable form such as voltage, typically follows it. The signal requires filtering to reduce the radio frequency and electromagnetic interferences. The cleaned signal may have to be amplified before being digitized. Current data samples multiplied by the appropriate time interval are accumulated for charge values.

Two sensor technologies are commonly used for measurement of large currents. The first of these techniques measures the voltage drop across a resistor (also called a current shunt) that carries the current to be measured. The voltage drop follows Ohm’s law and equals the product of the current times the resistance.

Large DC currents may cause power bus bars and cables to dissipate significant amounts of heat. As a thumb rule, designers of power installations strive to achieve less than 1% power loss from the wiring, including bus bars and heavy cables. For example, an offline storage system of batteries with output of 1KV and 1KA supplies power at 1MW. Although the dissipation of a 50W shunt is insignificant at 0.005%, the power cables and bus bars may dissipate heat upwards of several KW.

To put things in perspective, designers go by 1W per µOhm at 1KA, therefore, for a shunt with 10 µOhm resistance, a continuous current of 1KA passing through it will heat it up to 10W. Alternately, copper wire, with a diameter of one-inch, will be dissipating 12-14W of heat at 1KA for each foot, since the resistance of the wire is about 10 µOhm per foot, after correcting for resistance increase due to heating.

The second technology senses the magnetic field encircling the current carrying conductor. The device for sensing the current is generally known as the Hall-Effect current sensor. Usually, the magnetic field around the current carrying conductor is concentrated in a magnetic core, which has a thin slot and the Hall element resides here. The magnetic field is thus perpendicular to the plane of the Hall element, while the magnetic core makes it nearly uniform. Energizing the Hall element with an exciting current makes it produce a voltage proportional to the magnetic field in the core and the exciting current. This voltage, suitably amplified and filtered, is presented to the ADC.

One advantage of the second technique using Hall elements is the isolation between the current carrying conductor and the measuring electronics. Since the coupling is only magnetic, the current carrying conductor may have very high voltage potentials, which do not affect the current measuring elements.

Building a UPS with Raspberry Pi and Supercapacitors

It is always a dilemma when integrating a Raspberry Pi (RBPi) Single Board Computer into a project that works on the mains voltage and the RBPi has to turn it on or off. The difficulty is in deciding whether to power the RBPi separately or maybe power it from a UPS.

Lutz Lisseck solved the problem in an ingenious way. He was looking for a way to shut down his RBPi gracefully, after it had turned off his ambient-lamp. Since the lamp operated directly from the mains and Lutz wanted to turn it on/off from the mains power switch, he would normally have two choices. He could either use a mains wall adapter to power his RBPi or use a battery pack as a traditional UPS. He decided he did not like either, and instead opted for a third alternative, building a UPS with supercapacitors.

Lutz used two 50F supercapacitors to make his UPS. When the lamp was on, the capacitors stored enough charge to outlast the RBPi. When the SBC cuts the power, a GPIO pin senses the loss and informs the RBPi to begin its shutdown sequence. The RBPi takes about 30 seconds to shut down, and the capacitors happily power it for the time. Supercapacitors are usually rated at 2.7V; therefore, Lutz had to put them in series for the RBPi to get 5V. An alternative would be to place the capacitors in parallel and use a step-up converter to jack up the voltage. An upside to this is the capacitors will supply the RBPi for a longer time.

Since the project was a very simple one, there are some shortcomings in using the RBPi this way. First, the capacity is just about enough to shut down the RBPi in 30 seconds. However, when switched on, the capacitors take time to charge and the RBPi has to wait for about 10 seconds, before it gets adequate voltage to boot. Another drawback is that although the RBPi has only 30 seconds to shutdown, the capacitors discharge very slowly, and the system has to remain unplugged for about 10 minutes after shutdown, before it will boot up again. For this ambient-lamp project, Lutz does not consider that as a handicap.

Using supercapacitors over batteries has some advantages as well. The capacitors have a lifetime that far surpasses that of batteries. For example, you could charge and discharge supercapacitors completely several 100,000 times. Moreover, supercapacitors can be charged and discharged at rates that are not possible with a battery. A completely discharged supercapacitor can be fully charged up in just 2 minutes.

Therefore, with the supercapacitors in place, you do not need to worry about improper shutdown when the mains supply collapses. A GPIO pin on the RBPi senses when the mains voltage has been removed and the RBPi immediately begins a shutdown sequence. Whether using the supercapacitors in series or in parallel, a low value resistor (0.5-2.0 Ohms) must be placed in series with the batteries to limit the inrush current at startup. As the resistor can get hot, preferably a high wattage type should be used.

Battle the Sun with a 21W LED and a Raspberry Pi

Lighting up an LED or an array of LEDs and controlling their brightness is a simple affair with the tiny credit card sized single board computer popularly known as the Raspberry Pi or the RBPi. The RBPi runs a full version of Linux and you can use it to drive an array of bright LEDs with it. If you construct it like Jeremy Blum did – he put up the LEDs on his graduation mortar board and wore the RBPi on his wrist on his graduation day – you can be sure of getting a lot of excited remarks from friends and onlookers.

Jeremy wanted to let others interact with the LED on his cap. Therefore, he developed the idea of “Control my Cap” project. His control system consists or a wrist computer comprising an RBPi together with an LCD/button interface. That allows Jeremy to monitor the status of the cap, adjust the brightness of the LEDs, change the operation mode and toggle the wrist backlight. If there is any trouble in connecting with the LED interface, the reasons will be listed on the LCD.

The RBPi is programmed to connect automatically to a list of pre-allowed WPA-protected Wi-Fi hotspots as soon as it is booted. This allows Jeremy to set the wrist interface and the LEDs to a web-controlled mode, let the LEDs take on a static color or have them follow a rainbow color pattern. The cap has a total of 16 LEDs, rated at 350mA each, with four each of Red, Green, Blue and White in four strings. A constant current driver that has a PWM control drives each string of LEDs. A separate on-board switching controller generates the 5V for the RBPi.

As the whole project is portable, a battery powers it. Jeremy used a laptop backup rechargeable battery for his project. At full brightness, the array of LEDs consumes a total power of 21W and is easily visible is bright sunlight. With an 87 Watt-hr. capacity, the battery is able to power the cap for an entire day and more. Additionally, it has a 5V USB port, which Jeremy uses for charging his phone.

Jeremy put up a mobile website controlmycap.com to allow anyone to submit colors for the color queue of the cap to be used in the web-controlled mode. In this mode, the wrist computer grabs the 10 most recently submitted colors from the mobile site constantly, displaying them on the cap. Additionally, when using a color set for the first time, the RBPi informs the requester by a tweet that their color combination is about to be displayed. The RBPi communicates with the cap via a single USB cable, which doubles as it power supply cable as well.

Jeremy used the FoxFi app on his Samsung Galaxy S4 smartphone to generate a Wi-Fi hotspot and the RBPi was able to connect to the Internet through this. The remote webserver hosting the controlmycap.com website also stores the color requests in an MYSQL database, which the RBPi queries for updating its commands.

Use Raspberry Pi to Control Your Garden Sprinklers

People who have a lawn in their backyard know how important it is to water it carefully to keep it looking green and lush. The timing has to be right to prevent the grass in the lawn from drying off and allow just enough water so that the lawn is not flooded. Most people use sprinklers to wet the lawn evenly. However, timers sold in the retail stores for controlling the sprinklers have only limited functionality that leaves users unsatisfied.

Most people are busy and on the move, which does not allow them much time to monitor the working of the sprinklers. With the timers purchased off the shelf, it is not possible to have flexible watering schedules and remote control is not a feature.

This unsatisfactory scenario of the uncontrollable lawn sprinklers led Ray Wang to set about designing his own sprinkler controller. He built his first functioning prototype “The Mint-tin Water Valve Controller.” It used an Arduino Pro Mini and a homemade PCB with a wireless transceiver. Along with Chris Anderson, the editor-in-chief of Wired magazine and the CEO of 3DRobotics, he turned this project into a potential business opportunity. It grew into an open-source, web-based smart sprinkler controller project – the OpenSprinkler.

For Ray, keeping OpenSprinkler as an open-source project is important, as he is an educator who always wants people to not only use a product, but also to have the opportunity to learn how the product works internally. The project has a strong educational purpose, as anyone can design a new sprinkler based on this project and not have to reinvent the wheel, a great way of promoting technological innovations.

Starting with OpenSprinkler v1.0, Ray improved it to v2.1 before moving over to the affordable, tiny credit card sized single board computer, the Raspberry Pi (RBPi). The advantage is that the RBPi’s GPIO pins can directly control the sprinkler valves. Thus, on Feb18, 2013, was born the OSPi or OpenSprinkler Pi v1.0.

A number of enthusiastic users helped in porting the Arduino code to Python for use with the OSPi. In the process, they introduced new features such as advanced logging and a built-in mobile frontend. Others revamped the code and provided a more modern, streamlined user interface. Ray has made a pre-configured SD card image where the OpenSprinkler software is pre-installed. If you need to control your lawn sprinklers, all you need to do is download this image, burn it into an SD card and pop it into your RBPi. Of course, you will need the sprinkler extension board, which houses all the hardware necessary for making the project compatible with the standard 24VAC sprinkler valves used for watering and irrigation systems.

OSPi makes the entire project much more convenient and intuitive compared to traditional sprinkler controllers that have buttons to set everything and a tiny LCD, which hardly helps. OSPi is a web-based controller that allows remote access. The user can additionally pull in weather data online for helping to adjust watering schedules when necessary.

Raspberry Pi Detects Trains in Stockholm Subway

Imagine waiting for a train in a subway. As the train arrives, a nearby poster of a woman has hair blowing all over her face, as if in response to the wind from the incoming train. As the train stops, the woman in the poster clears her hair from her face and resumes her smile, until the next train arrives. The Stopp Family, a Stockholm production company and Akestam Holst, an ad agency, have joined forces for modifying one of the play screens of Clear Channel in the Stockholm subway. The idea was to simulate the effect of turbulence from the train catching the model’s hair as it arrives at the platform.

This required a device that could sense the arrival of the train without reacting to the passing passengers. After studying several possible solutions such as wind sensors and sound detection the team came to settle on an ultrasonic sensor for measuring the distance.

The team connected the ultrasonic sensor to the popular single board computer, the Raspberry Pi or RBPi, which was running a Python socketserver. The RBPi sent the measured distance to a connected client at predefined intervals. The client, a flash application, received the measured distance and when this reached a predefined value, triggered a video of the model’s hair blowing in the wind.

The most critical factor was in deciding when to trigger the video. The distance measured by the sensor was about 4 meters when the train was on the platform, which increased to 7 meters when there was no train. To prevent false triggering, the team had to set up some rules for the video to trigger to play. They found that best results were obtained when the video was triggered with distance readings between 3.9 and 4.1 meters. Moreover, once the video had played, it could be triggered again only after the client received three readings with distances greater than 6.9 meters. With these two rules, they were able to prevent the same train triggering the video more than once, while also preventing the video from being triggered by nearby people.

With this simple but stunning project, the team is able to extend the existing and create new technical solutions further. They can now define new interactive platforms. Rather than simply changing advertisements to fit the technology, they are now in a position to adapt technology to fit ideas that are more creative for advertising.

Ultrasonic sensors work by sending out bursts of ultrasound – sound that is beyond the range of human hearing – at about 40 KHz. The RBPi generates the timing for the bursts and waits for an echo. The sound travels until it meets an obstacle that can reflect it back to the transmitter, in the form of an echo. A receiving sensor, placed close to the transmitter, senses the echo and informs the RBPi. By multiplying the speed of sound with the measured time elapsed between the original burst and its returning echo, the RBPi calculates the distance travelled by the burst and hence, the distance of the obstacle from the unit.

Automation Controller Uses Raspberry Pi Compute Module

Remote control has a new face. Based on the tiny credit card sized single board computer Raspberry Pi or RBPi, Techbase has designed a Linux-based ModBerry automation computer. They back it up with an iMod cloud platform. ModBerry is all about remote control.

This version of RBPi was introduced lately and known as the Compute Module or Computer-on-Module. People in Poland have taken up the RBPi Compute Module wholeheartedly and turned it into ModBerry. Initially, the Polish startup Sher.ly started with Sherlybox, a private cloud storage device based on the RBPi COM (Compute Module). Now, Techbase, the industrial computer manufacturer from Gdansk, Poland, has based their automation computer ModBerry 500 on the RBPi COM.

The RBPi COM is a part of the development kit that Farnell Element 14 and RS Components have released recently. The kit also contains a separate baseboard. Later plans include selling the module independently.

Techbase is already in the market with numerous Linux-ready and Linux-based automation controllers and industrial computers. Techbase supports some of its computers with its cloud-based iMod, iModCloud and iModWizard, which also provide Software-as-a-service or SaaS applications. This includes its telemetry computer iMod-X1000.

In contrast, Sherlybox is a private crowd based on local storage. With the iMod ecosystem, users can store data and control several iMod compatible computers via a cloud platform. By combining ModBerry 500 and the software from iMod, users have access to applications in the general automation market and intelligent buildings. According to Techbase, they can also monitor and control wind farms, GSM base stations and power stations. Users can set up their devices as protocol converters, telemetry modules, data loggers, servers, MODBUS routers, PLC devices, SNMP agents and many more.

The iMod system is a versatile arrangement offering multi-level, user access cloud management via configuration files. According to Techbase, its iModWizard makes it unnecessary for the user to possess any programming knowledge. Users can freely create different user profiles such as end-user, administrator and system designer. Additionally, iModCloud helps users to update software and configure services.

With iModCloud, users have custom-based actions including notifications and management, which are extremely important for remote control. Users can see the location of GPS-enabled devices on maps provided as part of data visualization capabilities. Users can access their data on smartphones or tablets. Techbase assures security via SSL certificates and encrypted VPN communication.

The ModBerry 500 operates on a wide-ranging 9-24V AC/DC supply. It is available in commercial as well as in extended models, which can work between -25 and 80°C. The physical dimensions are 106x91x61 mm. The ModBerry 500 gets its computing power from the RBPi COM, which provides it with the 700MHz ARM11 Broadcom system-on-chip processor running Raspbian Linux. The module also shares its 512MB RAM and its 4GB NAND flash storage with the ModBerry.

The hardware features of the ModBerry include several real-world ports such as a USB 2 host port, a 10/100 Ethernet port, a slot for SIM card, audio out and a user programmable button. Other ports include an HDMI port and a reset button. There is also a pair of RS-232 and RS-485 ports, CAN ports and a 1-wire bus.

For more information on ModBerry 500, refer to this website.

Raspberry Pi Radio

Raspberry Pi or the RBPi, the tiny credit card sized single board computer is so affordable that people can easily create single purpose appliances around it. For example, just by adding a small LCD that has a few buttons and a USB wireless network adapter, you can build a self-contained music streamer around the RBPi. This you can move around to any room of the house. The only extra items you need to connect to it are power and speakers or headphones.

Use the Adafruit LCD kit that has a keyboard along with an RBPi. You can select from several versions of the LCD kit: RGB negative backlight, the RGB positive or the more affordable Blue and White. For this kit, you must be prepared for some assembly and soldering. Although the RBPi can be any model, A or B, you will need a 4GB or larger SD memory card. You may use any mobile phone charger, but the charger cable must be compatible with the USB Micro-B connector on the RBPi.

You may connect headphones or amplified speakers to the audio output of the RBPi. Alternately, connect it to the A/V setup in your living room. To connect to the internet, you will require a USB Wi-Fi adapter compatible with the RBPi and of course, an existing wireless network and a working Pandora account. If you have wired Ethernet, you could use that with the RBPi Model B, but that will reduce the convenience of wireless. Finally, you will need a suitable enclosure – one that offers full access to the top of the RBPi board.

You will also need some temporary items only for setting up. These can be removed and do not need to remain permanently attached. To communicate with the RBPi, you will need a monitor and keyboard. Additionally, you may possibly require a powered USB hub, a soldering iron and some solder for assembling the LCD keypad kit.

The Linux OS available for the RBPi has several flavors. For this project, the recommended distribution is the Raspbian Wheezy (official distribution) or Occidentalis (from Adafruit). You may also use any of the other stock distributions along with additional software. Download the OS, uncompress the ZIP file and follow this link to install the OS onto the SD card.

Start by formatting the SD card as a FAT32 file-system and install the OS on it. Next, solder the LCD Pi Plate following this tutorial. House the RBPi in its case. Also, set up a free Pandora account and select your favorite stations.

Once your SD card is populated with the OS of your choice, connect a USB keyboard and a monitor to your RBPi. Insert the SD card in its slot and connect the Micro-B USB cable to the power connector on the RBPi. The other end of the USB cable you can plug into the mobile phone charger, a powered USB hub or simply to the USB port of your computer.

Once you successfully power up the RBPi and navigated past the initial UNIX stuff, you can follow the instructions presented here for the rest of the project.

DIY Google Glass with Raspberry Pi

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

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

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

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

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

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

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

Raspberry Pi Temperature Monitor and Alarm Project

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

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

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

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

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

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

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

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.