Category Archives: Raspberry Pi

The 64-RGB Unicorn HAT for the Raspberry Pi

Using an RGB LED connected to the single board computer RBPi (Raspberry Pi), one can generate most of the colors of the rainbow. If one RGB LED has so versatile uses, imagine what you could do with 64 of them. Agreed, it takes more programming effort to play with 64 RGB LEDs, but with some help from the Pimroni GitHub repository and using their 64-RGB Unicorn HAT, this could be a fun project with Python scripts.

The Unicorn is a HAT or Hardware Attached on Top board for the RBPi. That means it has means to let the RBPi detect the GPIO pins required to drive it. Once plugged into the GPIO connector of the RBPi, the Unicorn becomes functional. You can program the matrix of 8×8 RGB LEDs on the Unicorn using Python scripts in many imaginative ways.

For those sensitive to different types of light, there is a word of caution. RBPi is capable of flashing, strobing and creating patterns of light with the RGB LEDs and this may cause epileptic seizures in those who are photosensitive. LEDs are strong point sources of light and directly gazing into a bright LED may cause eye-damage.

The GPIO interface on the RBPi can control each individual LED of the matrix. This includes assigning a level of brightness to each LED in addition to choosing its color. The Unicorn board comes with 64 RGB LEDs and its own Python library that Pimroni has provided. That makes it every easy for developers to control the board with its extensive capabilities. The LEDs may seem too bright if you operated them at their full brilliance.

Operating them at about 20% brightness is generally enough for most purposes. So many LEDs require a lot of energy, and as the board derives its energy from the RBPi, it is advisable to use at least a 2A power supply for powering the duo.

The Unicorn HAT uses the PWM hardware and the GPIO 18. Although this does not affect the HDMI output, it does interfere with analog audio playback. HATs are only compatible with the newer models, as HATs plug on to the 40-pin GPIO connector of the RBPi, model B+.

Although the RGB LEDs look great when working without a cover, a diffuser can soften the light output and mix neighboring colors, presenting a uniform display. You can use the matrix to present static or dynamic information. This pocket aurora, the Unicorn HAT, can present a wash of controllable color, which you can use for mood-lightening, pixel art, status indication or for simply blasting your surroundings with color.

The human eye has persistence of vision. That means it briefly remembers the image it has seen for about one-sixteenth of a second after the image is removed. You can use this feature to present information on the LED matrix of the Unicorn to make it look as if the image is moving continuously.
With all the colors of the rainbow at your disposal, this 8×8 RGB LED matrix can present countless hours of enjoyment and fun while teaching programming.

Infrared Thermopile Sensor for the Raspberry Pi

The usual process for measuring temperature is to place the probe directly touching the surface whose temperature is to be measured. That assumes the sensor is placed on the tip of the probe and must be in contact with the surface of interest. However, heat is a radiation and as infrared rays emanating from the surface carry information about how hot the surface really is, it should be possible to measure temperature remotely. Texas Instrument has designed a contact-less infrared thermopile sensor, the TMP006, and Adafruit is offering this on a breakout board suitable for the popular single board computer, the RBPi or Raspberry Pi.

Therefore, using this Infrared Thermopile Sensor with the RBPi, you can measure temperature of an object without touching it. The TMP006 is an embedded thermopile sensor that absorbs Infrared radiation emitted by a surface towards which you point it. It generates a small voltage proportional to the radiation falling on it, which the RBPi substitutes in a polynomial equation. The RBPi solves the equation, thereby converting the voltage into degrees, either Centigrade or Fahrenheit, as the user requires. TMP006 is capable of measuring over an area, so it is handy for determining the average temperature of an object.

As the TMP006 sensor comes in an ultra-small package, a BGA with 0.5mm pitch, it is impossible to solder manually. That is why Adafruit is offering this sensor already soldered on an easy to use breakout board. As the sensor works with three or 5V logic, no logic shifting is necessary to interface it with the RBPi. The sensor IC has two address pins and works with the I2C protocol. Therefore, you can hook up eight such TMP006 sensors to the RBPi, should you need to expand on the measurement. The Adafruit board has a 0.1” breakaway header to allow easy soldering, making it easy for using the sensor on a breadboard. The board also has two mounting holes for attaching it to an enclosure.

