Tag Archives: Raspberry Pi Projects

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.

A Slice of the Raspberry Pi

The Compute Module of the credit card sized popular single board computer, RBPi or the Raspberry Pi, is not an end-user product. Manufacturers can use the device when they require an ARM-based platform to build their devices on and sell. Therefore, computing hobbyists will find it difficult to get their hands on the Module if they want to evaluate it.

The RBPi itself is readily available to anyone who wants to buy and use it for projects. However, this Compute Module is not sold as such to hobbyists and for evaluating the Compute Module, it is necessary to get hold of a real product based upon it.

Five Ninjas, some people from the RBPi Foundation and the Pi-friendly accessories seller Pimoroni has a compact media player based on this Compute Module. Their product – Slice – was the result of inspiration based on the original Apple TV.

The first Apple TV was based on the x86 and was silver colored. This was eminently hackable, unlike the later iOS running black box that Apple made. People ripped out the custom Mac OS X installed, replacing it with a Linux desktop. They then added a more open, flexible media center, which ran XBMC.

The FiveNinjas Slice Media Player turned out to be more powerful than the modified x86 version of the Apple TV. The first few Slices have just left the Sheffield assembly plant of Pimoroni. Each has a custom motherboard with a single Compute Module in a DIMM-slot.

The Slice looks like a small metal box that has a translucent plastic spacer running all round the middle. The metal of the box is anodized aluminum in one of choice of three colors – red, gunmetal and black. The entire device feels and looks very stylish. Although you cannot see inside the box through the spacer, Slice puts out a very cool light through it. The light comes from Slice’s 25 NeoPixels. These are individually addressable RGB LEDs, with each containing an in-package controller.

The Slice uses these LEDs to create a rainbow of various color sequences. These sequences are triggered as the user interacts with the Slice using its remote control. While Apple had a slimline aluminum remote, Slice has a somewhat thicker one made of plastic.

Slice has 4GB of flash, which allows it to run any Operating System without a hard disk. It actually runs OpenElec, which is a simplified Linux distro capable of booting straight into Kodi, the media application. Therefore, users can simply play video and music files on their NAS or share from their computers.

Internally, Slice has a SATA connector mounted on the underside of the motherboard. Users can put in a small 2.5 inches disk drive and fasten it on to the motherboard within the case. There are four USB ports and users can hook up Slice to their computers to mount as an external drive automatically.

Currently, there is no app to control the display of colors from the LEDs. However, one is in development and will be available soon. The Compute Module uses a powerful 900MHz Broadcom SoC with a graphics core.

Pi Lite: Bright White LED Display with the Raspberry Pi

If you did not know, you can run many LEDs with the tiny, credit card sized single board computer popular as the RBPi or Raspberry Pi. Among the many accessories made for the RBPi using LEDs, Ciseco makes one that is very interesting and useful. This is a display panel using bright white LEDs and aptly named the Pi Lite. You can use the series of white LEDs on the Pi Lite as a scrolling marquee for a Twitter feed, for displaying real-time weather information or stock quotes. You can use it to display static information such as time or functional information such as bar graphs, or other dashboard type applications such as VU meters. On the other hand, you could even play such games as Pong. Pi Lite is strong enough to view in direct sunlight.

Pi Lite is completely self-contained and does not require any soldering. You can get Pi Lite in two colors – white and red. For operation, simply connect Pi Lite to the GPIO pins of the RBPi, and you are set. GitHub has several open-source projects that you can download or you could do your own programming using Python code.

If you are just starting out with the RBPi, Pi Lite is an exciting way to let RBPi do some physical work and generate some fun. The large LED matrix display is easy to plug in and add-on. Since no soldering or any other special skills are needed, anyone can simply start using the Pi Lite for their project.

All the 126 LEDs on the Pi Lite are in the form of a 14×9 matrix, with an ATMega328p processor controlling them. This mixes the highly popular LOL or Lots of LEDs shield of Arduino with the world of RBPi. The Pi Lite communicates with the RBPi via the standard serial communication protocol at 9600bps. That makes it a simple affair to send graphics and text to the LED matrix. With the ATMega processor driving the 126 LEDs, the RBPi processor and its GPIOs remain free for other functions.

The Pi Lite offers several advantages. You can read your emails or tweets from a distance in real time. The firmware being open-source, you can add extra functions as you like. You can achieve multiple functions by sending simple text strings – scroll the text, VU meter, bar graph and or graphics. You can use the well tried, tested and supported LOL shield by Jimmy Rogers. The serial interface makes Pi Lite useful for connecting to any TTL micro radio or PC interface – you can use the popular FTDI cable.

