BB the robot

By Rob Zwetsloot. Posted

Computer vision in robots, especially Raspberry Pi ones, is a great way to improve their automation and functionality. It makes your robot more than a glorified, customisable, DIY RC car. Instead of adding computer vision to a robot kit he already had, Sean Glendinning created a robot to experiment and test with it. This ended up in the creation of BB.

“BB is a small, wall-powered robot designed to test out offline computer vision, detecting people and faces,” says Sean.

“It searches a room for people, then tries to recognise any faces if it detects a person. If it comes across a person in its memory, it will respond appropriately, e.g. ‘Hello Sean’, in a squeaky voice. It tracks any people it detects, following them around the room with its pan-tilt mounted camera.”

From this angle you can get a better look at the servos that control the camera

BB Robot: Quick Facts

  • BB has an 180-degree viewing angle

  • Like PiArm and other arm robots, BB cannot move around

  • There’s an inner case that holds all the electronics

  • Sean designed a relay circuit based on this one

  • The high-pitched voice is supposed to replicate the turrets from Portal

Seeing robot

Like a lot of Raspberry Pi robots, BB uses OpenCV. It’s a Python library that we’ve covered in the magazine before that allows people to add machine learning to image processing. Computer vision works fine on a Raspberry Pi – OpenCV has been used for the Formula Pi racing league, and face unlock Raspberry Pi tutorials have been around for as long as Raspberry Pi has.

See: Raspberry Pi face recognition

BB has an 180-degree viewing angle, so it can’t look behind itself

Sean tells us he has a lot of experience using a Raspberry Pi:

“I’ve found it a great platform for building robots with. It is more powerful than Arduino and other microcontrollers, yet smaller and cheaper than full desktops.”

A Raspberry Pi 3A+ is the main component, but extra circuitry is included. “A DIY power management circuit is used to turn Raspberry Pi on and off with a button, with a power indicator LED,” he explains. “An amplifier is included to power a small speaker, as well as connectors for the two servos. The camera is a standard Raspberry Pi [Camera Module], and the whole robot is held together with a black 3D-printed case, with a white shell to cover unsightly bolts.”

First steps

Creating BB was just the start of what Sean plans to do, with bigger and better robots already in development.

“I wanted to make a small 3D-printed robot, since I just acquired a 3D printer and wanted to make something cool,” he says. “I also wanted a platform to test offline computer vision on. My long-term goal is to create a Raspberry Pi-powered robot, capable of computer vision, speech recognition, and speech synthesis. I’ve already finished building my new platform to recognise speech… It is cube-shaped, with a similar colour scheme to BB. It features four microphones, as well as a speaker and LED ring. I’m hoping to combine the two robots to create a sophisticated machine, as if from a movie.”

We look forward to seeing this sophisticated machine in the future.

BB works by using OpenCV Python software to detect people, and looks at the first person in the image from the camera, using two 5 V micro servos for pan and tilt. Then, only if a person is detected, it will try to recognise any faces that are in the image, and respond appropriately if it recognises that person. It has a database of people’s faces in it, including Sean and his friends (with their consent). It also includes a real-time clock module, so it can wish a person happy birthday if the current date matches their stored birthday.

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.