Tag Archives: RBPi

Raspberry Pi Digitizes and reads books

You can make your own book reader that will read books aloud after it has digitized them. The ingredients you will need are the tiny single board computer Raspberry Pi or RBPi, a BrickPi and some Lego motors and blocks. The finished book reader will flip through one page of a book at a time, take its picture and turn the picture into a text document, before moving onto the next page.

The book reader works by preparing a page to turn with the help of a rotating Lego motor. Gravity does its bit by providing just enough friction on the page of the book to allow it to inch forward. Finally, a Lego arm beam swings over and forces the page to turn over.

Once on a new page, the camera of the RBPi snaps an image of the page and saves it in the form of a JPEG file format. The RBPi then uses an open source Optical Character Recognition (OCR) software program to transform the page into text format and saves it. The RBPi then uses free text-to-speech software to read the page aloud over the speakers connected. The BrickPi operates the Lego modules that turn to the next page of the book.

For this project, you will need an RBPi (Model B), an RBPi camera, the BrickPi, the BrickPi Power Pack, Raspbian Wheezy on an SD Card, a Wi-Fi dongle and a Lego Mindstorms kit. The Lego kit could be either an EV3 or a NXT system.

As you have to use the camera to capture the image of the page, you will need good lighting. Arranging for the RBPi and the BrickPi to be placed above the book allows the camera to be positioned squarely above the book. Arrange lights over the sides at angles to fall and illuminate the page from two sides.

You may have to calibrate the page turning mechanism until it runs perfectly. This is done by adjusting the values of the variables in the arm_test.py. The motor connects to the Port A of the BrickPi and for calibration, the values of speed_arm, speed_roller, t1 and t2 may have to be changed and tested until the page turns flawlessly.

The camera is placed in position and held there with two Lego Technic beams. Once the camera is fitted in place, you may have to change its focus, as the camera focus is typically at infinity. Although the camera may give acceptable results without adjusting, focusing on the page gives improved results for OCR recognition. To change the focus read here and here for guidance.

Once the camera is adjusted, take a few images and check for clarity over the whole page. If the image does not look proper, adjust the focus and angle again. If the image looks good, it is time to test whether the OCR can convert it. Setup the Tesseract OCR engine, and use it to convert an image with “tesseract image.jpg o”. The output will be o.txt and this should now be readable with the text-to-speech engine eSpeak. This software allows choice of the reader’s gender and the accent. Once you connect a pair of headphones or speakers to the RBPi, you should be ready to go. For more details on this project, refer here.

High Fidelity Audio from the Raspberry Pi

Although the Raspberry Pi or RBPi has many exceptional qualities such as a small form factor, low price, low power consumption and credit card size, the single board computer is not endowed with a high fidelity onboard sound output. Therefore, to get high-fidelity sound, you must add a sound card to the RBPi. For all RBPi users who love music, HiFiBerry produces sound cards designed for optimal sound quality output.

HiFiBerry has two types of boards depending on whether you are looking for an analog or a digital board. If you have an analog amplifier, use the DAC board. However, if you connect to your amplifier via an optics link, use the Digi board. The standard RBPi kernel in the Raspbian distribution supports both the boards and they use Open Source software. HiFiBerry provides all drivers for both boards as open source. These boards utilize the P5 connector on the RBPi.

The HiFiBerry DAC is available as a Standard version with RCA connectors or as a 3.5mm phone jack version for headphones. Both are fully soldered boards; however, if you prefer to do some soldering, there is a DIY kit as well. For providing the best sound quality, these boards use a dedicated 192KHz/24-bit DAC from Burr-Brown. No cables are required, as the board connects directly to the RBPi, which also supplies it with power. Optimal audio performance is assured with on-board ultra-low-noise voltage regulators. Mechanical spacing between the audio board and the RBPi requires nylon spacers.

To connect the DAC board, you will need to solder an 8-pin header on to the RBPi, on its onboard sound connector P5. Now simply plug the DAC board in and start using it. The on-board ultra-low-noise voltage regulator will filter out all the noise from the RBPi power supply and you do not require any additional power supply or cable.

If your amplifier connects with an optical signal, use the HiFiBerry Digi board, which offers a high-quality S/PDIF output. The board connects to the P1 and P5 headers of the RBPi and supports up to 192KHz/24-bit resolution via optical (Toslink) and electrical outputs. The audio data streams produced are bit-perfect outputs, unmodified in any way.

