Tag Archives: Raspberry Pi Projects

PicoBorg Helps To Build a DoodleBorg

Imagine a small tank driven by a Raspberry Pi or RBPi. This is the DoodleBorg, a two-horsepower goliath and is the most powerful robot controlled by the RBPi. Powered by starter motors originally from a motorcycle, the DoodleBorg uses six PicoBorg motor boards made by PiBorg.

The DoodleBorg uses a tiny, credit card sized single board computer, the RBPi, as its brain. It has six reverse motor controller boards or PicoBorgs controlling its six wheels. Each of the boards is capable of handling 10A on average. Therefore, with two batteries in series, the average power output is 6x10x24=1440Watts or roughly 2HP. Peak power outputs are higher, about 2.1KW or three horsepower. Usually, the RBPi is prominently visible in the robot it is powering. However, in this case, you will hardly recognize it in the massive size of the project. Commands to the DoodleBorg are sent via a PS3 controller.

The PicoBorg reverse motor controller cards were specifically chosen for this project. These are advanced dual motor control boards for use with an RBPi. PicoBorgs can control big or small motors, with forward or reverse speed control. Each board, with its own emergency power off, is sized to mount on your RBPi for PID control and feedback via the GPIO pins. If you need to control more motors, simply plug in more boards and control up to 200 motors.

The dual motor controllers can handle input voltages between 6 and 25VDC and control up to 5A per channel, that is, 10A when combined. The emergency power off switch works in both bidirectional and speed control modes. PicoBorg boards are capable of handling two DC motors or one stepper motor with 4- or 6-wire configuration. For communication, you can use the I2C or SCK/SDA pins on the GPIO together with 3V3/GND pins. Adding the PicKit2 brings additional functionality.

PicoBorg reverse motor controllers are protected against overheat, short circuits on all outputs and under-voltage lockout. Connections are very straightforward. Six screw-terminals on the board allow connecting two motors and a battery. There are two 6-pin terminals, one of which is for connecting to control signals from the GPIO of the RBPi. The other 6-pin terminal can be used for daisy chaining another PicoBorg board.

Another connector on the board allows you to easily add a normally closed switch to act as an emergency switch. In case of any fault, simple open the switch and the motor will be cut off. The software on the PIC micro-controller on board will recognize the emergency switch operation and prevent further operation of the motors until enabled by a software command.

Another feature of the PicoBorg is its ability to run DC motors with taco feedback. The software accepts taco input signals that indicate either the number of rotations or the distance traveled by the wheels. Acceptable feedback signals are – quadrature signal (A or B) from an encoder, taco signal from a computer fan motor, index mark feedback such as one per revolution pulse. The motor connection remains the same as that for a standard DC motor setup.

An Exquisite Raspberry Pi Enclosure

There are countless types of enclosures available for the inexpensive credit card sized Single Board Computer – the Raspberry Pi, popularly known as the RBPi. All have their unique capabilities and advantages. Some are made of wood, some of paper while most others are made of plastic.

The molded enclosure from Hammond Electronics is specifically designed to house the RBPi model B. The exquisitely molded container is shaped like a book and is available in black, grey and translucent blue. The stylishly rounded design has apertures for all the IO interfaces and accessories supported by the RBPi. The enclosure is actually two parts made to fit one on top of the other, holding the RBPi between them. No screw-fixings are involved, and a specific sequence is required to get the bottom, the RBPi and the top fitted together perfectly.

On opening the 1593HAMPI enclosure assembly, you will notice the bottom half has some stationary clips on its inside. Holding the bottom half in your palm, slide the RBPi board in at an angle against these stationary clips. Once in place, push down firmly on the RCA jack of the RBPi, until you hear the board click into position. Now the RBPI is securely held in the bottom part of the enclosure.

Take the top part of the enclosure and touch its rounded ends to the corresponding rounded ends of the bottom part, on an angle. Still holding the bottom part firmly, push down on the outer edge of the top part, until you hear a snapping sound. On turning the assembly around, you will see a clip from the top part jutting through an opening on the bottom part. This holds both the halves together. In case you would like to separate the two parts of the enclosure, simply pull back the clip from the bottom part and the two halves will come apart.