The Pi Lite uses a high quality gold plated PCB. No extra power supply is required, as Pi Lite draws only 49mA maximum at 5VDC, so the RBPi supply can power it. With preloaded software, you can use it out of the box and display variable speed scrolling text, 14 vertical bars as a bar graph, two horizontal bars as VU meter, frame buffer for animation and graphics, or turn on or off individual pixels.

To make a bigger display, you can link up additional Pi Lites with the I2C bus. Each Pi Lite measures 85x55x13.7mm.

Power Supply Ignition and other Switches for the Raspberry Pi

There are several occasions where you may require operating your RBPi or Raspberry Pi powered from a vehicle’s electrical system. To keep your single board computer safe and operational, an accessory is needed to sense when the ignition on the vehicle is engaged and when it is turned off. Accordingly, the accessory will respond by powering the RBPi on or off safely. MausBerry Circuits make such safe power supply ignition switches and other shutdown switches for the RBPi to be used in vehicles.

The power supply ignition switch attachment from MausBerry features a built-in step-down converter that produces 5V from the 12 or 14V of the vehicle’s power supply. Once connected with wires behind the vehicle’s radio, the attachment provides the RBPi with instructions based on the vehicle’s ignition status. It communicates with the RBPi using two of its GPIO pins.

An added advantage of the ignition switch attachment is it can retain power for about 20 minutes during its power-down cycle. That means the RBPi will remain powered for 20 minutes after the vehicle’s ignition is switched off, so waiting for the RBPi to boot is not required for those making frequent stops. A selector switch on the device will allow you to reboot the RBPi, if required. Even if the RBPi was left in the vehicle and not shut down, there is no cause to worry. The automatic shutdown feature of the device will kick-in to shut the RBPi down after four hours of non-use, thereby preventing drain on the batteries.

MausBerry makes many other similarly useful attachments for an RBPi to be used with vehicles. One of them is the 3A car supply that can sense the car ignition to shut down the RBPi safely when the car is turned off. The unit has two USB ports and communicates with the RBPi using two GPIO wires. The unit is to be wired to the vehicle’s battery and the 12V ignition source. Ground and power wires, both 18AWG and 18-inches long, are included.

If you are looking for an on-off switch for your RBPi, MausBerry has an illuminated LED type switch. Plug this unit into the RBPi power port and it accepts your existing micro-USB power cable. To turn the RBPi on, simply press the button. To switch off, press the button again briefly – the operating system senses the button and safely shuts itself down. After a safe shutdown, the switch will cut off all power to the RBPi. When illuminated, the LED gives off a bright blue light, and holding the button for five seconds performs a hard-reset for the RBPi.

Although aligned to the layout of the RBPi models A and B primarily, the illuminated LED shutdown switch will work directly with all models A, A+. B, B+, RBPi2 of the RBPi series. For the B+ models, the new power port location may make the switch stick a little out of the side.

Another shutdown circuit from MausBerry allows you to use any custom switch for operating the RBPi. The circuit plugs into RBPi power port and accepts the micro-USB power cable. This circuit is useful when installing the RBPi into a case, as the switch can be installed separately.

Graspinghand’s SweetBox, ScorPi and Heatsinks for the Raspberry Pi

Those who need a casing for their Raspberry Pi or RBPi are rather spoiled for choice. There are so many types of casings available, and that makes it so difficult to settle on one. Sometimes, you need a casing that does not take up too much space, but is able to protect your RBPi from sundry damage. If you want the smallest case on the market, try the SweetBox from Graspinghand.

Besides being the smallest on the market, SweetBox is injection molded with high-performance nylon, and is compatible with RBPi models B, Rev 1 & 2. It has several features such as it allows the insertion of a Micro-SD card into its adapter and the mounting of the RBPi camera. A rubber cap protects the GPIO pins when not in use, and is easily removable to allow connections.

Slots on the casing allow easy access to the DSI or Digital Serial Interface for attaching an LCD panel to the RBPi and the CSI or Camera Serial Interface for attaching a camera. Other mounting holes are available on the base, while the entire casing allows simple opening and closing without any screws or tools.

SweetBox is made from high-performance nylon, the EMS Grilamid type typically used for glass frames, electrical equipment and tools. This material makes the casing nearly unbreakable. The material is also lightweight, and the casing is only 35gms with dimensions of 95x65x25mm.

However, one of the most remarkable features of the SweetBox is it allows heatsinks to be mounted, so that your RBPi can operate within the casing, but without getting all heated up. Graspinghand offers three CNC machined heatsinks that you could use with or without SweetBox. The three heatsinks come with ready-to-mount thermal pads. With the heatsinks fitted, your RBPi will run at least 4°C cooler at full power.