Users must note that TMP006 works by measuring the emissivity of an object. The sensor is suitable for measuring the temperature of a surface that has an emissivity greater than 0.7. The surfaces of most polished and shiny metal objects have an emissivity value too low for use with the TMP006. However, for measuring the temperature of surfaces with low emissivity, you can paint it with lampblack paint, which has an emissivity of 0.96.

The TMP006 accurately detects signals in almost the entire field of view of the sensor. For calculation of the final temperature, the sensor integrates all the signals present in the field of view. Therefore, more the signal that the IR sensor can capture from the target better is the accuracy of its measurement.

The percentage of signal absorbed by the IR sensor depends on the angle of incidence of the signal with respect to the sensor. Therefore, for best results, you must place the TMP006 directly underneath the target object. This will make the surface of the target parallel to the TMP006, and the angle of incidence between them will then be zero degrees, allowing the sensor to capture the maximum amount of signal.

Raspberry Pi and the Smart Video Car

As kids, nearly everyone has played with a battery-operated car controlled by a remote. Now, you can have the same with the Smart Video Car, but with vastly enhanced features. Additionally, you can control the Smart Video Car from your PC, because running the car is the versatile, single board computer, the Raspberry Pi, or RBPi.

You are in luck if you already have an RBPi B+ or the RBPi 2 with you, as the car comes as a complete learning kit, but without the RBPi. The car operates on 7-12V DC, supplied by two 18650 rechargeable lithium batteries. Since the RBPi cannot operate with such high voltages, a step-down DC-DC converter module is included. The module steps the battery voltage down to 3.3V, suitable for the RBPi to operate satisfactorily.

The kit contains all the multiple parts needed to put the car together. The driver module is based on the IC L298N, from ST Microelectronics, which works as a full-bridge motor controller. That means you can run the car backwards as well. To let the PC control the car wirelessly, the kit includes a USB WLAN stick or Wi-Fi Adapter. To know where your Smart Video Car is at any moment, you can check out the video it sends to your PC or smartphone through its webcam in real-time. The webcam is a part of the kit.

Using the PC, you have complete control of your Smart Video Car. Apart from forward or backward motion, you can turn the car left or right to avoid any obstacles in its path. An additional feature is you can control the camera independently to turn it vertically and horizontally. This way, you can capture the image from different directions.

SunFounder, the manufacturer, supplies all the necessary instructions, diagrams, descriptions and code in a complete manual along with their kit. A Tower Pro Micro Servo SG90 drives two front wheels of the car kit to make it turn left or right, while the other two rear wheels are active wheels. Two Gear Reducers drive the rear active wheels. A 12-bit PWM driver with 16 channels drives the L298N driver module for DC motor.

If you are just beginning to learn the RBPi code and application, this is a great kit to start. However, the kit also teaches you about basic components and modules in electronics. You can then use this knowledge for furthering your application and explore in different fields.

As SunFounder provides the entire code including all the necessary parts, anyone can assemble the kit referring only to the user guide. Building this Smart Video Car can be a fascinating experience and an enjoyable one. If you are running Linux on your PC, you can realize the car control very easily. You can even use Linux running on a virtual machine with equal ease.

The kit uses MJPG-streamer to capture images and transmit video in real-time. If you have a Firefox or Google Chrome browser running on your PC or smartphone, you can easily view the video on the browser and at the same time control the Smart Video Car.

Get 37 Sensors for Your Raspberry Pi

If you have a bunch of school kids rearing to have a go at the most popular single board computer, the Raspberry Pi or RBPi, then this 37-sensor kit is something that can keep them happy for hours on end. Fans of the open source RBPi will relish the different kinds of experiments they can try out with the funny and completed modules in this new kit.

The modules in the kit connect to your RBPi and send it all kinds of different signals from the physical world. Using these modules by connecting them to the RBPi is very simple as the manufacturer of the kit provides detailed information and usage guidelines for all the sensors in the kit.

