All posts by Lorna Lynch

Raspberry Turk: a chess-playing robot

Post Syndicated from Lorna Lynch original https://www.raspberrypi.org/blog/raspberry-turk-chess-playing-robot/

Computers and chess have been a potent combination ever since the appearance of the first chess-playing computers in the 1970s. You might even be able to play a game of chess on the device you are using to read this blog post! For digital makers, though, adding a Raspberry Pi into the mix can be the first step to building something a little more exciting. Allow us to introduce you to Joey Meyer‘s chess-playing robot, the Raspberry Turk.

The Raspberry Turk chess-playing robot

Image credit: Joey Meyer

Being both an experienced software engineer with an interest in machine learning, and a skilled chess player, it’s not surprising that Joey was interested in tinkering with chess programs. What is really stunning, though, is the scale and complexity of the build he came up with. Fascinated by a famous historical hoax, Joey used his skills in programming and robotics to build an open-source Raspberry Pi-powered recreation of the celebrated Mechanical Turk automaton.

You can see the Raspberry Turk in action on Joey’s YouTube channel:

Chess Playing Robot Powered by Raspberry Pi – Raspberry Turk

The Raspberry Turk is a robot that can play chess-it’s entirely open source, based on Raspberry Pi, and inspired by the 18th century chess playing machine, the Mechanical Turk. Website: http://www.raspberryturk.com Source Code: https://github.com/joeymeyer/raspberryturk

A historical hoax

Joey explains that he first encountered the Mechanical Turk through a book by Tom Standage. A famous example of mechanical trickery, the original Turk was advertised as a chess-playing automaton, capable of defeating human opponents and solving complex puzzles.

Image of the Mechanical Turk Automaton

A modern reconstruction of the Mechanical Turk 
Image from Wikimedia Commons

Its inner workings a secret, the Turk toured Europe for the best part of a century, confounding everyone who encountered it. Unfortunately, it turned out not to be a fabulous example of early robotic engineering after all. Instead, it was just an elaborate illusion. The awesome chess moves were not being worked out by the clockwork brain of the automaton, but rather by a human chess master who was cunningly concealed inside the casing.

Building a modern Turk

A modern version of the Mechanical Turk was constructed in the 1980s. However, the build cost $120,000. At that price, it would have been impossible for most makers to create their own version. Impossible, that is, until now: Joey uses a Raspberry Pi 3 to drive the Raspberry Turk, while a Raspberry Pi Camera Module handles computer vision.

Image of chess board and Raspberry Turk robot

The Raspberry Turk in the middle of a game 
Image credit: Joey Meyer

Joey’s Raspberry Turk is built into a neat wooden table. All of the electronics are housed in a box on one side. The chessboard is painted directly onto the table’s surface. In order for the robot to play, a Camera Module located in a 3D-printed housing above the table takes an image of the chessboard. The image is then analysed to determine which pieces are in which positions at that point. By tracking changes in the positions of the pieces, the Raspberry Turk can determine which moves have been made, and which piece should move next. To train the system, Joey had to build a large dataset to validate a computer vision model. This involved painstakingly moving pieces by hand and collecting multiple images of each possible position.

Look, no hands!

A key feature of the Mechanical Turk was that the automaton appeared to move the chess pieces entirely by itself. Of course, its movements were actually being controlled by a person hidden inside the machine. The Raspberry Turk, by contrast, does move the chess pieces itself. To achieve this, Joey used a robotic arm attached to the table. The arm is made primarily out of Actobotics components. Joey explains:

The motion is controlled by the rotation of two servos which are attached to gears at the base of each link of the arm. At the end of the arm is another servo which moves a beam up and down. At the bottom of the beam is an electromagnet that can be dynamically activated to lift the chess pieces.

Joey individually fitted the chess pieces with tiny sections of metal dowel so that the magnet on the arm could pick them up.

Programming the Raspberry Turk

The Raspberry Turk is controlled by a daemon process that runs a perception/action sequence, and the status updates automatically as the pieces are moved. The code is written almost entirely in Python. It is all available on Joey’s GitHub repo for the project, together with his notebooks on the project.

Image of Raspberry Turk chessboard with Python script alongside

Image credit: Joey Meyer

