Robotics is one of the many applications that the creators of the Raspberry Pi envisioned for their mini computer. By combining certain components with the right software, the Raspberry Pi can be transformed into a small robot with impressive educational potential. One of the best examples out there is Empathybot, a robot that detects emotions using a Raspberry Pi 3 as its brain and the Google Cloud Vision API.

Build a Robot That Reads Your Emotions with Raspberry Pi
Empathybot

A robot that can read emotions. Imagine creating something like this for a classroom. Ten years ago, a project with these characteristics would have cost a fortune, but now we can talk about 230 dollars per robot, and if we decide to improvise, the number will be even lower. Obviously, the key is a mini computer with the right balance between size and processing power, which brings us to the Raspberry Pi 3. The big brother of the Raspberry family has found a place of privilege in the design of the Empathybot robot, and here it is in action.

How Empathybot works

The Empathybot approaches a person (using the GoPiGo chassis or similar) and detects the necessary distance to interact with them using an ultrasonic sensor. Then, the robot takes a photograph of their face and processes it using the Raspberry Pi 3 in combination with the Google Cloud Vision API. The four emotions that Empathybot can detect are happiness, sadness, anger, and surprise. Depending on the emotion, Empathybot will try to start a conversation, asking why we are happy, or if we want a hug. The software used at this point is called eSpeak, and when the interaction ends, Empathybot moves away to look for someone else.

Limitations and code

The robot works as expected, but the most important limitations are the responsibility of the Cloud Vision API. It was very difficult for the API to detect anger or surprise in adults; however, it registered good results in happiness and sadness. A too-long beard can easily confuse Cloud Vision, and when seeing a baby's face, it almost always came to the conclusion that the baby was sad, when in reality it looked happy and surprised by the robot's movement. All the code involved is on GitHub, and the instructions to build Empathybot are on the official page (link below).

Official site: