Tag Archives: RBPi

Raspberry Pi for the Talking Chatter Smartphone

You may have seen and even played with the Chatter Telephone, as the classic Fisher Price toy has been around since 1962. Although the design of the toy evolved over the years, in 2010, the Disney/Pixar film Toy Story 3 managed to depict the Chatter phone in its original classic form. Coinciding with the release of the movie, Fisher Price updated their model as the Talking Chatter Telephone. The new model carried some voice clips from the movie and had an all-plastic body, reminiscent of the boxy shape of the 1960’s original model.

Grant has used the famous Raspberry Pi or RBPi single board computer to turn the Talking Chatter Telephone into a Talking Chatter Smartphone. The modified phone gets its enhanced brains from an RBPi Model B+. All the logic comes from a Python script that runs on startup and access to the network is via a tiny Wi-Fi dongle. To retain the original factory look of the phone, Grant has avoided adding unnecessary buttons or screen and retained the original components and controls for interaction.

Internally, Grant has added a sensor to the hook cradle, but retained the original rotary dial that controls playback of the movie clips. For the eye movements, he has added a servo, while retaining the built-in speaker for providing audio output. He has retained the three micro switches the dial uses as a digital encoding system to sense the five dial positions. The RBPi replaces the battery box and the original PCB.

The phone pulls data from various online services via JSON format APIs. As of now, it connects to Forecast.io for receiving weather information and to Rotten Tomatoes for information on movies. However, one can easily extend this to other APIs as well. For example, the phone could be made to swap APIs for weather forecast with APIs providing current exchange rates, stocks or a Quote for the Day.

The phone also has a push notification system that uses a Twitter account. Grant uses it to pull new alerts from that account and to push them onto the account using IFTTT. He uses pre-defined alerts or recipes that he drives from his iPhone. For example, the IFTTT alerts the phone when Grant leaves work, there is rain forecast for tomorrow, the garden temperature is getting close to 10°C and when the International Space Station is about to pass overhead.

Grant has given the Chatter Smartphone a Wall-E startup sound for its boot up. That serves a dual purpose as the RBPi makes the sound when it has finished booting and lets Grant know that it is ready for an SSH connection. According to Grant, this should be made a standard feature for every RBPi. If you feel the volume of sound is low, it is easy to extend the RBPi’s audio jack to the back panel of the phone. This has the added potential of turning the Fisher Price phone into a high-end hi-fi system.

Using a Bluetooth add-on for the RBPi it is also possible to extend the audio to powered Bluetooth speakers outside the phone – making it wireless.

Using Raspberry Pi for Dog Training

Dog lovers and those who keep dogs as pets know that every dog has its own personality and like us humans, they too, often succumb to temptations. Some canines just cannot resist chewing those delicious new sandals, while others must investigate the leftover food scraps on the dining table. And, as working people cannot monitor their pet’s behavior the whole day, Dave Young took up a project involving lasers and the single board computer, the Raspberry Pi or RBPi, to help their pet keep its nose out of food scraps.

Dave Young’s Laser Dog Watcher consists of a laser tripwire, which silently alerts the RBPi as soon as the dog trips the invisible beam. The RBPi then takes a snap of the situation and plays an audio clip to dissuade the dog from its intentions. The project borrows the laser tripwire from an earlier design of a silent doorbell that Dave had installed at his home.

The laser tripwire system is of a simple reflection type. Both the laser source and its detector are in the same enclosure on one side of the room. On the other side is a small mirror placed to reflect the laser light back to the photo-resistive detector. Anything interrupting the beam also trips the detector, which sends out a signal. As ambient light plays an important role when detecting interruptions of the laser beam, Dave added a threshold level adjustment. In addition, to make it easier for the laser to hit the detector, he added a Fresnel lens in front of it.

The tripwire system is wirelessly linked to the RBPi. For this, Dave used an XBee module, series 1 by Digi, who has a starter kit for users. The integrated AD converter on the module transmits the detected light level digitally, which serves two purposes. Setting the threshold level for detection becomes simpler and there is no noise involved as during an analog transmission.

