Tag Archives: Raspberry Pi Projects

Latest Touch Display for the Raspberry Pi

Those who were on the lookout for a proper touch display for their single board computer, the Raspberry Pi or RBPi can now rest easy. The official RBPi touch display is on sale at several stores and others will be receiving stock very soon. Users of RBPi models such as Rev 2.1, B+, A+ and Pi 2 can now use the simple embeddable display, instead of having to hook it up to a TV or a monitor. Watch the You-Tube video demonstration for a better understanding.

The new official touch display for the RBPi is a 7” touchscreen LCD. A conversion board interlinks the display module with the LCD and plugs into the RBPi through the display connector. Although the ribbon cable is the same as that used by the camera, the two do not work interchangeably. Therefore, identify the display connector first, before plugging in the ribbon cable from the display.

You can power up the display in one of three ways: using a separate power supply, using a USB link or by using GPIO jumpers. When using a separate power supply, you need a separate USB power supply with a micro-USB connector cable. The power supply must have a rating of at least 500mA and requires plugging in to the display board at PWR IN.

It is also possible to power the RBPi through the display board. For this, use an official RBPi power supply of rating 2A and plug it into the display board at PWR IN. Use another standard micro-USB connector cable from the PWR OUT connector and plug it into the RBPi power in point.

Powering the display from the RBPi GPIO requires using two jumpers – one from the 5V and the other from the GND pins of the GPIO.

After plugging in the ribbon cable and making one of the above power connections between the RBPi and the display, using the display requires updating and upgrading the OS on the RBPi. On rebooting, the OS automatically identifies the new display and starts to use it as its default display rather than the HDMI. To allow the HDMI display to stay on as default, the config.txt file must contain the line:

display_default_lcd=0

For further setup steps, follow these instructions.

The RBPi display comes with an integrated 10-point touchscreen. The driver for the touchscreen is capable of outputting both full multi-touch events and standard mouse events. Therefore, it is capable of working with ‘X’ – the display system of Linux, although X was never designed to work with a touchscreen.

For finger touch operations in cross-platform applications, the Python GUI development system Kivy is a great help. Although designed to work with touchscreen devices on tablets and phones, Kivy works fine with RBPi.

The 7” touchscreen display for the RBPi is of industrial quality from Inelco Hunter and boasts of an RGB display with a resolution of 800×480 at 60fps. It displays images with 24-bit color and a 70-degree viewing angle. The metal backed display has mounting holes for the RBPi and comes with an FT5406 10-point capacitive touchscreen.

Make Your Raspberry Pi Follow Walls

The versatile single board computer, the Raspberry Pi or RBPi, makes an excellent base for an autonomous bot using a rover 5 platform. The bot uses custom laser range finders for basic wall following. It features speed control of each track, regulated by PID using feedback from its quadrature encoders, giving it the ability of directional control. The basic features are explained below.

Batteries power the bot, feeding two separate switching mode regulators. One supplies power to the motors via the H-bridge, while the other powers the RBPi and other electronic devices. The H-bridge and the SMPS reside on the lower layer of the bot, while the sensors and the RBPi are on the upper layer. Mechanical standoffs separate the two layers, and the physical separation between the two layers creates a barrier for the electromagnetic fields from the power system that would otherwise affect the compass.

A Pixy CMUCam and a line laser form the laser range finding system of the bot. A simple piece of PVC pipe with slots cut into it breaks up the beam from the line laser. That allows the cam to recognize the color of the laser blobs as it reports this data via I2C to the RBPi, which then uses simple trigonometry for converting the data into vectors representing range and angles.

A sonar device mounted on the front of the bot implements a fairly simple crash prevention mechanism. The laser range finding system may also be used for a more sophisticated crash prevention system. Even though the bot is meant for autonomous operation, it also has a basic user interface built-in to allow control for testing purposes. The interface allows simple operations such as setting the heading and limiting the forward and backward speeds. It uses some feedback from the current heading of the robot.

For testing the laser range finding, the bot has a built-in GMR or graphical mapping representation, but in a minimal configuration. Using the GMR reveals a basic difference between the mapping from the sonar device and that from the laser range finder. For example, the sonar data interprets long flat surfaces as convex, but the data from the laser shows them to be perfectly straight – implying the laser range finding is linear.

A custom mount holds both webcams and the laser line. As the cases of the webcams made it difficult to mount them, they had to be removed from their casings. One of the cams faces 25-degrees to the left, while the other faces 25-degrees to the right. That gives a 100-degree field of view to the bot. Both the cams are tilted upwards such that the bottom-line of their images is just below the horizontal.