Placing the heatsinks requires some dexterity. First, you must peel off the protective film off one side of a thermal pad. Then fix the heat sink very carefully in the center of the uncovered surface – this will stick the thermal pad to the heatsink. If there is excess thermal pad protruding out around the heatsink, use scissors to cut it off. Now peel off the remaining protecting film from the other side of the pad and place the heat sink and pad combination very carefully on top of the IC to be cooled. Use the same procedure for mounting all the three heatsinks, taking care to keep the same orientation of the fins for all the three.

Graspinghand also offers ScorPi, a flexible gooseneck arrangement for holding things such as the camera board on the RBPi. A brass fixture allows the ScorPi to be attached to SweetBox, while the brass fixture on the other end of ScorPi attaches to the camera board. You can flex the ScorPi to position the camera at any angle required, and it will remain in position to allow capturing images without any blurring due to shaking.

Cleaning the ScorPi is also very easy, as you can loosen all parts and clean them with a soft wipe using a mixture of white vinegar and salt.

Adding a Reset Switch to your Raspberry Pi

Normally, shutting down the tiny credit card sized single board computer, the RBPi or Raspberry Pi, involves pulling the plug. That means disconnecting the power cable from the RBPi board. However, that is a risky way of shutting down the SBC, since it may be in the process of transferring data to the SD card, and the power interruptions may cause corruption of the memory card. Another problem with frequent removal and re-insertion of the power cable is the damage this may cause the connector port. Program development on the RBPi may cause it to hang occasionally. Therefore, frequent restarting via power cycling with removal/re-insertion of power cable will be a problem. A simple fix is to add a simple reset function to the RBPi. You can do this in one of three ways. The first is to use a USB reset button. The second is to use a motherboard jumper on the GPIO bus. The third option is useful only for RBPi Models B Rev2 and B+, where you solder pins on the P6 header and connect to a momentary button. The third option is the most complicated, requiring soldering on the RBPi.

Although the first option of a USB reset button is the simplest, it also ties up one of the USB ports on the RBPi. With only one or two USB ports available, depending on the RBPi model, this may not be a very viable option for many. However, in case it works for you, get a USB reset button from any specialist online stores. Those who want all their GPIO pins available or those who are averse to soldering may use the USB reset button connected to the RBPi for scenarios when the device needs to be booted.
If you can salvage a jumper from an old motherboard or an HDD, connect it on two pins on the RBPi GPIO. All RBPi models have GPIO pins – models A & B have 26 pins each, while the models A+ & B+ each come with 40 pins. You need to place the jumper on the GPIO3, pins 5 and 6, counting from the left while holding the board the right way around.

However, you will need a script to detect the jumper. Make the script executable before running – use ‘sudo chmod 755’ for this. You will also need to run the script every time you boot up. For this, add the following line to /etc/crontab –

@reboot root /home/user/scripts/gpio_actions.sh

Whenever you place the jumper on the specified pins of the GPIO, RBPi will sense it and will shut itself down.
The third option involves using the P6 header, which is available only on the latest models of the RBPi – models B Rev 2 & B+. On the Model B Rev 2, you can locate P6 next to the HDMI port. On the model B+, you will find P6 next to the label marked as ‘Raspberry Pi 2014’. Normally, the RBPi does not come with pins soldered on to P6, so you will have to do the soldering.

Once you have soldered the pins, install the jumper with the switch to reset the RBPi. However, use this switch with caution, only when the RBPi is not responding.

Christmas tree Lights with the Raspberry Pi

Although Christmas is still a good four months away, you can always prepare for it in advance. The project uses a tiny single board computer known as the RBPi or Raspberry Pi, but you will need some time to collect other material for the project. You will also need time to iron out software bugs, especially if you are a newcomer to the RBPi and Python programming. Additionally, although the project is meant for Christmas, you can as well use it for decorating any other occasion.

The RBPi in the project drives eight AC outlets connected to sets of light. An RGB LED star adds a dynamic range to the light show with its 25-step programming mode. Another advantage the RBPi offers is its audio out can drive the lights in time with music. With a Wi-Fi connection, you can work on the software from a remote location.

The basic ingredients you require for this project are: an RBPi, any model; an SD card containing the Occidentalis operating system; a USB Wi-Fi adapter; and an eight-channel 5V SSR Module Board. You may also use electro-mechanical relays in place of SSRs, but they will produce noticeably audible clicking sounds when switching, while SSRs are noiseless. If you use the SainSmart SSR module board, each of the eight SSRs is rated up to 2A, which will adequately power a string of lights.