The AI backend that gives the robot its chess-playing ability is currently Stockfish, a strong open-source chess engine. Joey says he would like to build his own engine when he has time. For the moment, though, he’s confident that this AI will prove a worthy opponent.

The project website goes into much more detail than we are able to give here. We’d definitely recommend checking it out. If you have been experimenting with any robotics or computer vision projects like this, please do let us know in the comments!

The post Raspberry Turk: a chess-playing robot appeared first on Raspberry Pi.

Book-wrangling at Wordery with a Raspberry Pi

Post Syndicated from Lorna Lynch original https://www.raspberrypi.org/blog/book-wrangling-at-wordery-with-a-raspberry-pi/

While we mostly deal in pretty technologically advanced stuff here at Pi Towers, we are huge fans of the printed word too. It’s great to hear, then, that the Raspberry Pi has been helping booksellers to keep bibliophiles like us supplied with all the reading matter they could wish for. Jeff Podolski, IT and network technician at Wordery, recently got in touch to tell us just how his company has been using the Pi in their warehouse.

At work in the Wordery warehouse.

Wordery is an online bookshop which offers over 10 million books, including a wide range of Raspberry Pi titles. Jeff tells us that the company has been working on improving their productivity and customer service over the past few years, with a recent drive towards greater automation in our sorting and distribution operation. “We needed to get PCs on the desks used for packing and mailing, so we could track packed items and provide interactive feedback for our staff,” says Jeff. A PC with a screen and barcode scanner on a desk takes up considerable space and power, so the IT team came up with the idea of using Raspberry Pis instead.

After some initial tests using a Pi and a standard PC screen, Jeff and his team streamlined the setup using the official 7” screen and case, along with a USB barcode scanner. This allowed them to have a unit on the desk which took up one fifth of the space a PC would have needed, while using dramatically less power.

The Pi and touchscreen assembly

Jeff’s next challenge was to keep the Raspberry Pi safe from being knocked and bumped by all the items being packed, lest an unsecured Pi become a Pi smashed on the warehouse floor. “We found an excellent tablet mounting arm designed for wheelchairs: we simply clamped that to the table and attached a back-board to the tablet bracket,” Jeff explains. “We were then able to attach the Pi using the rear mounting screw holes”. After a little tidying of cables, Jeff and the team had created a small, low-power, easily movable interactive terminal which can be used by all the staff in the warehouse.

A mobile terminal, thanks to a hacked tablet holder

The project was such a success that over 40 of these terminals have now been installed, and the benefits are already clear to see. “This year we have been able to process record volumes through our warehouse, up 11% on the previous year,” notes Jeff. “The Pis were key to us handling this additional volume, enabling us to increase packing productivity by 30%. The beauty of a project like this is we’re now advocating using these Raspberry Pi terminals elsewhere in the building, further reducing our power consumption and equipment costs”.

We’re really happy to see the success of a project like this: it shows how the Raspberry Pi can make automation much cheaper and more accessible, as well as much more flexible. Jeff’s team did a great job of hacking the tablet arm to make it fit another purpose, too. It also really speaks volumes of the helpfulness and engagement of the Raspberry Pi community. The team at ModMyPi helped with sourcing large amounts of kit and cables, as well as the cases themselves. The Raspberry Pi Thin Client Project worked on making a simple, configurable thin client for Jeff’s team to use. Finally, Martin Kirst, the lead programmer on the open-source project TN525j, helped Jeff and his team to make the terminal emulator screens easily readable and to add new functionality to the units.

Using the Pi enabled Wordery to work more efficiently

Thank you for sharing your work with us, Jeff: it shows what great work you can do with the Raspberry Pi in an industrial setting.

In celebration of the success of this Pi-powered automation project, the nice folks at Wordery are offering a discount on Raspberry Pi titles on Wordery.com until the end of January: use the code “HAPPYREADING” and receive 10% off your second book. Wordery offer free delivery on all orders too.

 

 

The post Book-wrangling at Wordery with a Raspberry Pi appeared first on Raspberry Pi.

Maker Faire New York 2016

Post Syndicated from Lorna Lynch original https://www.raspberrypi.org/blog/maker-faire-new-york-2016/

It’s been five years since we made our first appearance at Maker Faire New York. Back in 2011, we were still showing demonstrations of the Raspberry Pi, prior to its release the following spring. This year, we had prominent billing alongside the robots and rockets!