Hammond Electronics offers self-adhesive rubber feet, which you can fit in the circles on the bottom part of the enclosure. They will prevent the encased RBPi from sliding off. One of the most popular accessories of the RBPi is the camera module. You have a choice of two methods for mounting the camera module. Screw the camera to the inside of the top part, which has a hole provided for the lens. However, if the camera must remain outside the enclosure, you can fit it through a slot in the top. The camera will now be standing at right angles to the assembly.

Access to the GPIO header is provided through a cutout on the mating line between the top and the bottom halves. The sides also have apertures of the right size and shape for all the ports. Therefore, you can easily access the HDMI interface, the micro-USB power-in connector, the RCA ports for audio and video, the SD card, the RJ45 LAN and the two USB ports. The base has two captive slots so that you can attach the enclosure to a surface. For stand-alone applications, the rubber feet are helpful.

Talk To Your Raspberry Pi through an FTDI Breakout Board

You do not really need a monitor and a keyboard for logging into the tiny credit card sized single board computer, the famous Raspberry Pi or RBPi; there are several ways to do that. One of the very simple ways is to listen in on two of the serial communication monitoring pins on the GPIO header of the RBPi.

Manufacturers of most computers have now given up on including serial ports on their products in favor of the more Universal Serial Bus or USB. However, connecting the serial pins on the RBPi to the USB port on the computer is not so straightforward. A special translator is required, one that understands and converts between the serial and USB protocols.

FTDI makes a special cable with an FT232 chip in between that can help to connect the serial port pins on the RBPi to the USB port of the computer and provide meaningful communication between the two. Modern Devices have gone one step further. Instead of having to deal with connectors or soldering on the RBPi side, they have designed a breakout board with the FT232 on it. The FT232 TTL signals are available on a header, which is suitable for plugging into the GPIO header on the RBPi; this is the USB BUB 1,

On one side of the BUB is an FTDI header, a six-pin version very common with most of the Arduino-compatible boards. The breakout area of the BUB is very handy as it allows you to reconfigure the signals to any of the pins on the second header. When you have to connect different devices such as the Parallax Propeller, this rerouting is very useful, as pinouts or the RBPi and the Parallax Propeller are different. The rerouting process also allows you to select the proper logic level (5V or 3.3V) for your device with a single jumper. You can suitably modify the breakout area of the BUB to enable it to connect appropriately to two different style devices without resoldering the connections.

When connecting to the RBPi, make sure you are connecting the Transmit of the RBPi to the Receive pin of the BUB, and the Transmit of the BUB to the Receive of the RBPi. Unless you follow this method of connections, BUB and RBPi will be unable to communicate with each other. For connecting with the RBPi, another very important thing to take care on the BUB is the logic level jumper. Make sure and double-check that it is connected to the 3.3V rail and NOT to the 5V.

Now that you have everything under control, boot up your RBPi, plug in the BUB and connect the other end of the serial cable to the USB port on your computer. All FTDI chips have a unique ID and this will show up as the device name. The device will be available under the /dev directory if you are using a Mac or Linux computer. On Linux, the BUB will show up as /dev/ttyUSBx, where x will depend on the number of USB devices already plugged in.

Use F-RAM to Replace SD Card in Raspberry Pi

For those who use their Raspberry Pi very frequently, there is always the risk of wearing out the SD card. This tiny, inexpensive, credit card sized, single board computer – the Raspberry Pi – or RBPi, boots and runs a Linux Operating System held on an SD card. Therefore, if your RBPi has to boot often, you run a database on the SBC or use virtual swap space that resides on your SD card, the life of the SD card reduces very fast.

In fact, any time you use the SD card, for example, for data logging, serial or network capture or while reading sensors, you are saving data to the SD card at fairly frequent intervals. Similarly, when you run a customized server on an RBPi such as an email or a web server, the system writes temporary or configuration files constantly to the SD card. That puts the SD card at risk.

