Mood Ring

Mood Ring is an interactive mirror that illuminates based on your mood.

This mirror was designed to explore the feedback a mirror can give you. Instead of just your reflection, Mood Ring also tells you what it sees when you look into it.

This project was demo’d at the ITP winter show:

How does it work?

It uses a USB webcam connected to a computer running a facial recognition javascript library (called clmtrackr) to identify a mood (happy, sad, angry, surprised).

From there, A simple express app (code here) that takes value and sends a serial message to an arduino which is connected to the LED lights behind the mirror

 USB Camera -> Mac Mini -> Express App (CLM tracker + serial comm) -> Arduino -> Neopixel

Development

While there are dozens of emotion recognition APIs  out there, clmtracker is a simple javascript library to get started with. The emotion recognition model can be found in the examples folder, with the javascript code at the bottom of the HTML file here.

I modified this code (repository here), taking the information captured in the existing variable called “er”. er is a JSON file that looks like this:

0: {emotion: "angry", value: 0.07152128223058615}
1: {emotion: "sad", value: 0.7095454875430434}
2: {emotion: "surprised", value: 0.08409529802001421}
3: {emotion: "happy", value: 0.03446010808748219}

These emotion “values” are compared. If the highest one passes a threshold value (0.5 in my code), then the express app uses a POST message to write this information to the router (aka the index.js file).

If the router receives information, it passes it to an arduino via serial communication. The arduino is connected to a strip of 21 neopixels and programmed to do a simple “chase” animation when it gets new data.

You can learn how to customize this code for your needs by checking out the project github page.

Leave a Reply

Your email address will not be published. Required fields are marked *