The XBee interface transmits the digital value to the receiver as a PWM signal. The XBee receiver filters this PWM signal to produce a DC voltage level. You need a second AD converter to translate the DC voltage level to a digital value. Although this method of converting the signal twice is somewhat cumbersome, the XBee module makes it very easy to create the wireless link.

XBee provides their XCTU setup utility, which helps in setting up the XBee radio transmitter and receiver. The starter kit also includes an XBee USB Adapter board that connects to the RBPi, which may need FTDI VCP or Virtual Com Port drivers.

When there is a break in the laser beam, the XBee radio alerts the RBPi, which then triggers its GPIO to play an audio file as well as takes a photo with the Pi camera. The audio file changes so that the dog does not get accustomed to the same reprimand each time it tries to break the rules. According to Dave, the camera is not essential, but it serves to detect false alarms and to record the surprised look on the dog’s face.

An Action Camera for the Raspberry Pi

If you are the type that goes biking into the mountains and all the while recording your adventures on camera while on the trip, you need a camera that is biking-centric, robust and suitable for long-distance trips. Of course, several suitable cameras already exist such as the GoPro, Fly6 and the Sony Action CAM, but they are expensive not accessible to all. On the other hand, an action camera for the Raspberry Pi (RBPi) is not only cheap, it is also open-source and suitable for the purpose.

The design of the RBPi action camera is based on off-the-shelf components. It is very easy to build this project if you have access to a soldering iron and a 3D printer. Of all the models of the RBPi series, model A+ consumes the lowest amount of power, which is an important factor to consider since you will be running it on batteries.

If you are trying out the camera for the first time with an RBPi, using an open-source case is advised.

For an RBPi camera meant to be used for biking, three design goals must be met: the project must have a long battery life, be capable of wireless communication and its enclosure must be simple and made of durable material.

Apart from using the RBPi model A+, meeting the first requirement means using a large battery, especially if your rides are going to be multi-hour long. For the second requirement, it is necessary to have both Wi-Fi and Bluetooth, to make it easy to communicate with the camera. The last goal contributes to the first two, therefore, it must be given due consideration. Since the action camera is meant for outdoor use, making every port available outside the case would have reduced the structural integrity and its dust/water resistance.

To package everything into a small enclosure and ensure their working, you may need to work on the Wi-Fi dongle first, as that sticks out more than anything else does. For this, you may need to remove the USB jack and then remove the adapter from its plastic case. You can solder the wires directly to the board. The Bluetooth module may be placed on top of the RBPi and a ribbon cable used to connect it to the headers underneath. Next, make a support for the battery and its charger/booster so they fit snugly under the RBPi. You may need a few spacers to ensure the protruding headers do not puncture the battery.

Place the camera as close to the side of the RBPi and design the case to around all the components along with the RBPi. Usually, the case will be in two parts, with the camera module mounted on the top. Keep the camera module within the case and mount it in place with screws.

Use two buttons, with which the RBPi will start and stop the recording sessions. This may require you to use special scripts (you can use those by Alex Eames) for the RBPi to listen to a button press to start the camera and another button press to stop recording. Communication with the RBPi is done primarily through ssh.

Zumo-George the Raspberry Pi Behavior Driven Robot

It is difficult to forget the roving Roomba, but it is time we have a new rover – Zumo-George. It is necessary to look differently at the process of control from a series of behaviors, while defining the tenets of development driven by behavior. Development undertaken via BDD or behavior-driven development is a superior method of emphasizing collaboration and communication between testers, developers and business stakeholders. Features and scenarios define behavior, as the Gherkin syntax specifically elicits –

Given: Zumo-George is more than 10cm from wall

Situation: Power is applied to the motors

Result: Zumo-George should drive forward

Developers write the BDD scenarios before writing other code, and this determines what code is written. This process reduces wastage. In addition, the written code drives the development, which, in most cases, passes the first time. As Zumo-George executes the scenarios, developers can see exactly what steps it passes, what it fails to pass and whether it encounters any situation that they have overlooked.

Intermixed with electronics, use of BBD to program robots such as Zumo-George can be an ideal abstraction for exploring robotic control based on behavior – BDR, or Behavior-Driven Robotics. Such programming can even include testing or internal diagnostics on Zumo-George. For example,

Given: Lights are all off