The problem with SD cards or any other standard Flash-based memories and EEPROMs is that they require a block erase before writing any data. These devices have a limit to how many times these erase cycles may be used.

However, you can supplement the Flash-based SD card of your RBPi with an F-RAM board, called the Ironman. The first advantage is that F-RAM does not require any erase cycle to write new data, which makes it very fast. Secondly, F-RAMs can be written limitless times, so it will last a very long time. Thirdly, F-RAMs do not need external batteries to retain data. This video compares the three types of memories.

All over the world, nearly two million RBPis are running from SD cards. The RBPis write data frequently to the Linux root partition stored on their individual SD cards. On average, after 10,000 writes, an RBPi may fail to boot, losing all the data and configuration. Using an F-RAM card that adds 1-4 MB memory allows your SD card to be used as read-only. All the small databases, log-files, temporary files, configuration files, caches and anything that changes during normal use, goes on to the F-RAM card. That prevents use of precious kernel or application memory from the built-in RAM or tmpfs of the RBPi. The best part is that all the temporary files are available even after a reboot.

F-RAM or Ferroelectric RAM is very well suited for embedded systems. Being non-volatile, it does not require power or battery backup to retaining data up to 10 years. There is no restriction on erase/write cycles, making it as fast as SRAM. Unlike EEPROMs or Flash, there is no limit to the number of writes before device failure. The only disadvantages of F-RAM are cost and density/size.

F-RAMs can be read and written to up to 100 trillion times. To put that figure in understandable terms, you could write to the same address on the F-RAM chip 1,000 times per second continuously every second over 317 years – without the device failing. If the same process were to be tried on a Flash memory, the device would fail in just 100 seconds.

Forget Keys Use Raspberry Pi Face Recognition

Now it is no longer necessary to use a key or a password to protect your treasures from prying eyes. Just teach your treasure box to recognize your face and it will open to no one except only when you are near it. The trick is to use the tiny, credit card sized, single board computer, the Raspberry Pi (RBPi) and its camera. When you are near, the camera and the RBPi recognize your face and the box unlocks itself.

The RBPi is the best-suited platform for this project, as it is very small and you can fit it almost anywhere. Additionally, all algorithms for this project are from the OpenCV computer vision library, which the RBPi is able to run. The advantage in building this project is that being an intermediate-level design, the project will teach you how to compile and install software on the RBPi.

For this project, you will need an RBPi model A or B and it should be running the Raspbian or the Occidentalis OS. You will also need Internet access when you are building the project. Additionally, you will require the RBPi camera module.

For the treasure box, you can use any type as long as it opens from the top and is big enough to hold the RBPi, and of course, your treasure. Among the other things you will require are a battery holder to hold 4x AAA batteries – this will be used to power the servo. For making the latch, you may use a wooden dowel and a few planks – these will be used to make a frame for the RBPi. A momentary push button may also be used – you can mount that on the side of the box.

As a start, you will have to make a hole on the top cover of the box for fitting the RBPi camera. You will also need a few more holes on the side of the box for the power cables and the push button. Mount a dowel in front of the box – the latch will catch this when the servo turns. You will need a small frame to support the RBPi and the latch servo. Clamp the servo to the frame using some wood scraps and machine screws. Fit the RBPi under the top cover of the box, such that the latch servo can swing down and catch the dowel to lock the box.

For the software, you will require the latest version of OpenCV. However, you will need to compile this from source, as the binary versions available are too old to be of use for face recognition. Compiling OpenCV on the RBPi will take about 5 hours.

For training the system to recognize you, you need to press the button to let the camera take a picture of your face and save the picture in the training directory. RBPi requires at least five pictures from different angles, with different lighting etc., for making a positive identification. The images form a database of the permitted faces that are allowed to open the treasure box.

Raspberry Pi Pursues Ping-Pong Balls

