Get all your news in one place.
100’s of premium titles.
One app.
Start reading
Tom’s Hardware
Tom’s Hardware
Technology
Ash Hill

Raspberry Pi Mood Light Changes Color by Detecting Your Emotions

Raspberry Pi

RGB lighting is cool, but choosing a color can be challenging. Why not let AI decide if you’re having trouble settling on a color? That’s precisely what maker and developer Mohammad Reza Sharifi has done with his latest Raspberry Pi project. In this case, Sharifi is using AI to detect emotions and change the color of an RGB light based on the detected emotion.

The processing starts on a separate PC running Microsoft VS Code and handles the AI processing using OpenCV and Deepface library. Sharifi uses a video slideshow with pictures of different emotions to demonstrate the project. The PC determines what emotion is likely being conveyed and then sends a command to the Pico to change the color of the light.

(Image credit: Mohammad Reza Sharifi)
(Image credit: Mohammad Reza Sharifi)
(Image credit: Mohammad Reza Sharifi)

This is one of many projects put together by Sharifi that we’ve had the pleasure of featuring. He has plenty of experience working with the Pico, like in this Pico surveillance robot project, and with OpenCV. He recently created a project that recognizes hand gestures to control a light. Given his history, it’s no surprise he created the clever project we have today.

This project doesn’t require much hardware to duplicate. You’ll need an RGB light of some sort. Sharifi uses a WS2812 5050 Adafruit NeoPixel Ring, but any RGB light will do in its place. A separate PC is necessary for the AI processing side of the project, and a Pico W is used to control the RGB lights. In this case, a Pico W is chosen for its network support.

The primary language used to program this project is Python. He’s using a custom Python script to operate OpenCV alongside the Deepface library. The Pico W communicates with the PC and RGB LEDs using MicroPython. All of the code used in this project has been shared to Hackster by Sharifi for anyone who wants to check it out for themselves.

To see this Raspberry Pi project in action, you can check out a demo video shared by Sharifi on YouTube. You can also explore the project in greater detail over at Hackster to see more details about how it goes together.

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.