The latest kit from SunFounder comes with the sensors neatly packed in a plastic box, along with the 168-page user manual. The improved Fritzing breadboard and the sensors are suitable for the RBPi Model B+ and RBPi2. The kit also contains the detailed material list of each module. Users get the improved code in Python and C along with the Fritzing images. That certainly helps the user to learn to use the sensors for their individual applications.

You must have your own RBPi for using the sensors in this kit, as the kit itself does not come with the RBPi. Moreover, the 40-pin GPIO expansion board included with the kit is for the RBPi B+. The most interesting part of the kit is the 16×2 LCD module and the Breadboard. Using these and the several sensors you can try out about 35 experiments listed in the kit.

The experiments cover a mixture of analog and digital electronics. For example, you can learn about how a relay works, how a mercury tilt-switch functions or how to make an active or a passive buzzer sound the alarm. Those interested in remote sensing will find the Hall sensor fascinating, along with the sound sensor and the gas sensor. With the Ultrasonic Ranging Module, you can easily measure distances without approaching the distant object.

For those interested in temperature measurements, there is the DS18820 Temperature Sensor and the Thermistor module. The RTC-DS1302 module will help in measuring in real time, while the Barometric-BMP180 and the Humidity sensor will help in determining or predicting the weather.

Experiments in light interest many. For them, the kit includes dual color LEDs, RGB LEDs, and Auto-Flash LED modules. Photo-interrupter modules, IR obstacle modules, IR remote control module and the IR receiver modules will help those interested in communication with light beams.

Control experiments that are more sophisticated are also possible. For example, those interested in Analog to Digital and Digital to Analog conversion and control will find the AD/DA Converter PCF8591 module to be useful. Other modules such as the Rotary Encoder module, the Joystick PS2 module, the MPU6050 module hold promises of still further sophistication.

The kit is suitable for all types of beginners, learners and the more initiated. It is an attempt to allow users to learn the basics of analog and digital electronics. Users can then move over to experimenting with different types of sensors and learn about controlling their physical world.

Predict Solar Eclipses with Wolfram on Raspberry Pi

Wolfram Research shows how the Wolfram language, used on a Raspberry Pi or RBPi, can help visualize solar eclipses. With this combination, you can view past and present solar eclipses. The most astounding aspect is the solar eclipses you visualize can be not only total or partial, but also as if seen from Earth, Mars or Jupiter.

Depending on your present geographical location, you may or may not be able to witness a solar eclipse. To recapitulate, solar eclipses are events where the Moon blots out the Sun to observers on the Earth. The Moon may be so positioned it blocks out the entire Sun or a part of it. If the Moon blocks out a part of the Sun, the incident is termed a partial eclipse. In a total eclipse, an observer on the Earth will only see the corona of the Sun as a halo around the Moon as it covers the Sun entirely.

By mathematically tracking heavenly bodies, it is possible to predict when a solar eclipse is likely, if it will be visible from a specific location and whether it will be partial or total. Usually, the media drums up a small hype of the event, predicting local weather conditions, telling people how and when to observe the eclipse while including other relevant details. However, this is only if the eclipse is visible in your area.

For people on the Wolfram Community, geographical hurdles do not exist. Novices, experienced users and developers from all over the world share data and knowledge. The Community discusses the latest solar eclipse with anticipation, observation and data analysis. They also participate in the computations for future and extraterrestrial eclipses.

For example, consider the total solar eclipse that occurred on March 20, 2015. Before the event, Jeff Bryant and Fransisco Rodriguez from Wolfram explained how the community could compute the geographical locations from where the eclipse would be totally or partially visible. Fransisco used GeoEntities to highlight with green those countries that would witness at least partial solar eclipse on the date.

Although they predicted the visibility of the solar eclipse, neither Jeff or Fransisco was able to see even the partial solar eclipse, as the former is in the US and the latter in Peru. In their prediction, the intense red area shows the regions from where the total eclipse would be visible, while the lighter red areas depict regions of visibility of the partial eclipse. Another total solar eclipse is predicted in the next decade, of which, at least a partial phase will be visible from almost all countries of the world.