Ping-pong balls are light and apt to bounce around a lot. Players have a hard time running after them, and when many are playing, finding a number of balls on the floor is a common sight. This was the case at the office of the 37signals at Chicago as well, until their system administrator, Will Jessop, who runs the North West Ruby User Group in Manchester, decided that enough is enough. He designed a solution for the problem with a Raspberry Pi running a robot to pick up the balls and collect them in a basket.

Raspberry Pi or RBPi is a low-cost, credit card sized single board computer with Linux as its operating system. Will designed the original version of the robot using the Custard Pi breakout. However, he changed over to MotorPiTX motor controller developed by Jason Barnett, as this was a much neater board. Will then sourced some of the parts necessary for the robot and built the others.

For example, he designed and 3D printed the motor mounts, the caterpillar track mounts, the ball basket and even a new base. In the end, he added a PiCamera mounted with a fish-eye lens. This made the whole contraption a neat little camera robot, reminding one of Wall-E.

Since the robot had to move around and pick up ping-pong balls, it needed its own power source to allow it to roam free. Will looked at the power requirements and tested its power usage while it was running all its motors. The RBPi robot had its own lifter arm fitted to the chassis and while this was controlled independently, the robot itself streamed video over wireless. Will finally opted for a lithium battery rated at 5AH, 7.4V.

For the software, Will decided to use Go. This, he found, was a great language for the RBPi, as he could use Go to create small, efficient statistically compiled binaries. Additionally, he could also fit them easily within the resource limits of the RBPi. Will runs the Go binaries alongside his gamepad library on his laptop, and these are available as a Ruby gem in C. To allow the RBPi to shutdown cleanly via the MotorPiTX, Will had also to write a power controller script.

Now that the robot was capable of roaming free on its battery, Will controlled it with an Xbox controller, with its camera feed streaming over Wi-Fi. By watching the video stream on a laptop, it was easy to let the robot pick up ping pong balls; see it in action below.

There were some suggestions that Will considered. One of them was to allow the robot to recognize the ping-pong balls on its own and pick them up. Initially Will did think of using OpenCV for accomplishing this, but then he found that people are more excited at driving a robot around and had more fun. Another suggestion that Will is considering for the future is using a vacuum pick up, since ping-pong balls are very light, and easily slip away from the robot’s fingers.

The compute module for Raspberry Pi

If you thought that the tiny single board computer, the Raspberry Pi (RBPi), could get no smaller, well, you really need to think again. There is now a Compute Module, which is much smaller. It contains the processor of the RBPi and 4GB of memory. The size of this board is roughly equal to a DDR2 laptop memory stick. However, the Compute Module is not exactly a miniaturization of the RBPi.

The advantage in fitting the system onto a small connector-less standard circuit board allows users to attach their own choice of interfaces. They need not be tied down to the built-in ports and devices that are available on the conventional RBPi board. The Compute Module is used along with a Starter IO board, which contains the rest of the devices.

The combination of the Compute Module and the Starter IO board is aimed at business and industrial users. The idea is to free the core technology of the RBPi to become an integral part of several new and exciting products and devices. The software of the RBPi is now full-featured and stable. A heroic community of volunteers is always hard at work constantly improving and improvising on the software. The manufacturers feel that this is the right time to free the hardware of the RBPi and make it more open.

Looking at the different types of users putting the RBPi to good use, it is really amazing to witness the huge number of products the community is developing around the tiny credit card sized SBC. The creativeness, ingenuity and inventiveness of the users are simply stunning. People are using the RBPi as not only a standalone module, but also embedding the tiny SBC into commercial products and systems. The dual combination of the Compute Module and the Starter IO board will make it even more versatile for these users.

The Compute Module contains the guts of the RBPi – the BCM2835 controller along with 512MBs of RAM. It also has a 4GB eMMC Flash memory, as a replacement of the SD card on the RBPi. Although all this is integrated onto a DDR2 SODIMM standard connector of the size 67.6x30mm and looks very much like a laptop memory card, it is not pin compatible to the memory card. Therefore, do not make the mistake of plugging in the Compute Module into a standard memory slot; it will only end in disaster.