Robots, rockets, and Raspberry Pi!

Robots, rockets, and Raspberry Pi!

Maker Faire New York ran from 1-2 October, and was as great an experience as ever. We brought a bunch of Raspberry Pis showcasing our brand-new Pixel desktop environment. Greg Annandale’s gorgeous photo of the Brooklyn Bridge was a stunning backdrop to the Sense HAT activities we had organised.

Lorna Lynch on Twitter

Doing some pixel art with @Raspberry_Pi at #MFNY16 #MakerFaire #MakerFaireNYC

Joining the stalwart US Pi team of Matt and Courtney were Carrie Anne, Sam, and Lorna, as well as Raspberry Pi Certified Educator Kerry Bruce, who came all the way from Albuquerque, New Mexico. A community college instructor with a passion for STEM education, Kerry was a real trouper and a valuable addition to the team.

When we arrived at Corona Park to get set up, we were concerned about the inclement weather. Given that the Faire is outside, the prospect of running our Pi activities in an open-sided marquee was somewhat daunting.

The team tried hard not to let the rain dampen their ardour for STEM...

The team tried hard not to let the rain dampen their ardour for science…

We braved the elements to take a photo in front of the famous Unisphere, to explore the park a bit, and to geek out over the history of the place. I can’t have been the only one who was excited to see the towers on the New York State Pavilion in real life, after multiple viewings of Men in Black.

Carrie Anne Philbin on Twitter

Team @Raspberry_Pi for #MakerFaire NY 2016! Come visit us and tell us about your makes!

Fortunately, the weather improved for the Faire; we didn’t have to remove electrical equipment from puddles! Resident design genius Sam decorated our tables with Pi-themed cartoons, including one answering this common question: how do you connect a Raspberry Pi to a computer?

Raspberry Pi on Twitter

Here’s what happens when @samalderhyde shows up at your event! #MakerFaire #wmfny16 @makerfaire

We loved pointing to Sam’s cheery Pi character when explaining that the tiny board was the computer. It was great to see people’s surprise at the Pi’s power.

Matt and Carrie Anne both gave speeches: Carrie Anne’s presentation, “Digital Making: Encouraging Creativity in the Classroom and Integrating STEAM Project-Based Learning”, was part of the Make: Education series, while Matt explained how to get started with the Raspberry Pi on the Show and Tell stage. 

Raspberry Pi on Twitter

Go see @MattRichardson at @makerfaire’s Show & Tell Stage at 11:30 (in 10 min). He’s giving a intro to Raspberry Pi.

We heard great reports from the attendees, and we saw a lot of visitors to the stand who had been enthused by what they heard. 

As in previous years, there were many excellent Raspberry Pi-based projects, as well as familiar faces from the Pi community. There was an excellent display of Pi-controlled Lego Mindstorms robots. We also met the guys from Pi Supply showcasing their new JustBoom equipment, bringing affordable high-quality audio to Raspberry Pi users. Eager experimenters of all ages came to try out our Sense HAT activities, and to tell us about the Pi projects they had made at home. One man was even wearing a Pi Zero as a necklace! Other visitors included Steven Welch, who updated us on the work his team are doing with Pis at CERN (we’ve blogged about this), and Henry Feldman of the Beth Israel Deaconess Medical Center, who is using the Raspberry Pi and Camera Module for edge detection in laparoscopic surgery.

We also found a number of excellent projects with more artistic applications. Joe Herman had uncovered a cache of old 8mm and 16mm family movies, and was digitising them and projecting them via a modified vintage movie projector equipped with a Raspberry Pi and Camera Module. You can find out more on Joe’s GitHub.

Joe Herman's Pi-powered projector. Image from Maker Faire.

Joe Herman’s Pi-powered projector. Image from Maker Faire.

Joe’s project wasn’t the only great Pi art project. Following on from Sam Blanchard’s amazing SeeMore, one of the main showpieces of last year’s Faire, we were incredibly excited to see another Pi-powered art piece in pride of place this year. The first thing to greet attendees visiting the Faire in the New York Hall of Science was the Pi-powered Sisyphus kinetic art table. We think it’s so amazing, we’ll be devoting a whole post to it, so keep an eye out!