The Digi board is also available in two versions, one with an isolation transformer and the other without. Although the hardware on the board is capable of DTS/Dolby Digital output, suitable software is required to make its full use. At present, HiFiBerry is not providing this software, but they will offer support to developers who want to implement this feature. The isolation transformer will provide complete galvanic isolation between the DAC on its output and the amplifier. However, most consumer-grade SPDIF connections do not require any output transformers.

For the future, HiFiBerry is planning a high-quality highly efficient stereo class D power amplifier to be connected directly on to the RBPi. Only external loudspeakers are necessary to get full 2x25W output power when driving 4-Ohm speakers with 44.1KHz and 48KHz sampling rates. This board will require an external power supply of 12-18V, but will power the RBPi as well, so ultimately only one power supply will suffice.

Raspberry Pi Lights up an RGB LED Matrix Panel

Colorful LED screens are a joy to watch. Bright LEDs making up a 16×32 display are not only easy-to-use, but also low cost – you may have seen such displays in the Times Square. Controlling such a display is simple if you use the low-cost, versatile, credit card sized single board computer, the Raspberry Pi or RBPi. Although the wiring is simple, the display is quite demanding of power when displaying.

The items you need for this project are a 16×32 RGB LED Matrix Panel, Female-to-Female jumper wires, Male-to-Male jumper wires, a 2.1mm to Screw Jack Adapter, an RBPi board and a 5V 2A power supply. Use the Female-to-Female jumper wires to connect the display to the GPIO connector pins of the RBPi. Although this connection is display specific, following a generic pattern is helpful:

GND on display to GND on the RBPi (blue or black)
OE on display to GPIO 2 on the RBPi (brown)
CLK on display to GPIO 3 on the RBPi (orange)
LAT on display to GPIO 4 on the RBPi (yellow)
A on display to GPIO 7 on the RBPi (yellow or white)
B on display to GPIO 8 on the RBPi (yellow or white)
C on display to GPIO 9 on the RBPi (yellow or white)
R1 on display to GPIO 17 on the RBPi (red)
G1 on display to GPIO 18 on the RBPi (green)
B1 on display to GPIO 22 on the RBPi (blue)
R2 on display to GPIO 23 on the RBPi (red)
G2 on display to GPIO 24 on the RBPi (green)
B2 on display to GPIO 25 on the RBPi (blue)

When connecting the wires, ensure that both the display and the RBPi are powered off, as the display is able to pull some power from the GPIO pins. Once all the data pins are connected as above, it is time for the power supply to be connected. The panel has a power supply header and a cable that has two red wires for the positive supply and two black wires for the negative. While connecting these wires to the screw jack adapter, make sure of maintaining proper polarity. Additionally, double check that the power supply you are using is rated for 5V, as any other higher voltage is likely to fry the display. The sequence for powering up must be the display first and the RBPi last.

To display an image or a message, you must convert it to a ppm or portable pixel format. Image editors can do this for you and you can very well use the free open source application GIMP. Once the image is in the required format and placed in the specific directory, the display program picks it up and it appears on the display. Shift registers on the back of the display module help with the shifting or scrolling of the image on the display. Of course, the RBPi has also to do a lot of work in bit-banging the pixels onto the screen.

You may use the code as it is in C, or you may prefer to use Python. Currently, the program displays only eight colors; for reference, see here.

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.

Meet the Prettier Raspberry Pi Model B+

Just as soon as you thought you knew as much as there is to know about the most popular single board computer, the tiny versatile Raspberry Pi or the RBPi, acquaint yourself to a prettier cousin. There is an update to the familiar RBPi Model B and it is called the RBPi Model B+. Raspberry Pi Foundation, the manufacturers of the RBPi, have incorporated several improvements requested by users in the new model.

Although the RBPi Model B+ retains the same controller, has the same amount of RAM and runs on the same software as the Model B, there have been several cosmetic changes. The most notable improvements in RBPi Model B+ are:

— GPIO has 40 pins; the first 26 pins retain their pinout as in Model B.
— Four USB 2.0 ports with better hot plugging and overcurrent behavior; Model B has 2 ports
— A micro SD socket (push-push type); Model B has SD card socket of friction-fit type
— Power consumption 0.5-1.0W; Model B power consumption 0.55-1.65 W
— Better audio with separate low-noise power supply
— Improved form factor. Compared to Model B, the USB connectors align with the board edge and composite video moved to the 3.5 mm jack. Model B+ has four mounting holes.