Wolfram now has a new language function, the TimeLinePlot. This is a great way to visualize a chronological event such as a solar eclipse. With TimeLinePlot, you can specify the last few years and the next few years to plot territories and countries from where a total solar eclipse will be visible. TimeLinePlot complies with ISO 3166-1 when depicting territories and countries. Using the incredible powers of computational info-graphics, Wolfram predicts a spectacular total solar eclipse spanning the US from coast to coast on August 21, 2017.

Let Raspberry Pi Track Bats for You

If you live in an area that has fruit trees around, it is likely bats share your space. Bats are furry mammals that flit about at night, feasting on insects and fruits. Although they are not gifted with good eyesight, they locate prey and avoid obstacles using echolocation. They are expert fliers and it is difficult to observe them since they are so silent.

Although humans cannot hear bats, it does not mean these creatures make no noise. In fact, using the process of echolocation, bats produce a considerable amount of sound. However, humans cannot hear them because the sound bats produce has a frequency range beyond human hearing capabilities. Depending on age, humans can hear sounds produced in the frequency range between 20 Hz and 15-20 KHz. Bats can hear and produce sound up to about 110 KHz. That is why a Raspberry Pi or RBPi is necessary to collect process and graphically represent bat calls.

An analysis of bat calls shows the sounds they produce are quite loud and not limited to just one tone. Different breeds of bats produce a variety of sounds, differing just as bird chirping does. For example, their tone may sweep down from a high frequency to a low one, or move around a specific frequency.

Holger and Henrike Korber from Germany have used an RBPi to make a bat detection device. To collect the sound produced by bats, they use an inexpensive microphone of high sensitivity capable of responding to high frequencies. The algorithm they use allows not only a graphical representation of the calls, but also identification of the bat species as well. Additionally, the software allows manipulation of the calls to bring them into frequencies within the human hearing range and create histories of bat activity.

On their site, which translates to Bat Conservation in English, the Korbers offer a list of bat literature. If you can know the German language, you will find a treasure of information on echolocation and acoustic identification of bat species. To read in English, pass the page through Google Translate.

Details of their new WLAN-Raspi-Bat detector are available here. The detector, based on the RBPi Model B+, is wirelessly connected to an external notebook. That allows easy manipulation of the configuration and wireless recording of data. The RBPi bat project uses a UMTS stick for WLAN communication and a modified image of the RBPi OS.

The WLAN-Raspi-Bat detector sends SMS text messages automatically and at freely configurable times. For example, this could be just after the RBPi has booted or just before it shuts down. As the detector is portable, it is important to save on power consumption and data space on the SD Card. To keep the arrangement simple, the Korbers use a simple clock timer to start and shut down the RBPi. As bats venture out only at night, the RBPi can sleep during the day along with the bats.

As the detector communicates wirelessly, there are numerous applications. For example, it is able to operate at locations hard to access, such as in trees up to the canopy and in buildings with difficult access.

What Can the Raspberry Pi Do After Dark?

A lot more goes on in the museums of the world at night, after everyone has vacated the premises and the guards have locked up the place, than one can imagine. The situation may not be as dramatic as what Ben Stiller shows us in the movie, “Night at the Museum,” but still, it does warrant a serious investigation. This is what Tate Britain has done with its After Dark project with help from the inaugural IK Prize.

Tate Britain has one of the largest art collections in the world. In August 2014, it organized a project After Dark, where visitors could experience the thrill of a prohibited voyage, without once stepping into the museum. For 25 hours, more than 100,000 viewers across the globe saw live streaming video over the Internet from four robots let loose in the darkness of the museum. Additionally, 500 people could take control of the robots for approximately 12 minutes each, guide them as they like and see what the robots were witnessing.

RAL Space has engineered the robots, which are based on the tiny single board computer, the Raspberry Pi or RBPi. Working alongside the UK Space Agency or UKSA, RAL Space is one of the world’s leading centers for the research and development of space exploration technologies.

RAL Space worked in close collaboration with Tate Britain, and the team behind the project After Dark combined the latest software with the bespoke RBPi hardware. They designed and engineered the robots, creating a world-first, one of a kind experience and attracted audiences from all over. The Workers, a digital product design studio, designed the Web interface for After Dark.