For several of us, it was our first visit to the Faire and to New York, which really added to our excitement. One of the greatest things was meeting so many happy Pi fans, and introducing newcomers to the fun you can have with one. We lost count of the excellent animations we saw kids (and adults) create on the Sense HAT, and the joyful exclamations as another person got their first piece of Python code working; this is one of the most rewarding parts of our work. We can’t wait for the next Maker Faire! If you couldn’t attend, be sure to check out our tour video here:

Live from World Maker Faire New York 2016

Let Carrie Anne and Matt take you on a tour of World Maker Faire 2016. Join them as they explore the faire, introduce the Raspberry Pi stand, PIXEL and Sam’s artwork, and chat to the teams from Ready Set STEM and Pi Supply.

 

The post Maker Faire New York 2016 appeared first on Raspberry Pi.

Call me Ishmael

Post Syndicated from Lorna Lynch original https://www.raspberrypi.org/blog/call-me-ishmael/

“I write this sitting in the kitchen sink”. “It was the best of times, it was the worst of times”. “When Gregor Samsa woke one morning from troubled dreams, he found himself transformed right there in his bed into some sort of monstrous insect”. “It was the day my grandmother exploded”. The opening line of a novel can catch our attention powerfully, and can stay with us long after the book itself is finished. A memorable first line is endlessly quotable, and lends itself to parody (“It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains”). Sometimes, a really cracking first line can even inspire a group of talented people to create a unique and beautiful art object, with a certain tiny computer at its heart. 

IMG_5975

Stephanie Kent demonstrates the Call Me Ishmael Phone at ALA 2016

If you read the roundup of our trip to ALA 2016, you will already have caught a glimpse of this unusual Pi-powered project: the Call Me Ishmael Phone. The idea originated back in 2014 when founders Logan Smalley and Stephanie Kent were discussing their favourite opening lines of books: they were both struck by Herman Melville’s laconic phrase in Moby Dick, and began wondering, “What if Ishmael had a phone number? What if you actually could call him?” Their Call Me Ishmael project began with a phone number (people outside the US can Skype Ishmael instead), an answering machine, and an invitation to readers to tell Ishmael a story about a book they love, and how it has shaped their life. The most interesting, funny, and poignant stories are transcribed by Stephanie on a manual typewriter and shared on social media. Here’s a playlist of some of the team’s favourites: 

Having created Ishmael’s virtual world, Stephanie and Logan collaborated with artist and maker Ayodamola Okunseinde to build the physical Call Me Ishmael Phone. Ayo took a commercially available retro-style telephone and turned it into an interactive book-recommendation device. For the prototype, he used a Raspberry Pi 2 Model B, but the production model of the phone uses the latest Pi 3. He explains, “we have a USB stick drive connected to the Pi that holds audio files, configuration, and identification data for each unit. We also have a small USB-powered speaker that amplifies the audio output from the Pi”. The Pis are controlled by a Python script written by programmer Andy Cavatorta.

CMI-Phone-in-Shop_Steph_Andy_Ayo-min-min

Stephanie, Andy, and Ayo in the workshop. 

The phone can be installed in a library, bookshop, or another public space. The phone is loaded with a number of book reviews, some mapped to individual buttons on the phone, and some which can be selected at random. When a person presses the dial buttons on the phone, the GPIO pins detect the input. This subsequently triggers an audio file to play. If, during play, another button is pressed, the Pi switches audio output to the associated button. Hanging up the phone causes the termination of the playing audio file. The system consists of several units in different locations that have audio and data files pushed to them daily from a control server. The system also has an app that allows users to push and pull content from individual Pis as well as triggering a particular phone to ring.

CMI-Phone-Avid-center-floor-stand-flush-right-min-min

The finished unit installed in a bookshop.

The Call Me Ishmael Phone is a thoughtful project which uses the Raspberry Pi in a very unusual way: it’s not often that programming and literature intersect like this. We’re delighted to see it, and we can’t wait to see what ways the makers might come up with to use the Raspberry Pi in future. And if you have a book which has changed your life, why not call Ishmael and share your story?

The post Call me Ishmael appeared first on Raspberry Pi.

Photocatalysis with a Raspberry Pi

Post Syndicated from Lorna Lynch original https://www.raspberrypi.org/blog/photocatalysis-raspberry-pi/