The flash memory on the module is connected directly to the processor, but the remaining interfaces of the processor are freely available on the pins of the connector. That means you now have the full flexibility of the BCM2835 SoC. Compared to the original RBPi, many more number of GPIOs and interfaces available to the user on the Compute Module. That makes interfacing the Compute Module into a customized system should now be relatively simpler.

Although the Compute Module is aimed primarily at users who will be designing their own PCB, others not willing to go that far may use the Starter IO board. Snap the Compute Module into its connector on the Starter IO board and you are good to go.

A smartphone built from Raspberry Pi: the PiPhone

You may not be looking for a new cell phone right now, but someone has just managed to transform his Raspberry Pi (RBPi) into a working cell phone. David Hunt has used only off-the-shelf components and put them together for the project. Although it is not as slick as the regular cell phones available in the market, at about $160, David has created a one-off project that certainly has no economics of scale working for it. The best part is all components of the phone can be taken apart at any time, used for some other projects and then reassembled. Can you do that with your regular cell phone?

David has called his cell phone the PiPhone, in honor of the base RBPi that powers it. The other major parts used for making the PiPhone work are a Sim900 GSM/GPRS module and an Adafruit touchscreen interface. The GSM/ GPRS module allows the cell phone to make and receive calls, while the touchscreen provides the user interface. A 2500 mAh LiPo battery powers the entire contraption. The GSM module connects to the RBPi through a UART, while the battery fits in between the TFT screen and the RBPi, allowing the PiPhone to work standalone, without wall warts or dangling wires.

The touchscreen interface has a numeric keypad displayed on the screen. After dialing the required number, you need to touch the phone icon at the bottom to make the call or hang up.

The Sim900 GSM/GPRS is an intelligent module, which oversees the entire communication process of the PiPhone, including sending the standard AT commands to the RBPi for making calls, hanging up and sending text messages or data. Towards the bottom of the PCB is the connector where you can insert your SIM card. Therefore, you can use a regular prepaid SIM card available in the local phone store.

Just below the GSM module, there is an on/off switch and an off-the-shelf standard DC-DC converter. This converts the 3.7V supplied by the battery to the 5V required by the rest of the electronics. Heat dissipation was the only problem that David faced because of sandwiching the RBPi, the TFT, battery and the GPS module together. During development, as all the components were placed apart, they remained cool to the touch even after extended periods of use. However, sandwiching prevents air from circulating within, resulting in the CPU getting a bit warm after switching the unit on for a few minutes.

The GPS card is insulated from the RBPi with a thick foam-core board, allowing no accidental electrical connections between them. David used a couple of cable-ties to hold the different parts together.

Of course, walking into a local phone shop and picking up a normal smartphone would be simpler and cheaper, but that would not be as much fun as making your own. Moreover, as said earlier, you can put the parts to other uses as well, which you cannot do with a standard phone.

David has put up all his code and instructions on the GitHub. There are links available to instructions on installing the TFT.

Using the Texy’s Mini TFT Screen for Your Raspberry Pi

The single board computer, the Raspberry Pi (RBPi) is a wonderful device, but it needs a screen for you to see what it is doing. The Mini TFT screen from Texy’s is just made for the RBPi and the kit comes in a beautiful Perspex box too, which makes it very smart and practical. The Perspex box has a neat slot in the corner for the RBPi-Camera, although you may have to add blu-tack to prevent the camera from popping out. The screen and display are pre-built and ready to plug into the RBPi GPIO socket.

The display is backlit TFT, measuring 2.8-inches. The resolution is 320×240, which is a quarter VGA or QVGA, with 64 thousand colors. The current consumption is a mere 99mA. A major portion of this current is on account the backlight, which consumes 85mA. That means, if you switch the backlight off, by setting P1 on Pin18 to low, this screen uses only 19mA, which is great for battery-powered applications.