Apart from the basic ingredients, you will also require a bunch of extra items: some jumper wires, JST SM Plug and receptacles; four 8ft pieces of wire; eight extension cords, two power distribution blocks; a power strip; suitable enclosure; and speakers. You will also need a few power supplies: for driving the RBPi and the LEDs – 5V, 3A or greater; and for driving the SSR module – 5V, 1A or greater.

For the star, you can use 12mm or suitable RGB LED strands. With the Adafruit WS2801 chip, the RBPi only has to pulse the LED strand once rather than pulse it continuously to keep the LEDs lit up.

It is advisable to test the RBPi and associated components before connecting the wiring. Do this before setting up everything within the enclosure and you have the advantage of easy troubleshooting. Connect the RBPi to a monitor and keyboard, so you can set the system configuration to start software development.

As the default RBPi installation does not have the necessary libraries for driving the WS2801 LEDs, it is necessary to use the Occidentalis operating system from Adafruit. Follow the steps outlined here for configuring the RBPi to get it working as required. Use GPIO 0-7 on the RBPi for driving the SSR module.

As the RBPi drives the GPIO output high, the SSR connected to that pin switches on. This allows the LED associated with the SSR to light up. Write a simple test program to cycle through all the GPIO pins, setting them high for two seconds each.
After testing for proper functioning, connect the lights to respective SSRs through extension cords, using power distribution blocks to keep the wiring neat. Use cheap night-lights to test the animation program first, since this will reduce your eyestrain.

Make the OpenJFX DukePad with a Raspberry Pi

If you are looking for a fun project aimed at making your own tablet computer at home based on the Raspberry Pi (RBPi) Single Board Computer, the DukePad is for you. As software, you will use the Raspbian Linux operating system and your environment will be OSGi-based JavaFX.

You can think of DukePad not as a product but an open-source set of plans and software freely available for assembling your own tablet for which, you will be using off-the-shelf components. At present, the DukePad software environment is only demo-quality, as more importance has been given to making the software for demonstration purpose rather than for real functionality.

Although, for the purpose of this guide, you need to name your RBPi with the host name of “dukepad”, you could have any other name of your choice. In addition, instead of letting the RBPi run X11, which it is fully capable of running, JavaFX will be used and it will take over the entire screen. However, while downloading the software into your RBPi, you may choose either to start up with X, or you could elect to download to your desktop PC and then scp/sftp the files into your RBPi.

To get started, you must set up your RBPi as usual; follow these steps if you do not know how. Setup you RBPi such that you have allotted a generous amount of memory to VRAM, also called graphic memory or Video Core. An even split of 256MB each for VRAM and for system memory is also acceptable. If you only have 256MB in total, you may also get by with a 128MB/128MB split, but you may have to tweak the amount of VRAM that FX will eventually use.

If you have not already downloaded and installed the latest JavaSE Embedded release, you may do so now. You can use either the weekly builds or the official builds, whichever is available. For the RBPi, you will have to look for Linux ARMv6/7 VFP, HardFP ABI. Other versions are not likely to work with RBPi.

For installation, you must uncompress the file you have downloaded and put it in a directory of your choice. A good choice would be to install it in the directory /opt; this will require you to assume the superuser status (root). Once you install JavaSE Embedded, it will include JavaFX as well. To play media, RBPi will need some additional packages. You will also need additional packages for configuring the auto-booting and the splash screen. In case you are not interested in creating a table device and you are simply planning to play with the DukePad software, you may safely skip the splash screen and auto boot instructions.

For the boot-loading screen, you need the “fbi” package and for being able to play media files, you have to download and install the “mpg321” package.

For building the body of DukePad, the CAD files are provided here. They contain the template for laser cutting the acrylics for the body, which is made from material of two thicknesses – 4.5mm and 3mm.

Slow Scan Television Camera with the Raspberry Pi

Ham radio operators use their radio equipment and computers to send and receive pictures over wireless. Earlier, most images sent through voice transceivers were low resolution black and white. However, with improvement in technology, nearly all images are of higher resolution and in color. The technique for sending and receiving pictures over radio is called Slow Scan TV. All that is required is a VHF scanner, a computer and a camera. This project replaces the computer with a Raspberry Pi or RBPi, the tiny credit card sized single board computer.

The RBPi with the PiCam forms a wireless camera for transmitting images over very long distances such as tens of kilometers. Finally, the images will be transmitted by ham or amateur radio equipment that uses slow scan television or SSTV over the 2m band (144.5MHz). Here, the RBPi is capable of generating the HF FM signals, and no additional electronics is needed for transmissions at low power. However, with a low pass filter and a single or a two-transistor amplifier, a more powerful transmission can be achieved.