The software processes the images and locates the laser line to calculate ranges. It makes 30 vertical scans from the top of the image looking for the laser line. Looking specifically for a laser line makes it simpler as the line is never vertical. Therefore, every point located on the line has a neighboring point.

A New Raspbian for your Raspberry Pi

Your single board computer, the Raspberry Pi or RBPi runs an operating system, or more specifically a Linux OS. Keeping true to its form, the Linux OS comes in umpteen flavors and you can choose and pick the one most suitable to your purpose. Operating Systems are built for the processor in the system, and the most popular so far are the Intel family of processors. Since SBCs generally use the ARM family of processors, a special version of the Linux OS is available for them. Of the many versions of the Linux OS for the ARM processors, the Raspbian is the most popular. A new version of Raspbian is now available.

Although people consider versions of operating systems primarily as updates and bug fixes, the new Raspbian is something more. The existing Jessie image used for the desktops and laptops has been modified and adapted to work with the ARM family of processors. Among the standard applications that come with Raspbian, many have been upgraded to offer newer features.

The new Raspbian offers Sonic Pi, version 2.9. If you view the history section of the Info window in Sonic Pi, you can read the full list of changes. The most important are two new effect functions – all articles of SAM Aaron of The MagPi magazine are now included as part of the online tutorials, and there is a new logging system.

Scratch, at version 20160115, has an improved capability for sound input, and supports the CamJam Edukit 3 robotics board. It offers basic PWM support in its GPIO server, and adds several improvements to the font scaling and display.

You will get the new Mathematica at version 10.3 with added support for additional functionality as described by Stephen Wolfram in his book. It supports Sense HAT, includes several new functions, and adds more interfacing to the Arduino.

WiringPi library has been upgraded to version 2.31 and now it allows access to the GPIO pins without use of the the sudo command from applications that use the library. Another Python library, the Rpi.GPIO is at version 0.6.1, and includes several bug fixes that plagued the GPIO Zero library. Additionally, the ping command does not require sudo anymore.

The ALSA system had earlier made it very difficult to get some USB devices to work as the default output. Now it has a new volume/audio device icon on the taskbar. That allows it to be compatible with a wider range of audio devices than before.

With the improved Main Menu editor, you can now create new menus. Earlier, the LXDE desktop environment did not allow visibility of all other menus, and this has now been addressed to work correctly.

Overclocking options for the RBPi models 1, 2, and Zero boards are now available from the command-line and the RBPi Configuration GUI. Updated language translations are also available for those not using English.

Earlier, there was a wide selection of names in different places such as Trash, Rubbish Bin, and more. Now, the name is consistently Wastebasket everywhere when you set the desktop to British English.

PIXY: Versatile CAM for Your Raspberry Pi

If you are looking for a small, fast, low-cost, easy-to-use, and readily available vision system for your Raspberry Pi or RBPi, then the Pixy can be a great choice. Pixy or CMUCam5 is somewhat more than a normal camera that you may have used so far for your single board computer. It comes with several features not available on most camera systems.

First, Pixy is versatile – use it for all kinds of projects. Along with the hardware, you will receive all kinds of information – PCB layout, bill of materials, schematics, and other hardware documentation. All software/firmware is GNU-licensed and open-source. The configuration utility provided with Pixy runs on all platforms – Windows, MacOS, and Linux. RBPi can communicate with Pixy over one of several interfaces – analog/digital output, USB, UART, I2C, or SPI. The Pixy comes with all libraries for RBPi, BeagleBone, and Arduino and supports programs written in Python and C/C++. The cable provided with Pixy can connect directly to Arduino, and it also works with BeagleBone and RBPi.

On the performance side, Pixy can learn to detect and recognize objects that you have taught it and outputs what it detects 50 times per second. With a Pixy, an RBPi and a servo control board, you can reconstruct Wall-E, the waste-collecting robot.

Pixy resulted from a partnership of the Carnegie Mellon Robotics Institute with Charmed Labs. First started as a Kickstarter campaign, Pixy is now the most popular vision system since it first started selling in March 2014. You can gage the versatility of Pixy from the activities it can do in association with an RBPi – pick up objects, chase a ball, locate a charging station, and more – doing all this with a single vision sensor.

Although there are other vision systems that can sense or detect practically anything, almost all of them have two drawbacks. One, they output huge amounts of data, a few megabytes per second. Two, enormous computing power is necessary to process this data, leaving the attached SBC with little else to cater to other tasks.