For the late night explorations within the museum, people from all over the world get to guide four robots by taking control of any one of them. RAL Space has designed the robots to select new operators for driving them every few minutes. As long as the event is live, people can request control of a robot from the project website. The robots know you are waiting, and as soon as a slot frees up, will try to take you on a ride. Even while you wait, you can watch the video of the event being streamed live and appearing on the project website, and on Livestream.com.

You can use the on-screen buttons on the web-based control interface or the arrow keys on your keyboard for controlling the robot. You can make the robot move forward or turn, and even make it look up or look down. The robot senses obstacles around it, feeding this information back to you. Therefore, even though it is nearly dark, you, the navigator, can operate the robot easily.

If you take the robot too close to an object, it will stop moving and inform you through the web-based control interface. Once that happens, you still have control over the robot, as you can make it turn on the spot and let it move forward, continuing with the journey, provided the path ahead is clear.

Raspberry Pi Helps Marine Ecology with Autonomous Recordings

The health of marine ecosystems is linked to that of all living beings on Earth. Around the world, people are waking up to this truth and making efforts to find out what goes on in the murky depths of the oceans. One of the foremost indicators of the health of oceans is determining the population size of Cetacean species, which includes porpoises, dolphins and whales.

However, that is easily said than done. Over the centuries, man has recklessly hunted these gentle giants to the point of almost near extinction. Those left over, are in the endangered list. Conservation status and population size of these mostly endangered species is only possible by collecting extensive amounts of data about them.

Researchers are carrying out studies on the ecological impact of industrial activities such as human-generated noise on the coasts. A team from the University of Sao Paulo in Brazil is carrying out underwater acoustic monitoring. They quantify the human-generated noise while studying sound generated by cetaceans. Water being an efficient medium for transmission of sound, such research is useful because water allows easy detection of the tones and clicks cetaceans produce, even when they are hundreds of kilometers away.

The team first went about their research using commercial underwater recorders. However, they found these to be expensive and inflexible. Almost all the underwater recorders had proprietary hardware and software, which they found impossible or difficult to modify. Therefore, the team built a flexible, low-cost autonomous hydrophone recorder based on the Raspberry Pi or RBPi, an affordable single board computer. They published a paper about their effort in the open-access journal PLOS ONE.

The system is an underwater sound recorder. The entire unit consists of a 50 cm PVC case with 9.5 mm thick walls, closed on both ends. One end has a protective cage made of stainless steel, and this houses the actual hydrophone or an underwater microphone. All the other electronics is located within the PVC case, which is sturdy enough to withstand pressures up to 10 bar. Pressure-chamber testing establishes this as equivalent to pressures experienced almost 100 m underwater.

After signal conditioning, the analog output from the hydrophone passes into a USB linked analog to digital converter, which generates the digital data corresponding to the analog signal. The RBPi stores the digital information along with an appropriate time stamp. Five ordinary D-sized Duracell batteries power the RBPi and there is adequate room within the PVC enclosure to add four more such packs in parallel. Power from the batteries reaches the RBPi via a power management module. The RBPi also includes a real-time clock for generating the time stamp.

The team monitored marine traffic including dolphin and whale population on the eastern and southeastern coast of Brazil. They used their own RBPi based hydrophone recorders and these worked satisfactorily. According to the results of their tests, the devices recorded for two weeks continuously when powered with five battery packs. If they recorded for one hour each day, the researchers estimate the five batteries would power the recorder for over four months of recording.

The RemotePi Board for the Raspberry Pi

If you have designed a mediacenter system around a Raspberry Pi or RBPi, you would also want to control it remotely, just as commercial mediacenters allow. You can do that with the RemotePi Board. Added atop your RBPi, the RemotePi acts as an intelligent infrared remote controlled power switch and remotely controls to power on/off your mediacenter system.

The RemotePi does not need a special IR remote, as it can learn to decipher the IR code of almost any commercial remote – it works with a standard GPIO IR receiver. This allows you to switch off or on the power safely to the RBPi with any TV remote or a pushbutton. The RemotePi is available in two versions, the 2015 version for fitting on older RBPi models A or B, and the Plus 2015 version for fitting on the newer RBPi models A+, B+ or the 2. Two versions of RemotePi are necessary as the RBPi models differ in their physical dimensions as well as in the position of their connectors and mounting holes. For example, the RBPi models A and B have only two mounting holes, while RBPi models A+, B+ and 2 have four mounting holes on each corner.