If you compare this with the 9-inch DVD player screen, which is 640×220 in resolution, and runs from the RBPi Analog output, the Texy’s screen is much sharper and more usable. Note that the standard TV resolution is 720×480 or 720×576. The digital connection makes the RBPi desktop very clear, perfectly formed and very easy to read on the small TFT screen.

The Texy’s screen provides a useful terminal display, fully displaying the entire RBPi desktop. Although it may not run full speed frame-rates, the display shows video perfectly. The compact fonts get a lot of text displayed on the terminal despite it being only 2.8-inches.

The addition of the resistive touch screen is the magical bonus as this opens up a great multitude of project possibilities, where a mouse, full keyboard and display setup would be rather impractical. You can bring the touch panel alive by combining some python code and Tkinter to get a very effective touch-based control system for your RBPi.

Texy’s has added flexibility to the screen in the form of the PI header pass-through available on the display board. You can use a ribbon cable to link the display to the RBPi GPIO and use the GPIO connections on the underside of the display. Alternately, you can connect the display directly to the RBPi GPIO and extend the GPIO with the cable.

Since the display uses SPI interface pins on the GPIO, including CE0, CE1, GPI00, GPI01 and GPI06. The GPIO pass-through allows you to connect your own ribbon cable to add further hardware, which can use the rest of the GPIO pins. A convenient GPIO pin out key is printed on the board for reference.

The easiest option for most is to use pre-configured images for driving the Texy’s display. Others, who are more confident, can modify the existing OS to use the screen; it is suggested to make a backup before setting out. Follow instructions here.

The display case, while providing support to the display unit, also extends out providing protection to the SD-Card while allowing full access to all sockets and connections of the RBPi.

Use your Raspberry Pi as a Hi-Fi Player

If you use your Raspberry Pi (RBPi) in combination with a USB DAC and RuneAudio, it will become a Hi-Fi music player providing surprising sound quality. RuneAudio is a free and open source software that you can use with the single board computer for running the custom-built Linux distribution. The RuneAudio and RBPi combination replaces the PC or the laptop that you normally use as a digital source for music.

Like other open source projects, RuneAudio also came to be born due to personal needs. The developers were not very happy about having to use the laptop as a digital source, its absolute sound quality and ease of use. They started the RuneAudio project and encouraged people to download it, try it free and contribute to the development.

Project RuneAudio has two distinctive goals: One, to provide exceptional sound quality and two, make it easy to use for everyone. The developers are using the RBPi and other supported platforms for deriving the best results. For this, they are using Arch Linux as the base for their RuneOS and optimizing it as best as possible for audio reproduction.

For making project RuneAudio easy to use for everyone, the developers have built a handy web interface – RuneUI, that lets users control the playback and system settings, without any need for touching the Linux command line. With a cross-platform web-interface, the responsive RuneUI adapts to the screen size automatically. That makes it accessible from all types of devices, whether you are using a PC, notebook, tablet or a smartphone. All you need to do for installing is to write an image file to your SD card.

To install, first you will have to download the latest RuneAudio image for your RBPi from the official webpage. Next, extract the contents of the zipped file with a utility for manipulating compressed files such as Unzip on Linux, Zipeg on Mac or 7-Zip on Windows. That will leave you with a raw disk image file (an extension of .img).

The raw disk image file has to be written onto an SD card. You may follow these guides on elinux.org: Linux howto, Mac howto and Windows howto. Before you plug-in the SD card into your device, make sure the card’s write-protection is turned off. After the card has finished writing, unmount it safely and plug it into your RBPi.

Plug-in a USB DAC into the RBPi USB port (you can simply plug in the analog jack if you do not have a USB DAC). You can also plug-in your USB storage or your USB hard drive. If you are using a hub for the USB devices, it is strongly suggested that you use an external power supply for it. Now plug-in your Ethernet connector, plug-in the power supply unit of the RBPi power it on.

That’s all. RuneAudio boots up your RBPi for the first time, and acquires an IP address. Open a web browser on your Android mobile and run RuneAudio from http://runeaudio.local. You should be in RuneUI now. If you want to see this being done, you can view the videos that can be found online.