Pixy gets around these barriers as it pairs a powerful and dedicated processor along with its image sensor. The processor does all the processing of the data captured by the image sensor, and sends only the relevant information to the attached SBC. For example, yellow ball detected at x=50, y=110. Therefore, the RBPi can easily talk to Pixy and still have enough computing power left over for other activities. That also means you can have multiple Pixy cams hooked up to your RBPi. For instance, you can make a robot with a 360-degree sensing capability with four Pixys.

Although Pixy began with interfacing capabilities with the Arduino controller, it has matured sufficiently to be able to communicate with other controllers as well. The Pixy comes with all sorts of software libraries and a Python API for connecting to Linux-based controllers, such as an RBPi.

On-board Pixy is a color-based filtering algorithm that helps in detecting colored objects. The popular color-based filtering method makes Pixy singularly fast, efficient, and relatively robust. Pixy examines each RGB pixel from the image sensor and computes the saturation and hue to use as its primary filtering parameters.

Expand the Ports of your Raspberry Pi

The ubiquitous single board computer, the Raspberry Pi, or the RBPi, as it is fondly called by its users, is rich in General Purpose Input Output or GPIO pins. These are lined up on the board in two rows of 13 easily accessible pins, totaling 26 of which 17 are GPIO pins, the others being either power or ground pins.

GPIO pins provide a physical interface between the RBPi and the external world. Speaking plainly, these act as switches that the user can turn on or off as inputs or the RBPi can turn on or off as outputs. GPIO pins are physically arranged along the edge of the RBPi board, next to the yellow output socket for video.

To allow the RBPi to interact with the real world, you can program the pins in amazing ways. For example, there need not be a physical switch to connect inputs. Inputs can come from a signal from a device such as another computer or a sensor. Similarly, outputs can be made to do almost anything, such as sending data or signal to another device such as an LED.

One of the advantages of having an RBPi on a network is you can control devices attached to it from remote places, while collecting data from those devices. Connecting to and controlling physical devices over the Internet is exciting and a powerful feature best done by the RBPi.

However, some applications demand more input and output pins apart from the 17 that are available on the RBPi. That requires the user to expand the GPIO pins and this they can easily do by using the Quick2Wire Port Expander board. The board adds 16 more GPIO pins to the RBPi’s 17, so you can now have 33 GPIO pins with one expander board.

Additionally, you can stack more boards to have more GPIO pins. Each expander board can be preset with a configurable address via DIP switches on-board. Since eight addresses are possible, you can add eight more boards. Each board communicates to the RBPi via the I2C bus.

The Inter Integrated Circuit Communication protocol, called I2C in short, links the micro-controller or microcomputer to other micros or circuits. Another similar protocol is the Serial-Parallel Interface or the SPI. Both protocols are widely used for robotics and hobby electronics projects.

NXP (originally Philips) developed the I2C protocol. This is a very popular protocol used in several equipment including computer motherboards, monitors and TVs. Although a very flexible protocol, I2C is rather limited in its bandwidth.

Freescale (originally Motorola) developed the SPI protocol, which is much faster as compared to I2C. However, it is somewhat more complicated to use and has its own limitations.

Modern micro-controllers now support both protocols. These include the RBPi, Arduino, BeagleBone and BeagleBoard. Therefore, with I2C, you can control a host of devices, treating them as slaves and using two lines SDA and SCL. With SPI, data rates of over 10 MHz are common. Data transfer happens over three lines, one of which carries the clock and the other two communicate between the master and the slave.

Cool your Raspberry Pi with PiCoolFan

Applications for the single board computer, the Raspberry Pi or RBPi are exponentially increasing and there is a great demand on the RBPI for extending its performance to the limits. While users try to push their RBPi to achieve higher results with overclocking, this may result in SBC frying itself, unless the CPU temperature is kept in check.

To enable complete control over the CPU temperature, an advanced cooling fan system is available – PiCoolFan. On the bonus side, the system also includes a Real Time Clock that RBPi does not have in-built. Therefore, if your RBPi is running hot, for whatever reasons, you can use the PiCoolFan to keep its CPU cool. The applicability extends to all models of the RBPi.

The cooling fan does not require any additional power supply to operate. It draws its power from two GPIO pins. You simply have to insert the connector on the PiCoolFan on top of the P1 connector of the RBPi. A dedicated sensor on the PiCoolFan continuously senses the PCB temperature of the RBPi, feeding the readings to an embedded temperature measurement system on the PiCoolFan. Depending on the measured temperature, the micro-controller on-board the PiCoolFan will start, stop or regulate the rotational speed of the tiny fan.