For both versions of the RemotePi Board, two variants are available. One has the IR LED and receiver integrated on it, while the other has them connected via a cable. The cable-connected variant is useful if you plan to use the RemotePi Board with a non-transparent case or you intend to mount the RemotePi Board and the RBPi out of line of sight. In this case, you only have to keep the extended IR LED and receiver visible to the users. Although you can buy an acrylic case specifically designed to fit the RemotePi Board piggy backing on the RBPi, most of the readily available cases need only minor modifications to accommodate the two.

When using the RemotePi Board with the RBPi, you need to connect the power to the RemotePi Board and not to the RBPi. The RemotePi routes the power to the RBPi, decided by a micro-controller, which switches the power on or off based on the command it receives from a push-button on top of the board or the infrared remote control.

When you command the power to be switched off, the RemotePi first sends a notification to the RBPi via a signal on the GPIO port. The RBPi has a script running in the background that picks up the signal and initiates a clean shutdown of the operating system, avoiding data corruption.

The RemotePi Board cuts off the power to the RBPi completely, after the RBPi has successfully shut itself down. That reduces the power consumption of the duo to a few mA of standby current.

You must teach the RemotePi software to remember the infrared remote control button you want to use for switching power to the RBPi. For this, the RemotePi software has a learning mode and it stores the button information in its flash memory. Of course, you can make it learn a new button any time you like.

Raspberry Pi and the RTK Motor Control Kit

While building robots, many a time you need a simple motor controller for the RBPi or the Raspberry Pi. The RTK Motor Control Kit fits these requirements very well, is budget-friendly, works using the GPIO pins and needs very little coding. The self-assembly kit of the RTK Motor Control Board allows easy control of DC motors with your RBPi.

Once you have soldered the few components correctly on the board, plug the assembly on top of an RBPi. You can control the GPIO pins of the RBPi with a programming software such as Python, Scratch or any other. Connect power to the motors and you can start driving the motors in either direction simply by toggling the GPIO pin on or off. The board supports PWM or Pulse Width Modulation. With PWM, you can control the speed of each motor separately.

To program the board and drive a motor with it is as simple as turning a pin on or off. The tutorial section has an example code in Python, but you could use Scratch or any other compatible language as well. The pins you need to toggle for Motor 1 are 17 & 18 and for Motor 2 are 22 & 23. To control motors with the kit you will need a working RBPi board with its power source, one or two DC motors and 4.5-12VDC power sources for the motors.

To assemble the kit you will need a soldering iron of 35W minimum rating and a reel of 60/40 solder wire. Before starting assembly, it is advisable to read the assembly instructions included with the kit.

On unpacking the kit, you will find it containing the RTK-000-001 PCB, an H-Bridge driver IC SN754410NE, three two-way terminal screw blocks, three two-way pin headers, one 26-way pin GPIO header and one 16-pin IC socket. Ensure all parts of the kit are present before beginning the assembly.

Switch on the soldering iron and ensure it is hot. Place the PCB with the writing RTK RPi M.C.B. facing up and towards the right. Place the IC socket in the PCB at the label IC1, taking care to match the notch of the socket with the gap in the silkscreen. Hold the IC socket in place, turn the PCB around and solder all the pins. Solder the three terminal blocks in their positions J1, J2 and J3, ensuring the terminal blocks face outwards. Place the two pin headers into the PCB at positions J4, J5 and J6, taking care to insert the shorter side of their pins into the board and solder them in place.

Insert the RBPi GPIO connector from the bottom side of the board and solder the pins to the top side of the board. This is important, as the assembled board will sit on the RBPi with this connector engaging the GPIO pins of the RBPi.

Don your ESD wrist-strap and insert the H-Bridge IC into its IC socket, ensuring the notch on the IC matches with the notch on the socket. Connect the motors and their power supply with the correct polarity. Plug in the RTK Motor Control Board to the RBPI, and power on the RBPi first and then the motors.