Greater distance coverage is the main advantage of using SSTV over Wi-Fi for transmitting pictures. Using the RBPi as a wireless security camera, you can transmit pictures to distances far beyond the range normally covered by Wi-Fi networks. One of the main requirements is you will need a ham-radio license for using this application.

For transmitting a picture, you will first need to capture it using the PiCam. The program that RBPi uses to do this is named as rapistill. Once the image is captured, it has to be converted to a SSTV sound file. Although there is a program called PySSTV, the conversion rate is very slow and it may take several minutes for converting a single image. However, a simple program implemented in C – PiFm – works very well. The program allows setting the audio sample rate from the command line and converts the picture to an SSTV sound file in just under four seconds.

Although it is customary to transmit the sound file over a radio transmitter, it is much more fun to allow the RBPi to generate its own high frequency signal. Following the Wiki of the Imperial College Robotics, you can turn your RBPi into an FM transmitter. Their code used DMA, but the bandwidth used is very high and the timing for SSTV is not accurate.

In PiFm, bandwidth reduction is very simple. Usually, for FM, the bandwidth is set with the modulation index. This index is the volume of the audio signal modulating the HF carrier. Timing is very essential for SSTV, as a small change in the sampling rate results in slanted images. The timing correction, in the form of a constant, can be set from the command line.

Another requirement when using ham radio for transmitting SSTV signals is that you are required to transmit your call sign in every transmission. This information has to be added to the picture and the RBPi uses imagick from the python image library to accomplish this. Whenever something interesting happens in front of the camera, the RBPi captures the image and sends it over wireless.

Embedded Pi and Raspberry Pi

To extend the functionality of your tiny single board computer, the credit card sized Raspberry Pi or RBPi you can consider using the Embedded Pi or E-Pi. With E-Pi, your RBPi will be able to interface to Arduino shields even without making use of any Arduino device. For example, the E-Pi RBPi combination can drive a TinkerKit Sensor Shield using a set of actuators/sensors such as LED actuator, button sensor, tilt sensor and a relay actuator.

You may be an intermediate RBPi user or a novice just starting out with the SBC. Using the Embedded Pi will allow you to work with the combination of E-Pi, RBPi and sensor shields for controlling a set of actuators and sensors. In addition, you will learn to write Python code for controlling and detecting the state of the actuators and sensors.

The RBPi can be of either model A or B. For installing the Embedded Pi demo software and the necessary software updates for the RBPi, you will require network connectivity. Since more than two USB devices will be connected, a USB2 hub is recommended. Most likely, you will be connecting the keyboard and mouse through the USB hub along with the WiPi. To link the monitor, use either the HDMI interface or the RCA phono connector, if your monitor accepts composite video.

The Embedded Pi offers an interface platform for connecting the RBPi, Arduino and the embedded 32-bit ARM processor. The Instructions and the E-Pi form a bridge to link the RBPi and the Arduino shields. Physically, this interface takes the form of a cable linking the GPIO connectors on the RBPi and the E-Pi board. On the software side, the linking is achieved by using Rpi.GPIO and WiringPi modules.

The TinkerKit Sensor Shield allows various sensors and actuators to be connected. You can connect them directly to an Arduino or to the E-Pi, without any breadboard in between. There are 12 standard 3-pin connectors on the Sensor Shield. Of them, 10-15 are Analog inputs, 00-05 are the analog outputs. You can drive them with PWM capable outputs or you can configure them as digital inputs.

The TinkerKit uses LED, Relay actuator, button and tilt sensor that are plugged into the 00-05 pins on the Sensor Shield. Both sensors and actuators can be simultaneously used.

To use the E-Pi, connect all the peripherals such as the USB2 hub, mouse, keyboard, WiPi, monitor, etc. into the RBPi and start using the demonstration software. In the next step, connect the RBPi, E-Pi and the Sensor Shield together. Use a flat-flex cable to link the RBPi and the E-Pi together, making sure that the red edge on the flat cable confirms to the proper alignment of the interfaces. On the E-Pi, it is necessary to set jumper JP1, so that its power bus voltage is at 3.3V. Additionally, use only JP3 and not the JP4, such that the E-Pi is configured for the RBPi.

Now connect the LED module with the 3-pin twisted wire cable to the Sensor Shield to its orange sockets – the analog output. Use the epi-leds-rgv1p0p0.py program to run and light up the LED. For further details, see the element-14 site.