As an added advantage, PiCoolFan contains an Air Distribution Plate, which cools not only the microprocessor on the RBPi board, but also all the heat-generating devices and the entire RBPi PCB. The RBPi user can easily access the embedded micro-controller on the PiCoolFan via the I2C interface. Apart from being able to read the temperature measured, the user can also set the temperature threshold and the temperatures at which the micro-fan will start and stop.

The PiCoolFan also offers on the same board a real time powering voltage monitoring and a real time clock with full battery backup. The entire unit is small enough to be included within most of the already existing cases of the RBPi. Apart from reading the temperature via I2C interface, PiCoolFan offers the user an information system based on three LEDs. A glowing blue LED assures the user the RBPi is comfortably within the allowed operating temperature range. If the temperature exceeds the range, the red LED will start to glow.

A flashing green LED indicates the powering status. When the voltage is within threshold limits, the flashes are continuous. When higher than the threshold, the frequency of the flashes increases. If the voltage is below the threshold limit, the frequency of the flashes decreases. Therefore, with a transparent case, it is easy to see from a distance whether the temperature and voltage of the RBPi system is within specified limits.

The user has complete control over the PiCoolFan system via the I2C interface. The fan can be switched on or off unconditionally and its speed controlled by pulse width modulation or PWM. The user can read the current system temperature and set the temperature threshold – PiCoolFan supports both the Celsius and the Fahrenheit scales. The PiCoolFan kit contains all the hardware necessary for setting up the fan and the air distribution plate.

Raspberry Pi Can Keep Your Plants Happy

Those who like indoor plants know how important it is to maintain a proper atmosphere for the plants to grow happily. Only a few parameters are important – air humidity, air temperature and soil moisture apart from adequate sunshine. However, it is rare for people to be able to monitor the health and well-being of their flora personally, given the busy schedules.

That is where a single board computer such as the Raspberry Pi or RBPi can help. Being flexible in setting up and connecting to the various sensors necessary, this SBC not only looks after the plants, but also alerts you with SMS and via email whenever the situation differs from the normal. This project also has an app, Plant Friends, for your Android phone, so that you are up to date on the real-time and historical parameter data on your plants. The project consists of three main components – the sensor nodes, the base station and the app.

You need a sensor node for each plant. Each of these sensor nodes consist of an Arduino clone called Moteino fitted with an RF transceiver, a battery meter, a temperature sensor, a humidity sensor and a sensor for soil moisture. The sensor nodes collect the readings from all the sensors and transmit the data using the transceiver to the base station. The sensors and the base station are connected via the 915MHz ISM band.

For this project, users must be slightly above the beginner level. Some basic experience with Arduino hardware and Arduino IDE will be necessary – for installing libraries, making LEDs blink, etc. Additionally, experience in wielding a soldering iron is also necessary. On the RBPi side, it is essential to be familiar with the basic knowledge of the SBC and with installing the Raspbian OS.

The Plant Friends system has several advantages. It reminds you to water your plants and sends you an alert via email and/or SMS. It works for multiple plants at the same time, even if they are in different rooms of your home. Since wires are a minimum and all components of the system are of a reasonable size, you can move the plants and the system freely about the home.

The entire system consumes low power and therefore runs on batteries. Typically, battery swaps are necessary every 4 to 6 months. The electronics is low-maintenance as it is housed in a moisture-proof enclosure. The best part of the system is the Android app, as it allows monitoring from anywhere in the world.

An RBPi, model B, is used for the project, although a model A will work equally well. However, model B has more RAM and an Ethernet port, which may be necessary for flexibility. A USB Wi-Fi adapter helps to connect to the internet.

For each sensor node, you will need a holder for four AA type rechargeable batteries. In addition, you will need a combined sensor for temperature and humidity. For sensing the moisture in the soil, you may use a soil probe consisting of a PCB with exposed traces. However, ensure there is no lead involved.

Keep Your Fish Happy with a Raspberry Pi

People who keep fish in aquariums at home know it is important to feed them timely and to keep their habitat clean. Trouble starts when the owner has to leave home for a few days and cannot find a knowledgeable caretaker to take care of the pets. Cabe Atwell tried to solve the problem he faced in an ingenious way – by using the power of the Internet.

Cabe had an automatic fish feeder, but he also enlisted the services of a friend to keep an eye on her goldfish, the friend was not sure of what was required and the automatic fish feeder broke down. Fortunately, the losses were not fatal, but Goldie the goldfish grew to double her size because of overfeeding. This led Cabe to work on a system to allow watching and feeding the pet over the Internet.