Situation: When light is switched

Result: light should turn

Or, on a lighter side,

Given: Batteries are fully charged

Situation: Shoot lasers

Result: Target should fry

As Zumo-George has no laser.

Zumo-George has to execute a series of internal diagnostic tests each time it boots up. If it fails any test, then it will simply refuse to rove and will flash a red light. This will preclude the problem of the robot running out of control.

Naming the robot Zumo-George, the developers prefer referring to the robot as a “he” rather than “it.” They expect Zumo-George to mimic certain human behavior. For example, do not bump into a wall while walking/driving.

Polulu’s Zumo and the Explorer HAT Pro from Pimroni form the basis of the rover (including its name). Therefore, Zumo comes in several variants. For example, for Arduino, there is the all singing Zumo 32U4, with accelerometers, LCD, buzzers, sensors and more. Then there is the bare-bones Zumo Chassis Kit and this is most suitable for Raspberry Pi (RBPi), as users can add their own electronics.

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.

Raspberry Pi Alternatives

f you have been using single board computers such as the RBPi or Raspberry Pi and Arduino, you would have certainly found them great as do-it-yourself boards for hacking and for setting up your own design. However, using these boards can bring up a natural curiosity to look at other alternate hacker boards similar in size and functionality to the RBPi.

Listed here are some boards comparable in prices to that of the RBPi, and with community support. They are good for transitioning to low-cost commercial volume manufacturing, while being compatible and easy-to-use.

According to the director of ecosystem and marketing program of Freescale, Steve Nelson, one should look for five important features while selecting an SBC: Simplicity in installation and during operation; Staying power or popularity with users; Stability against regular rebooting or updating; Security of design; and Standards of compatibility irrespective of the manufacturer.

Udoo: Although more expensive compared to RBPi, Udoo offers a unique experience of Linux and Arduino SBC. It runs on an ARM i .MX6 processor from Freescale, has 1GB DDR3 RAM and offers 76 fully available GPIO. Apart from this, it has a Wi-Fi module, one Ethernet RJ45, 3D GPUs for graphics, HDMI and LVDS. Other features include a pair of mini USB and mini OTG, one analog audio and microphone socket and a camera connection. Udoo works on 12V from an external power supply and the board has an external battery connector.

Wandboard: With 0.5GB to 2GB DDR3 RAM, Wandboard is more expensive compared to RBPi and is a unique Arduino and Linux SBC. It sports an HDMI interface, a camera interface, a micro-SD slot, an expansion header, serial port, Bluetooth, Wi-Fi, 802.11n, SATA and Gigabit LAN. This board is used in small autonomous Sumo-robots and a cluster with a custom PCI-Express carrier board adapter.

WaRP: Targeted at wearable designs, this not-yet-released Freescale supported board runs on an i.MX 6SoloLite processor based on the Cortex-A9 architecture and Android 4.3 OS. With an E-ink display and wireless charging option, this tiny board has MCU for sensor aggregation, orientation and pedometric functions. Communication interfaces include a Bluetooth wireless module, 802.11 b/g/n Wi-Fi and sports multi-chip packaging with LP-DDR2 and eMMC memories.

RIoTboard: This board also runs on the Freescale I.MX 6Solo processor based on the ARM Cortex A9 architecture. It offers very high performance video processing with HD- and SD-level video decoders and SD-level encoders. The 2D and 3D graphics accelerator are based on OpenGL ES 2.0 with shader. The Freescale Kinetics MCU is an integrated power management chip with 1GByte of 32-bit wide DDR3 running at 800MHz. The board uses 4GB of EMMC Flash and offers support for GNU/Linux and Android along with enhanced expansion capabilities.

Freedom: With ARM Cortex Core and a full tool suite, the Freedom board has up to 256KB of Flash, USB, an LCD Controller, a capacitive touch sensor, a magnetometer, a 3-axis accelerometer, a visible light sensor and a 4-digit 4×8 segment LCD.

Teensy 3.1: This is an extremely tiny board of 1.4×0.7 inches, weighing 3 grams. The ARM Cortex M4 MCU runs at 72 MHz with 256K Flash memory and 64K RAM. It is cheaper than the RBPi.