Even with all the above improvements, the price of the RBPi Model B+ has been retained at $35. So what happens to the Model B now? According to the Raspberry Pi Foundation, Model B will remain in production as long as demand for it continues.

In its lifetime of two years, the RBPi SBC has gone to many places such as floating in space, deep under the sea and controlled complex machinery. Considering that the initial goal of the project was to educate children in Computer Science, RBPi has definitely marked a place of its own. RBPi has revolutionized the landscape of education for children and adults alike. People have learnt more about Computing and Electronics with RBPi.

Since the RBPi B+ model has the same architecture as the earlier Model B, the Foundation assures compatibility with the existing projects and software developed so far. According to the feedback received from the community, RBPi Model B+ is a more refined product.

Measuring 85x56x17mm in size, the RBPi B+ is slightly smaller than the form factor you are accustomed to with the Model B. Additionally, an improved layout backs up the size reduction. The organization of the board is neater and there are several improvements.

For example, there are now four USB ports as opposed to the two earlier. This is because the RBPi Model B+ uses the new LAN9514 chip. The Model B had its ports dotted all around the perimeter of the board. In contrast, the Model B+ has concentrated its ports only on two sides. The RBPi Model B+ with its four USB 2.0 ports supporting higher currents can now attach external portable USB2 hard drives. For those who had to counter the USB reboot issue on the Model B, can now rejoice since RBPi Model B+ has more stable USB hot swapping of USB devices.

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.

Carberry for your car

Why do you need a Carberry for your car? Carberry forms a link between the car electronics and the tiny, inexpensive, versatile single board computer, the Raspberry Pi (RBPi). In sort, Carberry is a shield for the RBPi microcomputer and allows an enthusiast to develop end-user applications such as internet, carputing, burglar alarms, blackboxes, tracking, fleet management, data logging, vehicle diagnostics, media centers and much more.

Carberry can sit directly atop your RBPi, as it has the same form factor, and connects to the RBPi with the help of a 26-pin GPIO header, which is located on the Carberry PCB. You connect it to your car via a 22-pin Microfit connector, also on the PCB. Although the Carberry needs a 12VDC supply, it generates the 5V, 1A onboard for the RBPi and uses the ground connection from the vehicle. For managing the power flow to the RBPi, Carberry controls the 5V supply with a mosfet.

This also helps in performing a controlled shutdown, as it controls the power to the RBPi in the case of a logical shutdown. The entire combination follows automotive standards of low power consumption and normally consumes less than 3mA. Carberry communicates with the RBPi through the UART and utilizes pins 15 & 16 of the RBPi header.

Carberry provides ignition signal output at +12V, 2.5A controlling it through a mosfet. It reserves two CAN Bus lines and two GMLAN lines for parallel or series connection to the vehicular bus. On board, two channels are reserved for controlling a resistive steering wheel and this has the capability of being bypassed with a single key.

The general purpose UART operates at 5V or 3V3, as required by the user, while the two general purpose, open collector outputs can sink 500mA. There are two general purpose user-programmable LEDs and two general purpose inputs – the user can select the referencing to the ground or to 5V.

Carberry operates on a Microchip PIC32X microcontroller and provides a button and two-color LEDs for resetting and learning can bus profiles. If required, the user can send PWM signals to the RBPi for managing LIRC.

Cranberry can emulate infrared remote controls for media centers via the controls of the steering wheel, with the infrared sensor being suitable for 38 KHz. The board has an infrared LED onboard for the IR codes emission.

Other features of the Carberry are the user can develop applications under Linux that are ready for Apple MFI compatible. The on-board RTCC is capable of handling date and time along with battery wakeup and RBPi wakeup at programmed date/time.

An onboard external EEPROM comes with a unique identifier and users can utilize it for any license related to the card. Onboard accelerometer and magnetometer provide anti-theft features, blackboxing and positioning. The accelerometers and magnetometers can wake up the RBPi with their events, while the microusb device connector offers a stand-alone functionality for the shield in the future.

The user can upgrade the Carberry firmware via the RBPi and they can interface the Carberry to the RBPi via ASCII strings, similar to controlling modems with AT commands.