Cabe wanted a system that would allow seeing the fish in real time, anytime, by moving a camera around the tank. The next requirement was sensing the tank water temperature and cutting off the power to the tank bubbler and air filters, if necessary. It was also necessary to feed the fish manually, and above all, to do this through a network and ultimately, via the Internet.

Cabe’s research led to the conclusion that a Single Board Computer such as the Raspberry Pi or RBPi and a Pi camera would be most suitable for seeing the fish via the internet. For the other features, an Arduino Uno was more appropriate.

Accordingly, Cabe selected two small Nema 17 mount stepper motors, available on Adafruit, for the driver components. The motor controls came from an Arduino Motor Shield, which made it simpler to drive the motors. Cabe designated one motor for allowing movements in two directions, while the other rotated the food container to dump fish food into the water.

The fish feeder was a modification of the original malfunctioning feeder. It consisted of a drum to hold the fish food. When rotated completely around, a simple trap door opens briefly to let a small amount of feed.

To keep the camera motor traveling too far, Cabe incorporated limit switches in both directions. The limit switches were placed in position using rare-earth magnets, which allowed easy adjustments for the movement range. A surplus belt driven motion platform provided an affordable arrangement for viewing the entire length of the tank.

For sensing the water temperature, a waterproof digital temperature sensor was the most suitable – DS18B20. Although fresh-water fishes are more tolerant of water temperature variations, loss of air-conditioning or heating arrangement can lead to the tank water becoming too hot or cold for the comfort of its occupants.

For the video stream, Cabe settled on VLC since it was easier to use. VLC offered the maximum resolution of 640×480 pixels at 15 frames per second, which Cabe found adequate for keeping a tab on the fish. A simple AC relay took care of feeding power to the air filters and bubbler.

For the future, Cabe wants a better AC control and more sensors for measuring the pH, ammonia and nitrate levels in the water.

Incubating Eggs with a Raspberry Pi

Incubating eggs is a process best left to the mother bird alone or sometimes the father bird. That is because nature has programmed them for applying the appropriate temperature profile necessary to hatch their eggs successfully. However, this vital information is no longer the sole proprietary knowledge of the birds alone. Humans, at least those who rear chicken, probably know as much.

Hens incubate their eggs by sitting on them and instinctively controlling several factors, mainly the temperature and humidity, with their body heat. They also turn the eggs over periodically, which is vital for a successful hatch.

Although there are commercial alternatives available, building your own incubator has its own advantages such as affordability and the ability to add features. Dennis Hejselbak from Denmark has not only made such an incubator, but has also posted complete build instructions here. For those who want to follow, Dennis uses a Raspberry Pi or RBPi, the tiny, versatile single board computer for controlling his incubator. He has made available the necessary Python codes and the wiring schematics as well.

Dennis has built his incubator box from polystyrene, which makes it well insulated. He controls the temperature inside using an incandescent light bulb and an old CPU fan. Wet sponges inside the incubator supply it with the moisture necessary, while a hygrometer keeps an eye on the humidity levels. The RBPi controls the light bulb and the CPU fan based on feedback from a temperature sensor and the hygrometer. Dennis keeps watch on his eggs via a camera attached to the RBPi. He has enabled his RBPi with Wi-Fi and real time pictures of the incubation process are available on his website.

The only process Dennis has not attempted to automate so far is the periodic turning over of the eggs. He does this manually, about three times each day, until the eggs hatch. Although hatching eggs takes about 21 days on average, some eggs may hatch a day or two early and some a day or two late.

As Dennis is using forced air for his incubator, he programs the RBPi to keep the temperature within about 99-99.5°F (37.2-37.5°C). For successful hatching, eggs require 45-50% humidity from day 1 to 18 and 65% for the balance few days. Dennis has placed the temperature and humidity sensors to hang just above the eggs.

As the incubator is a large box, placing the RBPi on its top was not a difficult task for Dennis. This has its advantages as the box needs only a single hole for both the cables of temperature and humidity sensors to pass through – making it easier to insulate. Of course, other holes are necessary for the cable of the light bulb. Dennis handles all monitoring of the RBPi from outside, without having to open the incubator.

The RBPi controls the temperature by turning the light bulb on or off as necessary. A simple electromagnetic relay operated with a power transistor is enough for this purpose, although those who are adventurous among you may opt for a more expensive solid-state relay.

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.