Access to clean, safe drinking water is a global problem: as water.org notes, 663 million people lack access to water that’s safe to drink. That’s twice the population of the United States, or one person in every ten. Additionally, a recent review of rural water system sustainability in eight countries in Africa, South Asia, and Central America found an average water project failure rate of 20-40 percent. It’s no surprise that the search for a solution to this crisis preoccupies scientists the world over, but what you may not have expected is that, in a lab in Cardiff University, researchers are using Raspberry Pi to help in their efforts to bring safe drinking water to some of the poorest areas of the world.

A tap set into a wall, with sign above reading "SAFE DRINKING WATER"

There are three processes involved in water purification, two of which are reasonably straightforward: filtration can remove particulate matter, while heating water to near 100°C kills bacteria. However, the third process — the removal of highly toxic hydrocarbons, typically from fertiliser and pesticide runoff — is very difficult and, currently, very expensive. The Cardiff group is working on a project to find a cheap, effective method of removing these hydrocarbons from water by means of photocatalysis. Essentially, this means they are finding a way to produce clean water using little more than sunlight, which is really pretty mind-blowing.

Here’s a picture of their experimental setup; you can see the Raspberry Pi in its case on the right-hand side.

A laboratory photocatalysis setup at Cardiff University: on a bench are a beaker of water dosed with methylene blue "pollutant" under UV LED illumination, semi-transparent tubing connecting the contents of the beaker to a flow cell, a Raspberry Pi, and other components.

Raspberry Pi in the lab

A cheap, readily available chemical, titanium dioxide, is spin-coated onto a glass wafer which sits in the bottom of the beaker with a UV LED above it. This wafer coating acts as a semiconductor; when UV photons from the LED strike it, its electrons become mobile, creating locations with positive charge and others with negative charge. As a result, both oxidation reactions and reduction reactions are set off. These reactions break down the hydrocarbons, leaving you with pure water, carbon dioxide, and hydrogen. The solution is pumped through a flow cell (you can see this in the centre of the picture), where an LED light source is shone through the stream and the amount of light passing through is registered by a photodiode. The photodiode turns this output into a voltage, which can be read by the Raspberry Pi with the help of an ADC.

The team are currently using two organic dyes, methyl orange and methylene blue, to simulate pollutants for the purposes of the experiment: it is possible to see the reaction take place with the naked eye, as the colour of the dye becomes progressively less saturated. A colourless solution means the “pollutants” have been entirely broken down. You can see both dyes in situ here:

Laboratory photocatalysis setups at Cardiff University: on a bench are a large LCD display with a desktop showing the Raspberry Pi logo, beakers of water dosed with methyl orange and methylene blue "pollutants", semi-transparent tubing connecting the beakers' contents to flow cells, a Raspberry Pi, and other components.

Experimental setup with methyl orange and methylene blue

In previous versions of the setup, it was necessary to use some very large, expensive pieces of equipment to drive the experiment and assess the rate and efficacy of the reaction (two power sources and a voltmeter, each of which cost several hundred pounds); the Raspberry Pi performs the same function for a fraction of the price, enabling multiple experiments to be run in the lab, and offering the possibility of building a neat, cost-effective unit for use in the real world in the future.

Several of the team have very personal reasons for being involved in the project: Eman Alghamdi is from Saudi Arabia, a country which, despite its wealth, struggles to supply water to its people. Her colleague Jess Mabin was inspired by spending time in Africa working with an anti-poverty charity. They hope to produce a device which will be both cheap to manufacture and rugged enough to be used in rural areas throughout the world.

Jess, a research scientist, smiles as she pipettes methylene blue into a beaker that is part of her group's photocatalysis setup.

Jess demonstrates the experiment: methylene blue going in!

As well as thoroughly testing the reaction rate and the lifespan of the wafer coating, the team are hoping to streamline their equipment by building their own version of a HAT to incorporate the ADC, the photodiode, and other components. Ultimately the Pi and its peripherals could form a small, rugged, cost-effective, essentially self-sustaining device which could be used all over the world to help produce clean, safe drinking water. We are really pleased to see the Raspberry Pi being used in this way, and we wish Jess, Eman, and their colleagues every success!

The post Photocatalysis with a Raspberry Pi appeared first on Raspberry Pi.